Closed apeteri closed 9 years ago
Could you please provide an example project for me to reproduce the problem.
Hello Sebastian,
The stack trace mentions SpecJvmModelInferrer
, but minimal feature files also exhibited this behavior when I added a very simple scenario (I used the calculator example from the Jnario website, without an actual Calculator
, just adding two ints together, and checking the result).
The issue first came up with an earlier Eclipse installation, where lots of additional Eclipse features were gathered over time. Since my initial report, I did some further debugging using that instance, which revealed that a third-party bundle wrapped a separate set of Xtend and Xbase libraries and exported them via an Export-Package
directive -- so there actually were two different sources for Procedure1
. Uninstalling the third-party bundle solved the problem.
The cause seems to be completely external to Jnario, so I'd opt for closing the issue.
That indeed explains your problems. Thanks for letting me know.
@apeteri : Is it possible to give details on how to identify the external bundle that use the Export-Package
directive? I encounter the same issue but I cannot find which bundle to remove.
Hi @tkokasih,
In my case, the issue originated from the Eclipse theme plugin (which I do like) by @jeeeyul. If you don't have it installed, and want to dive deep into troubleshooting, you'll have to check the class loader of the interface Procedure1
in a debugger at ImplicitSubject.java:87
, while connecting to the problematic Eclipse instance using remote debug.
One reference to check is the (actual) parameter _function
; you can evaluate the following expression in the Display view when the breakpoint is hit:
_function.getClass().getInterfaces()[0].getClassLoader()
The other is the last (formal) parameter of ExtendedJvmTypesBuilder.toField(...)
; for that, you'll have to take a look at all methods of the class by inspecting the return value of the following expression:
ExtendedJvmTypesBuilder.class.getMethods()
Find the appropriate array index "n" for the method toMethod(EObject, String, JvmTypeReference, Procedure1)
, then evaluate the following (in the example below, the index is 15):
ExtendedJvmTypesBuilder.class.getMethods()[15].getParameterTypes[3].getClassLoader()
...to display the class loader for the fourth argument.
The string output of bundle class loaders should reveal the bundle they represent. If the values do not differ, you'll also have to check the other arguments in a similar fashion to determine whether EObject
or JvmTypeReference
comes from different class loaders at the point where the exception is thrown.
Hi,
I get the following exception when Jnario's builder processes a source file:
When debugging a running instance, I set a breakpoint in
ImplicitSubject
and evaluated the last executed line,ImplicitSubject.java:87
of the stack trace, which resulted in the following exception:Which also seem to indicate that somehow the anonymous class' parent
Procedure1
ends up getting loaded by two different classloaders, but I couldn't figure out how and why.Similar exceptions appear when the outline view and highlighting is updated in any spec or feature editor, but they usually involve
org.jnario.jvmmodel.ExtendedJvmTypesBuilder.toMethod
instead, with similar inner callbackProcedure1
classes.Using Luna SR1, Jnario 1.0.0.201407142310, Xtext and Xtend SDK 2.6.2.v201407030533.