Jhon,
One of the ways this error would manifest only after you bring the .jar file into BAW, is when BAW already has loaded an older version of the classes/interfaces. It does not take much for it to happen either. Once you upload version 1 of the jar and try to execute it the classes would be loaded. Then if you upload version 2 of the jar, not everything may get reloaded. Thus, the managed asset class loader would not find the latest method it is looking for in the definition that came from version 1 of the jar.
I have been able to resolve it by removing the jar and letting the service fail on the next try. Then reuploading the jar, with the hope that it would force the classes to be reloaded, or by simply restarting the dev instance (much more reliable). Hope this helps!
------------------------------
Ajay Katre
Salient Process
------------------------------
Original Message:
Sent: Wed March 06, 2024 07:17 AM
From: jhon wick
Subject: methods do not appear when importing jar
Atanu, hi. i created an interface for the method and a new class to run the method from. when running the interface and the method i get this error:
<error type="java.lang.NoSuchMethodError" description="NoSuchMethodError"> <cause type="java.lang.Throwable" description="cause"></cause> <localizedMessage type="java.lang.String" description="String">org/example/FileToSQL.<init>(Ljava/lang/String;)V (loaded from managedasset:61.6d8885d5-6887-41d5-96c3-125570ae46ae by com.lombardisoftware.server.core.ManagedAssetClassLoader@e011f1e2 [current classloaderMap size=129, initial classloaderMap size=1000]) called from interface org.example.InterfaceFileToSQL (loaded from managedasset:61.1f25586c-c326-45d4-8007-0f6ecf42bf05 by com.lombardisoftware.server.core.ManagedAssetClassLoader@e011f1e2 [current classloaderMap size=129, initial classloaderMap size=1000]).</localizedMessage> <message type="java.lang.String" description="String">org/example/FileToSQL.<init>(Ljava/lang/String;)V (loaded from managedasset:61.6d8885d5-6887-41d5-96c3-125570ae46ae by com.lombardisoftware.server.core.ManagedAssetClassLoader@e011f1e2 [current classloaderMap size=129, initial classloaderMap size=1000]) called from interface org.example.InterfaceFileToSQL (loaded from managedasset:61.1f25586c-c326-45d4-8007-0f6ecf42bf05 by com.lombardisoftware.server.core.ManagedAssetClassLoader@e011f1e2 [current classloaderMap size=129, initial classloaderMap size=1000]).</message> <stackTrace type="[Ljava.lang.StackTraceElement;" description="StackTraceElement;">
when tested in my ide both methods work fine
------------------------------
jhon wick
------------------------------
Original Message:
Sent: Tue March 05, 2024 08:21 AM
From: Atanu Roy
Subject: methods do not appear when importing jar
Hi John,
Can you try running the methods from the main method in the same class before exporting the JAR, sometimes I also face this issue, this works for me.
Please let me know if this works.
Thanks!
------------------------------
Atanu Roy
Lead Engineer
London Stock Exchange Group