Skip to main content

Embedded GlassFish no EJBContainer available

9 replies [Last post]
Anonymous

Hi,

I'm using glassfish-embedded-all artifact for Maven unit testing
(3.1-SNAPSHOT and r38139), and simple rerunning the tests sometimes
(absolutely transiently) I get the following error message in
surefire-report:
javax.ejb.EJBException: No EJBContainer provider available
The following providers:
org.glassfish.ejb.embedded.EJBContainerProviderImpl
Returned null from createEJBContainer call.
at
javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:200)

and in the test output:
[#|2010-06-26T01:44:49.195+0200|SEVERE|glassfish3.1|javax.enterprise.system.container.ejb.org.glassfish.ejb.embedded|_ThreadID=1;_ThreadName=main;|EJB5169:Caught
exception instantiating EmbeddedContainer.
javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
at
org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:139)
at
org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)

It looks like, that this only occurs, when I'm not specifying the
directory for EJB module, with:
properties.put(EJBContainer.MODULES, new
File("../sch-kp-ejb-impl/target/classes"));
ejb = EJBContainer.createEJBContainer(properties);

When I'm not commenting out the properties.put line, then there is no
exception (tried several times).

Is this a known issue?

Thanks,
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
LuisMR
Offline
Joined: 2014-03-03

Hi,
Although this is an old post I wanted to show my solution.
I had to create a directory structure for the GF domain with an domain.xml sample inside. Then the test runs perfeclty.

Please see:http://ctpjava.blogspot.no/2009/10/unit-testing-ejbs-and-jpa-with.html

The sample domain.xml can be taken from:
https://embedded-glassfish.java.net/domain.xml

Regards,
Luis

mvatkina
Offline
Joined: 2005-04-04

"org.glassfish.ejb.embedded.glassfish.installation.root" should point to install root, not instance/domain location. That said, if you have all defaults, and add /lib/embedded/glassfish-embedded-static-shell.jar to your classpath, all locations will be calculated for you automatically.

-marina

Marina Vatkina

What is the complete output?

thanks,
-marina

Major Péter wrote:
> Hi,
>
> I'm using glassfish-embedded-all artifact for Maven unit testing
> (3.1-SNAPSHOT and r38139), and simple rerunning the tests sometimes
> (absolutely transiently) I get the following error message in
> surefire-report:
> javax.ejb.EJBException: No EJBContainer provider available
> The following providers:
> org.glassfish.ejb.embedded.EJBContainerProviderImpl
> Returned null from createEJBContainer call.
> at
> javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:200)
>
> and in the test output:
> [#|2010-06-26T01:44:49.195+0200|SEVERE|glassfish3.1|javax.enterprise.system.container.ejb.org.glassfish.ejb.embedded|_ThreadID=1;_ThreadName=main;|EJB5169:Caught
> exception instantiating EmbeddedContainer.
> javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
> at
> org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:139)
> at
> org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
> at
> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)
>
> It looks like, that this only occurs, when I'm not specifying the
> directory for EJB module, with:
> properties.put(EJBContainer.MODULES, new
> File("../sch-kp-ejb-impl/target/classes"));
> ejb = EJBContainer.createEJBContainer(properties);
>
> When I'm not commenting out the properties.put line, then there is no
> exception (tried several times).
>
> Is this a known issue?
>
> Thanks,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Major Péter

in console:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running hu.sch.web.ShowUserTest
[#|2010-06-26T02:08:56.913+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|Module
type not recognized for module
/home/aldaris/NetBeansProjects/korok/sch-kp-web/gfembed164689650484664981tmp/applications/korok-ejb|#]

[#|2010-06-26T02:08:56.922+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|There
is no installed container capable of handling this application korok-ejb|#]

[#|2010-06-26T02:08:57.567+0200|SEVERE|glassfish3.1|javax.enterprise.system.container.ejb.org.glassfish.ejb.embedded|_ThreadID=1;_ThreadName=main;|EJB5169:Caught
exception instantiating EmbeddedContainer.
javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
at
org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:139)
at
org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)
at
hu.sch.test.base.ContainerHolder.fireUpEJBContainer(ContainerHolder.java:25)
at hu.sch.test.base.AbstractTest.setup(AbstractTest.java:16)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
|#]

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 62.921
sec <<< FAILURE!

in surefire-reports:
-------------------------------------------------------------------------------
Test set: hu.sch.ejb.MailManagerTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 28.093
sec <<< FAILURE!
hu.sch.ejb.MailManagerTest Time elapsed: 0 sec <<< ERROR!
javax.ejb.EJBException: No EJBContainer provider available
The following providers:
org.glassfish.ejb.embedded.EJBContainerProviderImpl
Returned null from createEJBContainer call.

at
javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:200)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:135)
at
hu.sch.test.base.ContainerHolder.fireUpEJBContainer(ContainerHolder.java:25)
at hu.sch.test.base.AbstractTest.setup(AbstractTest.java:16)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

