users@glassfish.java.net

Problem creating a JMS resource (Queue or ConnectionFactory) in an Embedded

From: <forums_at_java.net>
Date: Fri, 27 Jan 2012 13:45:07 -0600 (CST)

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /*
Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes;
mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in;
mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan;
font-size:10.0pt; font-family:"Times New Roman","serif";
mso-fareast-font-family:"Times New Roman";}

*What I want to do:* I have a simple java application in which I create an
embedded glassfish server. Into that server I wish to deploy a war. This war
will use JMS as it primary means of inter process communication. Therefore I
would like to use the JMS implementation provided within the Glassfish
server.   *Problem:* After starting the embedded Glassfish server I am
unable to create any JMS resources (such as javax.jms.Queue or
javax.jms.ConnectionFactory)    *Code snippet:* 1. GlassFish glassfish =
GlassFishRuntime./bootstrap/().newGlassFish(); 2. glassfish.start(); 3.
CommandRunner commandRunner = glassfish.getCommandRunner(); 4. 5.
CommandResult result = commandRunner.run("create-jms-resource", "--restype",
"javax.jms.ConnectionFactory", "--description", "connection factory for
durable subscriptions", "--property", "ClientId=MyID",
"myDurableConnectionFactory"); 6. System./out/.println(result.getOutput());
7. 8. File war = *new* File("resources" + File./separator/ +
"someService.war"); 9. Deployer deployer = glassfish.getDeployer(); 10.
deployer.deploy(war, "--name=simple", "--contextroot=simple",
"--force=true"); 11. 12. // do some waiting until I need to stop the server
13. 14. deployer.undeploy("simple", "--droptables=true", "--cascade=true");
15. glassfish.stop(); *The output from line 6 is the following:*
PlainTextActionReporterFAILUREUnable to create connection pool. Invalid
raname. Connector Module with name jmsra not found. The same happens when I
try to create a javax.jms.Queue. In either case, because the resources fail
to create my deployed war is unable to find them on the JNDI tree.   *Help
is much appreciated:* I would appreciate help in figuring out what is missing
or what I am doing wrong in this case.
 


--
[Message sent by forum member 'Seraj']
View Post: http://forums.java.net/node/883061