You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dan Greening (JIRA)" <ji...@codehaus.org> on 2006/03/28 07:44:44 UTC

[jira] Created: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
------------------------------------------------------------------------------------------------

         Key: SUREFIRE-38
         URL: http://jira.codehaus.org/browse/SUREFIRE-38
     Project: surefire
        Type: Bug

    Versions: 1.5.2    
 Environment: maven 2.0.3
    Reporter: Dan Greening
 Assigned to: Jason van Zyl 
    Priority: Critical
 Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz

JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.

Here's a complete set of instruction to reproduce it.

This is a test showing that surefire does not properly handle the JBoss EJB3
embeddable container.

The instructions are a bit complex, because you have to download a package of
JARs from JBoss.  (They make the test file too big to attach in JIRA.)

To confirm,

1. cd /tmp

2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063

3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
   the latest EJB3 embeddable system.

4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip

5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
   to this JIRA ticket).

6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz

7. cd jboss-ejb3-embeddable-test-with-junit

8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib

9. ./deploy-jars.perl

10. type "mvn test".

11. Note that the test fails.

12. Type "mvn eclipse:eclipse"

13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".

14. Set M2_REPO build variable to your .m2/repository folder.

15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Posted by "Dan Greening (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-38?page=comments#action_64560 ] 

Dan Greening commented on SUREFIRE-38:
--------------------------------------

I think there must have been some other improvement to Surefire or JBoss Embeddable, because I just tried recompiling my EJB3 component (now under JBoss EJB3 Embeddable version Alpha6 and -- without any changes -- it now passes all the tests.

Please note, I still must use my personal copy of the EJB plugin, though I provided a patch a month ago in MEJB-6 which we all agree is good.  

CAN MEJB-6 PLEASE BE RESOLVED?  It is marked as a "trivial" bug, but it isn't.  EJB3s cannot be built properly with the official EJB plugin, however the patch I provided in MEJB-6 allows this to be done, and also retains the proper checking for EJB 2.1 (the EJB version is a pom-supplied parameter).

Pretty, pretty please?

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Brett Porter
>     Priority: Critical
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Posted by "Dan Greening (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-38?page=comments#action_62183 ] 

Dan Greening commented on SUREFIRE-38:
--------------------------------------

Here is the test report showing the failure:

-------------------------------------------------------------------------------
Battery: org.jboss.tutorial.junit.EmbeddedEjb3TestCase
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 5.65 sec

testEJBs(org.jboss.tutorial.junit.EmbeddedEjb3TestCase)  Time elapsed: 0.005 sec  <<< ERROR!

[ stdout ] ---------------------------------------------------------------


[ stderr ] ---------------------------------------------------------------


[ stacktrace ] -----------------------------------------------------------
javax.naming.NameNotFoundException: CustomerDAOBean not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
        at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
        at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at org.jboss.tutorial.junit.EmbeddedEjb3TestCase.testEJBs(EmbeddedEjb3TestCase.java:86)
        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:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        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:585)
        at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242)
        at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216)
        at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
        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:585)
        at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:285)
        at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:201)        at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
        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:585)
        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)

testEntityManager(org.jboss.tutorial.junit.EmbeddedEjb3TestCase)  Time elapsed: 0.001 sec  <<< ERROR!

[ stdout ] ---------------------------------------------------------------


[ stderr ] ---------------------------------------------------------------


[ stacktrace ] -----------------------------------------------------------
javax.naming.NameNotFoundException: custdb not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
        at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
        at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at org.jboss.tutorial.junit.EmbeddedEjb3TestCase.testEntityManager(EmbeddedEjb3TestCase.java:111)
        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:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        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:585)
        at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242)
        at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216)
        at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
        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:585)
        at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:285)
        at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:201)        at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
        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:585)
        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)

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Jason van Zyl
>     Priority: Critical
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-38?page=all ]

Brett Porter updated SUREFIRE-38:
---------------------------------

    Fix Version: 2.0

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Jason van Zyl
>     Priority: Critical
>      Fix For: 2.0
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Posted by "Dan Greening (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-38?page=comments#action_62185 ] 

Dan Greening commented on SUREFIRE-38:
--------------------------------------

Here's something else you can try that actually CRASHES surefire (but still runs fine in eclipse):

