"Invalid method Code length 67309 in class file org/eclipse/uml2/uml/util/UMLSwitch" and o [message #844682] |
Sat, 14 April 2012 08:23 |
Daniel P. Messages: 3 Registered: March 2011 |
Junior Member |
|
|
Hello,
we have some problems testing classes using the UML2 plugins.
We are using version 3.0.0 to be more compatible.
When testing locally, everything works fine. But we also have a Jenkins/Maven/Surefire testing setup and keep getting strange errors when testing.
It always seems to stem from methods trying to create CommunicationPath instances.
I'll try and post the code parts where the errors happen and then the corresponding error message:
CommunicationPath newPath = sourceNode.createCommunicationPath(false, AggregationKind.COMPOSITE_LITERAL,"", 1, 1, targetNode, false, AggregationKind.NONE_LITERAL, "", 1, 1);
The parameters all seem to be correct (the nodes are existent and in a model).
Stacktrace
java.lang.ClassFormatError: Invalid method Code length 67309 in class file org/eclipse/uml2/uml/util/UMLSwitch
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:626)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:608)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:626)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:608)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.eclipse.uml2.uml.util.UMLUtil.getOwnedAttributes(UMLUtil.java:9153)
at org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociationEnd(TypeOperations.java:155)
at org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociation(TypeOperations.java:232)
at org.eclipse.uml2.uml.internal.operations.NodeOperations.createCommunicationPath(NodeOperations.java:124)
at org.eclipse.uml2.uml.internal.impl.NodeImpl.createCommunicationPath(NodeImpl.java:396)
The next is another instance of creating a communication path. The code used is the same, the nodes are the same, the model is the same.
Stacktrace
java.lang.ClassFormatError: org/eclipse/uml2/uml/util/UMLUtil$2
at org.eclipse.uml2.uml.util.UMLUtil.getOwnedAttributes(UMLUtil.java:9153)
at org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociationEnd(TypeOperations.java:155)
at org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociation(TypeOperations.java:232)
at org.eclipse.uml2.uml.internal.operations.NodeOperations.createCommunicationPath(NodeOperations.java:124)
at org.eclipse.uml2.uml.internal.impl.NodeImpl.createCommunicationPath(NodeImpl.java:396)
Can somebody help me in understanding what is going wrong here?
|
|
|
Re: "Invalid method Code length 67309 in class file org/eclipse/uml2/uml/util/UMLSwitch& [message #846009 is a reply to message #844682] |
Sun, 15 April 2012 17:03 |
|
Hi, Daniel,
It looks like you're running into the 64 kB limit for the compiled code
size of a method that some JVMs implement, and which is at least one of
the reasons why the EMF Generator has the option to initialize a
package from the Ecore model at run-time. Models the size of UML2
easily generate XyzPackageImpl::init() methods that are larger than 64
kB.
Looking at the particular class in your scenario, I'll take a stab and
guess that the doSwitch(int, EObject) method is too large. It's 5146
lines long.
Does your JVM have any tuning parameters that you can specify on the
command-line to increase the size of methods that it will tolerate?
This method is accepted by every JVM I've used in recent memory.
I suppose it might be nice if the EMF Generator provided for breaking
up large doSwitch()s, somehow, but I'm not sure what that would look
like and what other problems might ensue. Especially as it doesn't
seem generally to be a problem in most deployments.
Cheers,
Christian
On 2012-04-14 08:23:02 +0000, Daniel W. said:
> Hello,
>
> we have some problems testing classes using the UML2 plugins.
> We are using version 3.0.0 to be more compatible.
>
> When testing locally, everything works fine. But we also have a
> Jenkins/Maven/Surefire testing setup and keep getting strange errors
> when testing.
>
> It always seems to stem from methods trying to create CommunicationPath
> instances.
>
> I'll try and post the code parts where the errors happen and then the
> corresponding error message:
>
> CommunicationPath newPath = sourceNode.createCommunicationPath(false,
> AggregationKind.COMPOSITE_LITERAL,"", 1, 1, targetNode, false,
> AggregationKind.NONE_LITERAL, "", 1, 1);
>
> The parameters all seem to be correct (the nodes are existent and in a model).
>
> Stacktrace
> java.lang.ClassFormatError: Invalid method Code length 67309 in class
> file org/eclipse/uml2/uml/util/UMLSwitch
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:626)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:608)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:626)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:608)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:562)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:486)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:459)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.eclipse.uml2.uml.util.UMLUtil.getOwnedAttributes(UMLUtil.java:9153)
> at
> org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociationEnd(TypeOperations.java:155)
>
> at
> org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociation(TypeOperations.java:232)
>
> at
> org.eclipse.uml2.uml.internal.operations.NodeOperations.createCommunicationPath(NodeOperations.java:124)
>
> at
> org.eclipse.uml2.uml.internal.impl.NodeImpl.createCommunicationPath(NodeImpl.java:396)
>
>
> The next is another instance of creating a communication path. The code
> used is the same, the nodes are the same, the model is the same.
>
> Stacktrace
> java.lang.ClassFormatError: org/eclipse/uml2/uml/util/UMLUtil$2
> at org.eclipse.uml2.uml.util.UMLUtil.getOwnedAttributes(UMLUtil.java:9153)
> at
> org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociationEnd(TypeOperations.java:155)
>
> at
> org.eclipse.uml2.uml.internal.operations.TypeOperations.createAssociation(TypeOperations.java:232)
>
> at
> org.eclipse.uml2.uml.internal.operations.NodeOperations.createCommunicationPath(NodeOperations.java:124)
>
> at
> org.eclipse.uml2.uml.internal.impl.NodeImpl.createCommunicationPath(NodeImpl.java:396)
>
>
> Can somebody help me in understanding what is going wrong here?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03915 seconds