Thanks,
Peter

2010-06-26 03:53 keltezéssel, Marina Vatkina írta:
> What is the complete output?
>
> thanks,
> -marina
>
> Major Péter wrote:
>> Hi,
>>
>> I'm using glassfish-embedded-all artifact for Maven unit testing
>> (3.1-SNAPSHOT and r38139), and simple rerunning the tests sometimes
>> (absolutely transiently) I get the following error message in
>> surefire-report:
>> javax.ejb.EJBException: No EJBContainer provider available
>> The following providers:
>> org.glassfish.ejb.embedded.EJBContainerProviderImpl
>> Returned null from createEJBContainer call.
>> at
>> javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:200)
>>
>> and in the test output:
>> [#|2010-06-26T01:44:49.195+0200|SEVERE|glassfish3.1|javax.enterprise.system.container.ejb.org.glassfish.ejb.embedded|_ThreadID=1;_ThreadName=main;|EJB5169:Caught
>>
>> exception instantiating EmbeddedContainer.
>> javax.ejb.EJBException: Failed to deploy EJB modules - see log for
>> details
>> at
>> org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:139)
>>
>> at
>> org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
>>
>> at
>> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)
>>
>>
>> It looks like, that this only occurs, when I'm not specifying the
>> directory for EJB module, with:
>> properties.put(EJBContainer.MODULES, new
>> File("../sch-kp-ejb-impl/target/classes"));
>> ejb = EJBContainer.createEJBContainer(properties);
>>
>> When I'm not commenting out the properties.put line, then there is no
>> exception (tried several times).
>>
>> Is this a known issue?
>>
>> Thanks,
>> Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Major Péter

and a new stacktrace also appeared:
[#|2010-06-26T09:14:40.402+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|Exception
while deploying the app
java.lang.IllegalArgumentException: Sniffers with type [ejb] and type
[appclient] should not claim the archive at the same time. Please check
the packaging of your archive
[/home/aldaris/NetBeansProjects/korok/sch-kp-ejb-impl/gfembed7706979256912597318tmp/applications/korok-ejb]
at
com.sun.enterprise.v3.server.SnifferManagerImpl.validateSniffers(SnifferManagerImpl.java:221)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:447)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:282)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:203)
at
org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:196)
at
org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:130)
at
org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)
at
hu.sch.test.base.ContainerHolder.fireUpEJBContainer(ContainerHolder.java:24)
at hu.sch.test.base.AbstractTest.setup(AbstractTest.java:16)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

My EJB module (name: korok-ejb) has two test classes, the first is
failing with this message, but the second one is able to start and run
the test with the same packaging... in surefire config the forkMode is
set to once.

Thanks,
Peter

