users@glassfish.java.net

Re: ejb testing with embedabble container

From: <thomas_at_randspringer.de>
Date: Tue, 13 Jul 2010 14:16:54 +0200 (CEST)

Hi,
 
I just want note that I successful run the EJB-client against the deployed glassfish-EJB and also run a test of my simple Entity-Class in JUNIT.
However everytime I try to activate my EJB-Testclass I get these exceptions,see:
 
http://www.randspringer.de/ejbtest2_gf.log
 
severe errors:
 
* Jul 13, 2010 2:09:09 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl getValidFile
SEVERE: ejb.embedded.location_not_exists

* SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml = META-INF/gfprobe-provider.xml
java.lang.IllegalStateException: Provider already mapped glassfish:javamail:smtp-transport
        at org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:96)

* SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'cobradev' in SerialContext  [Root exception is javax.naming.NameNotFoundException: cobradev not found]
        at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:107)


* SEVERE: Exception while preparing the app
java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'cobradev' in SerialContext  [Root exception is javax.naming.NameNotFoundException: cobradev not found]
        at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:107)



I think the "worst" exception is the javax.naming.NamingException for my JDBC-resource.
In my glassfish-server I created such a JDBC-Resource. How must I specify it in the embedded server?
And how to overcome the other exceptions?

Best regards
Thomas



"thomas_at_randspringer.de" <thomas_at_randspringer.de> hat am 13. Juli 2010 um 08:42 geschrieben:

> Hi,
>  
> I try to test my EJB with the embedabble container and get some errors:
>  
> From my mavens pom.xml :
> ...
> <dependency>
>    <groupId>org.glassfish.extras</groupId>
>    <artifactId>glassfish-embedded-all</artifactId>
>    <version>3.1-b09</version>
>    <scope>test</scope>
> </dependency>
>  
> From my EJBTest-Class:
>  
> @Test
> public void createContainerContent() throws Exception {
>    ec = EJBContainer.createEJBContainer();
>    ctx = ec.getContext();
>    ...
>    ContainerContentEJB container_contentEJB =
>      (ContainerContentEJB) ctx.lookup("java:global/ContainerContentEJB");
>  ...}
>  
> my Test-Sysout (complete log see: http://www.randspringer.de/ejbtest_gf.log ) :
>  
> ...
> SEVERE: MNTG0301:Cannot process XML ProbeProvider, xml = META-INF/gfprobe-provider.xml
> java.lang.IllegalStateException: Provider already mapped glassfish:javamail:smtp-transport
>         at org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(ProbeProviderRegistry.java:96)
> ...
>  
> SEVERE: Module type not recognized for module /opt/workarea/eclipse_glassfish_workspace/cobra-glassfish/gfembed5910314841914317090tmp/applications/classes
> Jul 12, 2010 5:07:37 PM org.glassfish.api.ActionReport failure
> SEVERE: There is no installed container capable of handling this application classes
> Jul 12, 2010 5:07:37 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
> INFO: [EJBContainerProviderImpl] Cleaning up on failure ...
> Jul 12, 2010 5:07:37 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
> INFO: JMXStartupService and JMXConnectors have been shut down.
> Jul 12, 2010 5:07:37 PM com.sun.enterprise.v3.server.AppServerStartup stop
> INFO: Shutdown procedure finished
> Jul 12, 2010 5:07:37 PM AppServerStartup run
> INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting
> Jul 12, 2010 5:07:38 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
> SEVERE: ejb.embedded.exception_instantiating
> javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
>  
>  
> From surefire-output:
>  
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 22.636 sec <<< FAILURE!
> createContainerContent(de.otto.cobra.business.ContainerContentEJBTest)  Time elapsed: 22.58 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)
>  
> How to fiy all this severe errors?
>  
> Best regards
> Thomas