Skip to main content

glassfish-embedded-all and JMS

1 reply [Last post]
Anonymous

Hi. I am trying to look up a jms/Queue using glassfish-embedded-all. Here is the code:

<br />
EmbeddedFileSystem.Builder efsb = new EmbeddedFileSystem.Builder();<br />
efsb.configurationFile(new File("domain.xml"), true);<br />
efsb.autoDelete(true);<br />
EmbeddedFileSystem efs = efsb.build();</p>
<p>Server.Builder builder = new Server.Builder("test");<br />
builder.embeddedFileSystem(efs);<br />
Server server = builder.build();<br />
server.addContainer(Type.web);<br />
server.addContainer(Type.ejb);</p>
<p>InitialContext ic = new InitialContext();<br />
UserTransaction ut = (UserTransaction) ic.lookup("java:comp/UserTransaction");<br />
Queue queue = (Queue) ic.lookup("jms/Queue");</p>
<p>System.in.read();<br />
server.stop();<br />

The domain.xml file contains the definition for the Queue. What I get is:
<br />
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors<br />
	at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:198)<br />
	at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:329)<br />
	at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:327)<br />
	at com.sun.enterprise.connectors.service.ConnectorService.loadDeferredResourceAdapter(ConnectorService.java:164)<br />
	at com.sun.enterprise.connectors.service.ConnectorService.ifSystemRarLoad(ConnectorService.java:335)<br />
	at com.sun.enterprise.connectors.service.ConnectorAdminObjectAdminServiceImpl.addAdminObject(ConnectorAdminObjectAdminServiceImpl.java:75)<br />
	at com.sun.enterprise.connectors.ConnectorRuntime.addAdminObject(ConnectorRuntime.java:948)<br />
	at com.sun.enterprise.resource.deployer.AdminObjectResourceDeployer.deployResource(AdminObjectResourceDeployer.java:94)<br />
	at org.glassfish.javaee.services.ResourceProxy.create(ResourceProxy.java:84)<br />
	at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:432)<br />
	at javax.naming.InitialContext.lookup(InitialContext.java:392)<br />
	at javax.naming.InitialContext.lookup(InitialContext.java:392)<br />
	at com.test.EmbeddedTest.main(EmbeddedTest.java:46)<br />
Caused by: java.io.FileNotFoundException: /home/rafal/EclipseWorkspaces/Workspace/GlassFishTest/gfembed4696008577066597122tmp/lib/install/applications/jmsra<br />
	at com.sun.enterprise.deploy.shared.FileArchive.open(FileArchive.java:72)<br />
	at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:183)<br />
	... 12 more<br />
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]]<br />
	at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)<br />
	at javax.naming.InitialContext.lookup(InitialContext.java:392)<br />
	at javax.naming.InitialContext.lookup(InitialContext.java:392)<br />
	at com.test.EmbeddedTest.main(EmbeddedTest.java:46)<br />
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]<br />
	at org.glassfish.javaee.services.ResourceProxy.throwResourceNotFoundException(ResourceProxy.java:116)<br />
	at org.glassfish.javaee.services.ResourceProxy.create(ResourceProxy.java:88)<br />
	at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:432)<br />
	... 3 more<br />
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors<br />
	at com.sun.enterprise.connectors.service.ConnectorService.loadDeferredResourceAdapter(ConnectorService.java:172)<br />
	at com.sun.enterprise.connectors.service.ConnectorService.ifSystemRarLoad(ConnectorService.java:335)<br />
	at com.sun.enterprise.connectors.service.ConnectorAdminObjectAdminServiceImpl.addAdminObject(ConnectorAdminObjectAdminServiceImpl.java:75)<br />
	at com.sun.enterprise.connectors.ConnectorRuntime.addAdminObject(ConnectorRuntime.java:948)<br />
	at com.sun.enterprise.resource.deployer.AdminObjectResourceDeployer.deployResource(AdminObjectResourceDeployer.java:94)<br />
	at org.glassfish.javaee.services.ResourceProxy.create(ResourceProxy.java:84)<br />
	... 4 more<br />
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to read the connector deployment descriptors<br />
	at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:198)<br />
	at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:329)<br />
	at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:327)<br />
	at com.sun.enterprise.connectors.service.ConnectorService.loadDeferredResourceAdapter(ConnectorService.java:164)<br />
	... 9 more<br />
Caused by: java.io.FileNotFoundException: /home/rafal/EclipseWorkspaces/Workspace/GlassFishTest/gfembed4696008577066597122tmp/lib/install/applications/jmsra<br />
	at com.sun.enterprise.deploy.shared.FileArchive.open(FileArchive.java:72)<br />
	at com.sun.enterprise.connectors.util.ConnectorDDTransformUtils.getConnectorDescriptor(ConnectorDDTransformUtils.java:183)<br />
	... 12 more<br />

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

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sirajg
Offline
Joined: 2006-02-01
Points: 0

JMS is not yet supported in the embedded mode. There might be some support in the 3.1 timeframe.