2010-06-26 08:38 keltezéssel, Major Péter írta:
> in console:
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running hu.sch.web.ShowUserTest
> [#|2010-06-26T02:08:56.913+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|Module
> type not recognized for module
> /home/aldaris/NetBeansProjects/korok/sch-kp-web/gfembed164689650484664981tmp/applications/korok-ejb|#]
>
> [#|2010-06-26T02:08:56.922+0200|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|There
> is no installed container capable of handling this application korok-ejb|#]
>
> [#|2010-06-26T02:08:57.567+0200|SEVERE|glassfish3.1|javax.enterprise.system.container.ejb.org.glassfish.ejb.embedded|_ThreadID=1;_ThreadName=main;|EJB5169:Caught
> exception instantiating EmbeddedContainer.
> javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
> at
> org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:139)
> at
> org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
> at
> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)
> at
> hu.sch.test.base.ContainerHolder.fireUpEJBContainer(ContainerHolder.java:25)
> at hu.sch.test.base.AbstractTest.setup(AbstractTest.java:16)
> 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
> 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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
> at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
> |#]
>
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 62.921
> sec <<< FAILURE!
>
> in surefire-reports:
> -------------------------------------------------------------------------------
> Test set: hu.sch.ejb.MailManagerTest
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 28.093
> sec <<< FAILURE!
> hu.sch.ejb.MailManagerTest Time elapsed: 0 sec <<< ERROR!
> javax.ejb.EJBException: No EJBContainer provider available
> The following providers:
> org.glassfish.ejb.embedded.EJBContainerProviderImpl
> Returned null from createEJBContainer call.
>
> at
> javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:200)
> at
> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:135)
> at
> hu.sch.test.base.ContainerHolder.fireUpEJBContainer(ContainerHolder.java:25)
> at hu.sch.test.base.AbstractTest.setup(AbstractTest.java:16)
> 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
> 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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
> at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
>
> Thanks,
> Peter
>
>
> 2010-06-26 03:53 keltezéssel, Marina Vatkina írta:
>> What is the complete output?
>>
>> thanks,
>> -marina
>>
>> Major Péter wrote:
>>> Hi,
>>>
>>> I'm using glassfish-embedded-all artifact for Maven unit testing
>>> (3.1-SNAPSHOT and r38139), and simple rerunning the tests sometimes
>>> (absolutely transiently) I get the following error message in
>>> surefire-report:
>>> javax.ejb.EJBException: No EJBContainer provider available
>>> The following providers:
>>> org.glassfish.ejb.embedded.EJBContainerProviderImpl
>>> Returned null from createEJBContainer call.
>>> at
>>> javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:200)
>>>
>>> and in the test output:
>>> [#|2010-06-26T01:44:49.195+0200|SEVERE|glassfish3.1|javax.enterprise.system.container.ejb.org.glassfish.ejb.embedded|_ThreadID=1;_ThreadName=main;|EJB5169:Caught
>>>
>>> exception instantiating EmbeddedContainer.
>>> javax.ejb.EJBException: Failed to deploy EJB modules - see log for
>>> details
>>> at
>>> org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:139)
>>>
>>> at
>>> org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
>>>
>>> at
>>> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)
>>>
>>>
>>> It looks like, that this only occurs, when I'm not specifying the
>>> directory for EJB module, with:
>>> properties.put(EJBContainer.MODULES, new
>>> File("../sch-kp-ejb-impl/target/classes"));
>>> ejb = EJBContainer.createEJBContainer(properties);
>>>
>>> When I'm not commenting out the properties.put line, then there is no
>>> exception (tried several times).
>>>
>>> Is this a known issue?
>>>
>>> Thanks,
>>> Peter
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

tjquinn
Offline
Joined: 2005-03-30

Hello, Peter.

Does your EJB JAR's manifest contain a Main-Class setting?

If so, that's causing the problem.

When GlassFish tries to decide what module type each module is, each module type's "sniffer" judges for itself whether it recognizes a particular module. The sniffers usually try the easy things first - such as descriptors that are specific to a particular module type. For example, the app client sniffer looks for application-client.xml or sun-application-client.xml in the module's META-INF directory.

If the sniffer finds no such descriptors it uses more involved decision-making. In the app client sniffer's case, it checks for a Main-Class value in the manifest. If it finds one then the app client sniffer decides that the module is an app client.

In some cases it makes sense for more than one sniffer to recognize a module - for example, the security sniffer is "orthogonal" to the more familiar module-type sniffers such as EJB, web, and app client, and its common for the security sniffer and, say, the EJB sniffer to recognize the same module. That's fine. But it's not generally OK for multiple Java EE module type sniffers to recognize the same module. That's what's happening here - the app client sniffer and the EJB sniffer both recognize the module.

- Tim

Major Péter

Hi Tim,

My EJB JAR's manifest does not contain the Main-class entry, but this
error only occured once for me, the other transient problem caused me
more headache..
In the very end I decided to hardcode my module path, so GlassFish will
always find the EJB, and it will be also _much_ faster (specified 26sec,
not specified: 40-50s to startup), and so I don't have to add for my
webmodule tests the EJB module with test scope..

Regards,
Peter

