You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in older versions of Modelio (e.g. 4.1) it was possible in a script to load necessary external JAR-files via a URLClassLoader as follows:
fromjava.netimportURL, URLClassLoaderfromjava.langimportClassLoaderfromjava.ioimportFilejarFilePath="/path_to/xxx.jar"ifjarFilePathnotinsys.path:
sys.path.append(jarFilePath)
# add the jar to the ClassLoaderm=URLClassLoader.getDeclaredMethod("addURL", [URL])
m.accessible=1m.invoke(ClassLoader.getSystemClassLoader(),
[File(jarFilePath).toURL()])
import<<someclassfromxxx.jar>>
This no longer works, because the underlying JRE implementation has changed for Java 11 (the system class loader is no URL class loader any longer). The error message is
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: object is not an instance of declaring class in <script> at line number 13
Traceback (most recent call last):
File "<script>", line 13, in <module>
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: object is not an instance of declaring class
Is there any trick to get this problem solved in the Jython engine of Modelio?
Best regards,
Prof. Spock
The text was updated successfully, but these errors were encountered:
Dear all,
in older versions of Modelio (e.g. 4.1) it was possible in a script to load necessary external JAR-files via a URLClassLoader as follows:
This no longer works, because the underlying JRE implementation has changed for Java 11 (the system class loader is no URL class loader any longer). The error message is
Is there any trick to get this problem solved in the Jython engine of Modelio?
Best regards,
Prof. Spock
The text was updated successfully, but these errors were encountered: