| View previous topic :: View next topic |
| Author |
Message |
s.hauser
Joined: 21 Dec 2009 Posts: 4
|
Posted: Mon Dec 21, 2009 12:39 pm Post subject: EJB Maven Project: Testing |
|
|
Hi
I tried the new NB 6.8 with Maven and Glassfish v3.
While testing i discoverd the automatic generated test code for ejb dont seems to work within a maven project.
Following Error occours:
Absent Code attribute in method that is not native or abstract in class file Absent Code attribute in method that is not native or abstract in class file javax/ejb/embeddable/EJBContainer
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ejb/embeddable/EJBContainer
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:698)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
I compared it with a traditional ant project and saw that the depency for the embedded glassfish seems to be missing. So i tried to add this depency by adding the http://download.java.net/maven/glassfish/ repository and using the
glassfish-embedded-all snapshot. But this didnt help at all.
Can someone explain me what's the error here and how i can fix it?
kr
Sev |
|
| Back to top |
|
 |
Alexis Moussine-Pouchkine Posted via mailing list.
|
Posted: Mon Dec 21, 2009 3:51 pm Post subject: Re: EJB Maven Project: Testing |
|
|
does this help: http://blogs.sun.com/alexismp/entry/testing_ejb_3_1_s ?
-Alexis
On Dec 21, 2009, at 13:39, s.hauser wrote:
| Quote: | Hi
I tried the new NB 6.8 with Maven and Glassfish v3.
While testing i discoverd the automatic generated test code for ejb
dont seems to work within a maven project.
Following Error occours:
Absent Code attribute in method that is not native or abstract in
class file Absent Code attribute in method that is not native or
abstract in class file javax/ejb/embeddable/EJBContainer
java.lang.ClassFormatError: Absent Code attribute in method that is
not native or abstract in class file javax/ejb/embeddable/EJBContainer
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:698)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
398)
I compared it with a traditional ant project and saw that the
depency for the embedded glassfish seems to be missing. So i tried
to add this depency by adding the http://download.java.net/maven/glassfish/
repository and using the
glassfish-embedded-all snapshot. But this didnt help at all.
Can someone explain me what's the error here and how i can fix it?
kr
Sev
|
|
|
| Back to top |
|
 |
s.hauser
Joined: 21 Dec 2009 Posts: 4
|
|
| Back to top |
|
 |
alexismp
Joined: 22 Dec 2009 Posts: 9 Location: Paris, FRANCE
|
Posted: Tue Dec 22, 2009 5:45 pm Post subject: |
|
|
| I'd suggest not using SNAPSHOT but b74.2 instead which is the v3 final version. Have you tried http://download.java.net/maven/2 (not "/maven2")? |
|
| Back to top |
|
 |
s.hauser
Joined: 21 Dec 2009 Posts: 4
|
Posted: Wed Dec 23, 2009 1:13 pm Post subject: |
|
|
I found the problem.
The javaee-api is added by netbeans as "provided".
This conflicts with my manual entry.
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.0-b74b</version>
<scope>test</scope>
</dependency>
If i remove the javaee-api the test runs fine and the deployment still works.
But i dont understand why. As far i know the scope "provided" should be ignored in the test run.
kr Sev
PS: I dont see a glassfish embedded version in http://download.java.net/maven/2/. |
|
| Back to top |
|
 |
petarj
Joined: 24 Jan 2010 Posts: 1
|
Posted: Sun Jan 24, 2010 9:57 pm Post subject: |
|
|
Yes that solved a problem for me too, thanks.
A small update to that, inspired by this post:
I rearranged dependencies like this:
| Code: |
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.0-b74</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<version>5</version>
<scope>provided</scope>
</dependency>
|
and it worked fine without having to switch javaee scope every time i needed testing. |
|
| Back to top |
|
 |
9802075
Joined: 07 Mar 2010 Posts: 4 Location: Finland
|
Posted: Fri Mar 19, 2010 4:23 pm Post subject: |
|
|
I am a bit newbie with Netbeans 6.8 and Glassfish v3, and I have the same problem with testing EJB's in embedded container with JUnit4. I get the error message saying "no EJBContainer provider available".
I am not able to modify pom.xml or pom.modify -files under glassfish-embedded-static-shell.jar in Netbeans, the pom.xml won't even open. Neither am I able to locate the glassfish-embedded-static-shell.jar -file in my computer in order to add a xml-file there. Besides, after saving the xml-file I got from http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-embedded-all/3.1-SNAPSHOT/glassfish-embedded-all-3.1-SNAPSHOT.pom I am not able to modify it with my xml-editor.
I would like to know exactly how to modify those files and where to put them in order to get testing EJB's working. Could u help me?
-M-
EDIT: I figured out the modifying part of my problem. I still need help with the proper location. |
|
| Back to top |
|
 |
9802075
Joined: 07 Mar 2010 Posts: 4 Location: Finland
|
Posted: Mon Mar 22, 2010 8:59 pm Post subject: |
|
|
| I downloaded the glassfish-embedded-all.jar -file and added it to the classpath. Now I get a nerror saying "invalid signature file digest for Manifest main attributes". I tried to google a solution for it, but couldn't find anything useful. Any idea what it might be all about? |
|
| Back to top |
|
 |
locrianmode
Joined: 13 Apr 2010 Posts: 1
|
Posted: Tue Apr 13, 2010 2:42 am Post subject: Invalid signature file digest for Manifest main attributes |
|
|
| 9802075 wrote: | | I downloaded the glassfish-embedded-all.jar -file and added it to the classpath. Now I get a nerror saying "invalid signature file digest for Manifest main attributes". I tried to google a solution for it, but couldn't find anything useful. Any idea what it might be all about? |
Somehow, the newer jars are signed. I removed the META-INF/ECLIPSEF.RSA and META-INF/ECLIPSEF.SF files from the jar and there's no more error.
Apart from these, I don't have any idea what's happening
You can use any zip/rar program such as WinRAR to do that or unjar/jar without those files. |
|
| Back to top |
|
 |
|