2010-06-28 19:29 keltezéssel, glassfish@javadesktop.org írta:
> Hello, Peter.
>
> Does your EJB JAR's manifest contain a Main-Class setting?
>
> If so, that's causing the problem.
>
> When GlassFish tries to decide what module type each module is, each module type's "sniffer" judges for itself whether it recognizes a particular module. The sniffers usually try the easy things first - such as descriptors that are specific to a particular module type. For example, the app client sniffer looks for application-client.xml or sun-application-client.xml in the module's META-INF directory.
>
> If the sniffer finds no such descriptors it uses more involved decision-making. In the app client sniffer's case, it checks for a Main-Class value in the manifest. If it finds one then the app client sniffer decides that the module is an app client.
>
> In some cases it makes sense for more than one sniffer to recognize a module - for example, the security sniffer is "orthogonal" to the more familiar module-type sniffers such as EJB, web, and app client, and its common for the security sniffer and, say, the EJB sniffer to recognize the same module. That's fine. But it's not generally OK for multiple Java EE module type sniffers to recognize the same module. That's what's happening here - the app client sniffer and the EJB sniffer both recognize the module.
>
> - Tim
> [Message sent by forum member 'tjquinn']

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

szobi
Offline
Joined: 2009-02-27

Hello Péter, Tim

Péter, how did you hardcode your module path?

I am trying to use Glassfish Embedded Ejb Container form a junit test. I use ant, i don't use maven.

No matter what I do, I always get the "No EJBContainer provider available: no provider names had been found." error.

I tried specifying the all the possible properties I have found on the web, but I had no luck.

Map properties = new HashMap();
properties.put(EJBContainer.MODULES, new File("[MyProjectsFolder]/build/classes"));
properties.put("org.glassfish.ejb.embedded.glassfish.installation.root",
"/Develop/servers/glassfishv3/glassfish/domains/domain1");

EJBContainer ejbC = EJBContainer.createEJBContainer(properties);
Context context = ejbC.getContext();

I have the tests in an EJB project which is a part of an EAR project.

I also tried using OpenEJB which only worked if I have @Local interfaces for my beans, what I don't need, and also CDI (weld) does not work if I have any.

I would really like to use the embedded EJBContainer. Is there a complete guide somewhere about how to set it up without maven?

Any answer is highly appreciated

Best Regards - István

Message was edited by: szobi

Major Péter

Hi,

my source code (for Maven) is available at
http://stewie.sch.bme.hu/gitweb/?p=aldaris/korok;a=tree;f=sch-pek-test/s...

you should see another error messages prior to failed startup, what is
it? We have builded by hand an own embedded a few months ago, it is
available at
http://stewie.sch.bme.hu/nexus/content/repositories/thirdparty/org/glass...
. It is more or less stable, since it creates 'null' named directories,
but that's all the problem we had with it. Can you try with this? GF
trunk is a bit messy, and time-to-time there are buggy snapshots :( .

Also you need to make sure, that only one EJB container is created in a
single JVM (check out ContainerHolder singleton).

Regards,
Peter

2010-09-03 09:00 keltezéssel, glassfish@javadesktop.org írta:
> Hello Péter, Tim
>
> Péter, how did you hardcode your module path?
>
> I am trying to use Glassfish Embedded Ejb Container form a junit test. I use ant, i don't use maven.
>
> No matter what I do, I always get the "No EJBContainer provider available: no provider names had been found." error.
>
> I tried specifying the all the possible properties I have found on the web, but I had no luck.
>
> Map properties = new HashMap();
> properties.put(EJBContainer.MODULES, new File("[MyProjectsFolder]/build/classes"));
> properties.put("org.glassfish.ejb.embedded.glassfish.installation.root",
> "/Develop/servers/glassfishv3/glassfish/domains/domain1");
>
> EJBContainer ejbC = EJBContainer.createEJBContainer(properties);
> Context context = ejbC.getContext();
>
> I want have the tests in an EJB project which is a part of an EAR project.
>
> I also tried using OpenEJB which only worked if I have @Local interfaces for my beans, what I don't need, and also CDI (weld) does not work if I have any.
>
> I would really like to use the embedded EJBContainer. Is there a complete guide somewhere about how to set it up without maven?
>
> Any answer is highly appreciated
>
> Best Regards - István
> [Message sent by forum member 'szobi']
>
> http://forums.java.net/jive/thread.jspa?messageID=481770

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net