users@glassfish.java.net

Re: Test EJB app with JUnit and maven-embedded-glassfish-plugin

From: Gregory Gerard <ggerard_at_mac.com>
Date: Wed, 20 Oct 2010 07:35:04 -0700

Can you relocate to another directory without spaces? Long shot but easy to try assuming no hard-coded paths in the pom.

Greg

On Oct 20, 2010, at 2:18, glassfish_at_javadesktop.org wrote:

> Hi Bhavani, thank you for your reply.
>
> I've tried to use maven-embedded-glassfish-plugin version 3.1-SNAPSHOT. However, this did not work out so well. This is output I got from maven:
>
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Unnamed - cz.datavision.testea:server:ejb:0.0.1
> [INFO] task-segment: [install]
> [INFO] ------------------------------------------------------------------------
> [INFO] snapshot org.glassfish:maven-embedded-glassfish-plugin:3.1-SNAPSHOT: checking for updates from central
> [INFO] [resources:resources {execution: default-resources}]
> [WARNING] Using platform encoding (Cp1250 actually) to copy filtered resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory C:\Users\Rudolf Vlk\workspace_testEA\TestEAEJB\src\main\resources
> [INFO] [compiler:compile {execution: default-compile}]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [resources:testResources {execution: default-testResources}]
> [WARNING] Using platform encoding (Cp1250 actually) to copy filtered resources, i.e. build is platform dependent!
> [INFO] skip non existing resourceDirectory C:\Users\Rudolf Vlk\workspace_testEA\TestEAEJB\src\test\resources
> [INFO] [compiler:testCompile {execution: default-testCompile}]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [surefire:test {execution: default-test}]
> [INFO] Tests are skipped.
> [INFO] [ejb:ejb {execution: default-ejb}]
> [INFO] Building ejb TestEA with ejbVersion 3.0
> [INFO] Building jar: C:\Users\Rudolf Vlk\workspace_testEA\TestEAEJB\target\TestEA.jar
> [INFO] [embedded-glassfish:start {execution: start-glassfish}]
> [INFO] snapshot org.glassfish.extras:glassfish-uber:3.1-SNAPSHOT: checking for updates from central
> Downloading: http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-uber/3.1-SNAPSHOT/glassfish-uber-3.1-SNAPSHOT.jar
> Created New Bootstrap ClassLoader. ServerId = maven, ClassPaths =
> ClassPath Element : file:/C:/Users/Rudolf%20Vlk/.m2/repository/org/glassfish/extras/glassfish-uber/3.1-SNAPSHOT/glassfish-uber-3.1-SNAPSHOT.jar
> ClassPath Element : file:/C:/Users/Rudolf%20Vlk/.m2/repository/org/glassfish/maven-embedded-glassfish-plugin/3.1-SNAPSHOT/maven-embedded-glassfish-plugin-3.1-SNAPSHOT.jar
> [FATAL ERROR] org.glassfish.maven.StartMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms:
> [FATAL ERROR] Plugin realm = app0.child-container[org.glassfish:maven-embedded-glassfish-plugin:3.1-SNAPSHOT]
> urls[0] = file:/C:/Users/Rudolf Vlk/.m2/repository/org/glassfish/maven-embedded-glassfish-plugin/3.1-SNAPSHOT/maven-embedded-glassfish-plugin-3.1-SNAPSHOT.jar
> urls[1] = file:/C:/Users/Rudolf Vlk/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
> [FATAL ERROR] Container realm = plexus.core
> urls[0] = file:/C:/Install/Maven/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] org/glassfish/embeddable/GlassFish
> org.glassfish.embeddable.GlassFish
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NoClassDefFoundError: org/glassfish/embeddable/GlassFish
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
> at java.lang.Class.getMethod0(Class.java:2670)
> at java.lang.Class.getMethod(Class.java:1603)
> at org.glassfish.maven.StartMojo.startGlassFish(StartMojo.java:69)
> at org.glassfish.maven.StartMojo.execute(StartMojo.java:61)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: java.lang.ClassNotFoundException: org.glassfish.embeddable.GlassFish
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> ... 25 more
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Wed Oct 20 10:53:28 CEST 2010
> [INFO] Final Memory: 12M/29M
> [INFO] ------------------------------------------------------------------------
>
> It seems like a bug in maven-embedded-glassfish-plugin.
>
> Regarding version 3.0.1 - I can file the bug report, but it seems that Harald was right that I had a missing dependency on gf-client.jar...so should I still file it?
> [Message sent by forum member 'rudolfvlk']
>
> http://forums.java.net/jive/thread.jspa?messageID=485679
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>