Change EmbeddedEjb3TestCase.startupEmbeddedJboss to be this:

   public static void startupEmbeddedJboss()
   {
         EJB3StandaloneBootstrap.boot("target/test-classes");
         EJB3StandaloneBootstrap.scanClasspath("target/classes");
   }

Don't know what it is, but it seems like a bug.

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Jason van Zyl
>     Priority: Critical
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-38?page=all ]
     
Brett Porter closed SUREFIRE-38:
--------------------------------

      Assign To: Brett Porter  (was: Jason van Zyl)
     Resolution: Won't Fix
    Fix Version:     (was: 2.0)

this is a result of some pretty poort error handling in JBoss, AFAICT.

I've fixed the NPE when the lines are changed so the actual exception is reported that was later shown, but going back to the original lines....

The reason this doesn't work out of the box, as the JBoss Javadoc says, is that  scanClasspath scans java.class.path, which just isn't set in an embedded test. You need to fork. So I added:

<forkMode>pertest</forkMode><childDelegation>false</childDelegation>

This still failed, without giving much reason except that it couldn't find something. I compared the compilation output of eclipse and Maven and found that Eclipse didn't have all the source and test classes mixed together, as Maven did due to misconfiguration in the POM, so I added these to the compiler plugin:

<excludes><exclude>**/Embedded*</exclude></excludes>
<testExcludes><testExclude>**/Customer*</testExclude></testExcludes>

It now works just fine. The latter would be simpler if the two test and src trees were separate instead.

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Brett Porter
>     Priority: Critical
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Posted by "Carlos Sanchez (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-38?page=comments#action_62138 ] 

Carlos Sanchez commented on SUREFIRE-38:
----------------------------------------

Can your try setting childDelegation to false in your surefire plugin configuration?

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Jason van Zyl
>     Priority: Critical
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (SUREFIRE-38) Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)

Posted by "Dan Greening (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-38?page=comments#action_62177 ] 

Dan Greening commented on SUREFIRE-38:
--------------------------------------

Yes it is set to false in the pom.xml.  (You can see that if you download the attachment.)

> Surefire Maven2 Plugin fails to run EJB3 Embeddable Container (but mvn eclipse:eclipse succeeds)
> ------------------------------------------------------------------------------------------------
>
>          Key: SUREFIRE-38
>          URL: http://jira.codehaus.org/browse/SUREFIRE-38
>      Project: surefire
>         Type: Bug

>     Versions: 1.5.2
>  Environment: maven 2.0.3
>     Reporter: Dan Greening
>     Assignee: Jason van Zyl
>     Priority: Critical
>  Attachments: jboss-ejb3-embeddable-test-with-junit.tar.gz
>
>
> JBoss's EJB3 embeddable container, which is very handy for unit testing EJB's without using an application server, will not work under surefire in Maven2.  It works fine under Maven1.  Furthermore, it ALSO works using the Maven2 eclipse-plugin generated .project/.classpath in Eclipse.
> Here's a complete set of instruction to reproduce it.
> This is a test showing that surefire does not properly handle the JBoss EJB3
> embeddable container.
> The instructions are a bit complex, because you have to download a package of
> JARs from JBoss.  (They make the test file too big to attach in JIRA.)
> To confirm,
> 1. cd /tmp
> 2. Surf to http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=132063
> 3. Download jboss-EJB-3.0_Embeddable_ALPHA_5.zip.  Put it in /tmp.  This is
>    the latest EJB3 embeddable system.
> 4. unzip jboss-EJB-3.0_Embeddable_ALPHA_5.zip
> 5. Download jboss-ejb3-embeddable-test-with-junit.tar.gz (it is an attachment
>    to this JIRA ticket).
> 6. tar xvfz jboss-ejb3-embeddable-test-with-junit.tar.gz
> 7. cd jboss-ejb3-embeddable-test-with-junit
> 8. cp -pR ../jboss-EJB-3.0_Embeddable_ALPHA_5/lib lib
> 9. ./deploy-jars.perl
> 10. type "mvn test".
> 11. Note that the test fails.
> 12. Type "mvn eclipse:eclipse"
> 13. Import the jboss-ejb3-embeddable-test-with-junit directory into Eclipse as an "existing project".
> 14. Set M2_REPO build variable to your .m2/repository folder.
> 15. Run the EmbeddedEjb3TestCase as a JUnit test in Eclipse.  It works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira