users@glassfish.java.net

glassfish-embedded-all and JMS

From: <glassfish_at_javadesktop.org>
Date: Wed, 30 Jun 2010 04:35:21 PDT

Hi. I am trying to look up a jms/Queue using glassfish-embedded-all. Here is the code:
[code]
EmbeddedFileSystem.Builder efsb = new EmbeddedFileSystem.Builder();
efsb.configurationFile(new File("domain.xml"), true);
efsb.autoDelete(true);
EmbeddedFileSystem efs = efsb.build();

Server.Builder builder = new Server.Builder("test");
builder.embeddedFileSystem(efs);
Server server = builder.build();
server.addContainer(Type.web);
server.addContainer(Type.ejb);

InitialContext ic = new InitialContext();
UserTransaction ut = (UserTransaction) ic.lookup("java:comp/UserTransaction");
Queue queue = (Queue) ic.lookup("jms/Queue");

System.in.read();
server.stop();
[/code]
The domain.xml file contains the definition for the Queue. What I get is:
[code]
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors
        at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:198)
        at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:329)
        at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:327)
        at com.sun.enterprise.connectors.service.ConnectorService.loadDeferredResourceAdapter(ConnectorService.java:164)
        at com.sun.enterprise.connectors.service.ConnectorService.ifSystemRarLoad(ConnectorService.java:335)
        at com.sun.enterprise.connectors.service.ConnectorAdminObjectAdminServiceImpl.addAdminObject(ConnectorAdminObjectAdminServiceImpl.java:75)
        at com.sun.enterprise.connectors.ConnectorRuntime.addAdminObject(ConnectorRuntime.java:948)
        at com.sun.enterprise.resource.deployer.AdminObjectResourceDeployer.deployResource(AdminObjectResourceDeployer.java:94)
        at org.glassfish.javaee.services.ResourceProxy.create(ResourceProxy.java:84)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:432)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.test.EmbeddedTest.main(EmbeddedTest.java:46)
Caused by: java.io.FileNotFoundException: /home/rafal/EclipseWorkspaces/Workspace/GlassFishTest/gfembed4696008577066597122tmp/lib/install/applications/jmsra
        at com.sun.enterprise.deploy.shared.FileArchive.open(FileArchive.java:72)
        at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:183)
        ... 12 more
Exception in thread "main" javax.naming.NamingException: Lookup failed for 'jms/Queue' in SerialContext [Root exception is javax.naming.NamingException: Unable to lookup resource : jms/Queue [Root exception is com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors]]
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.test.EmbeddedTest.main(EmbeddedTest.java:46)
Caused by: javax.naming.NamingException: Unable to lookup resource : jms/Queue [Root exception is com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors]
        at org.glassfish.javaee.services.ResourceProxy.throwResourceNotFoundException(ResourceProxy.java:116)
        at org.glassfish.javaee.services.ResourceProxy.create(ResourceProxy.java:88)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:432)
        ... 3 more
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors
        at com.sun.enterprise.connectors.service.ConnectorService.loadDeferredResourceAdapter(ConnectorService.java:172)
        at com.sun.enterprise.connectors.service.ConnectorService.ifSystemRarLoad(ConnectorService.java:335)
        at com.sun.enterprise.connectors.service.ConnectorAdminObjectAdminServiceImpl.addAdminObject(ConnectorAdminObjectAdminServiceImpl.java:75)
        at com.sun.enterprise.connectors.ConnectorRuntime.addAdminObject(ConnectorRuntime.java:948)
        at com.sun.enterprise.resource.deployer.AdminObjectResourceDeployer.deployResource(AdminObjectResourceDeployer.java:94)
        at org.glassfish.javaee.services.ResourceProxy.create(ResourceProxy.java:84)
        ... 4 more
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors
        at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:198)
        at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:329)
        at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:327)
        at com.sun.enterprise.connectors.service.ConnectorService.loadDeferredResourceAdapter(ConnectorService.java:164)
        ... 9 more
Caused by: java.io.FileNotFoundException: /home/rafal/EclipseWorkspaces/Workspace/GlassFishTest/gfembed4696008577066597122tmp/lib/install/applications/jmsra
        at com.sun.enterprise.deploy.shared.FileArchive.open(FileArchive.java:72)
        at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:183)
        ... 12 more
[/code]
The temp glassfish directory corresponds to the embeddable file system.
What do I need to have support for JMS in embedded glassfish?
Probably the same problem will arise for DataSources, but I haven't got that far yet ;d

szczyp
[Message sent by forum member 'szczyp']

http://forums.java.net/jive/thread.jspa?messageID=476388