Hi Peter. Ok, I have figured this part of it out. Btw, the queue connection did not like the qcon.start() call in the snippet (see stack trace). I guess that is an Orion specific thing. I now have the Message Queue working, finally {{{;-).
What I currently have an issue with is the queue name. In the jboss.xml file (attached), the destination JNDI name is "/com/hrnexus/CustSetupQueue". If it was just "com/hrnexus/CustSetupQueue", the "com" gets dropped. And why is "queue" being prepended to the JNDI name. For the Servlets/EJB's to access these queues, they must look up "queue/com/hrnexus/CustSetupQueue". If this is desired behaviour, than this needs to be documented in BOLD. Otherwise, newbies like me are going to get tripped up many times. Thanks, Steve <==Begin log excerpt===> 12:31:56,674 INFO [STDOUT] QConnectionManager.init: Username/password = 'hrnexus/hrnexus' 12:31:56,675 INFO [XAConnectionManager] Got a subject: null 12:31:56,681 DEBUG [JBossMQProvider] no provider url; connecting to local JNDI 12:31:56,682 DEBUG [JBossMQProvider] created context: javax.naming.InitialContext@2bb373 12:31:56,683 DEBUG [ConnectionFactoryHelper] using connection factory: org.jboss.mq.SpyXAConnectionFactory@21447f 12:31:56,684 DEBUG [ConnectionFactoryHelper] using username/password: hrnexus/hrnexus 12:31:56,686 DEBUG [GenericConnectionFactory] Handing out ClientIL: org.jboss.mq.il.jvm.JVMClientILService 12:31:56,686 DEBUG [ConnectionFactoryHelper] created XAQueueConnection: org.jboss.mq.SpyXAConnection@127624 12:31:56,687 DEBUG [JmsManagedConnection] created connection: org.jboss.mq.SpyXAConnection@127624 12:31:56,689 DEBUG [JmsManagedConnection] xaQueueSession: org.jboss.mq.SpyQueueSession@a44a6 12:31:56,689 DEBUG [JmsManagedConnection] queueSession: org.jboss.mq.SpyQueueSession@a44a6 12:31:56,690 DEBUG [JmsManagedConnection] transacted: true 12:31:56,690 DEBUG [JmsManagedConnection] ack mode: 1 12:31:56,691 DEBUG [JmsManagedConnection] Leaving out XAResource 12:31:56,692 DEBUG [JmsManagedConnection] ConnectionEvent listener added: org.jboss.resource.connectionmanager.BaseConnectionManager$XAListener@15435a 12:31:56,715 DEBUG [SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance() 12:31:56,716 INFO [STDOUT] QConnectionManager.init: ConnectionFactory 12:31:56,717 INFO [STDOUT] org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl@61373f 12:31:56,717 INFO [STDOUT] QConnectionManager.init: Connection 12:31:56,718 INFO [STDOUT] org.jboss.resource.adapter.jms.JmsSessionFactoryImpl@31a519 12:31:56,718 INFO [STDOUT] QConnectionManager.init: Session 12:31:56,719 INFO [STDOUT] org.jboss.resource.adapter.jms.JmsSession@790581 12:31:56,720 INFO [STDOUT] QConnectionManager.init: Sucessfully Connected to queue/com/hrnexus/RFPReleaseQueue 12:31:56,720 INFO [STDOUT] QConnectionManager.init: Details are 12:31:56,721 INFO [STDOUT] QUEUE.com/hrnexus/RFPReleaseQueue 12:31:57,077 WARN [Jetty] WARNING: CustomerStatusMgmtServlet: HRXFeatureServlet IOException java.rmi.ServerException: null Embedded Exception This method is not applicatable in JMS resource adapter; nested exception is: javax.ejb.EJBException: null Embedded Exception This method is not applicatable in JMS resource adapter javax.ejb.EJBException: null Embedded Exception This method is not applicatable in JMS resource adapter at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:653) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77) Peter Antman wrote: > Hi, if you have done no other changes to the JBoss setup this would > require that the user named "user" with the password hrnexus is in > jboss-state.xml. It should look something like this (from > server/default/conf in current build): > > <StateManager> > <Users> > <User> > <Name>john</Name> > <Password>needle</Password> > <Id>DurableSubscriberExample</Id> > </User> > <User> > <Name>guest</Name> > <Password>guest</Password> > </User> > <User> > <Name>nobody</Name> > <Password>nobody</Password> > </User> > <User> > <Name>dynsub</Name> > <Password>dynsub</Password> > </User> > <!-- Your user added --> > <User> > <Name>user</Name> > <Password>hrnexus</Password> > </User> > </Users> > > Depending on your restrictions on the destinations the user must belongs > to a role having the correct access rights to the destination. By > default guest have read and write access: > > <Roles> > <Role name="guest"> > <UserName>guest</UserName> > <UserName>john</UserName> > <!-- you user added --> > <UserName>user</UserName> > </Role> > > If you have reconfigured the security domian jbossmq in auth.conf to use > your own user storage you will have to check that all setups are really > done correct. > > Remember that it is now actually possible to dynamically manage users > and roles from the HTML Mbean interface to the DynamicStateManager > (remember to invoke saveConf() to persist the changes. > > //Peter > On 13 Mar, Stephen Davidson wrote: > >>Hi Peter. >> >>Ok, I have figure out how to turn on tracing and debugging. Attached is the code I >am using to get the connection, plus the log with trace & debug >>turned on. >> >>Suggetions on where to look or what needs to be set? >> >>-Steve >> >><===Begin Code Snippet===> >> private void init( Context ctx, String queueName, ParameterProcessor >>params ) >> throws NamingException, JMSException >> { >>// if ( DEBUG ) >>// getQueuesTopics( (InitialContext) ctx ); >> //This currently sets password = "hrnexus" >> final String password = params.get(WEB_USER_PASSWORD); >> >> //SPDBUG: Factory has been moved.... >>// qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY); >> qconFactory = (QueueConnectionFactory) ctx.lookup("java:/JmsXA"); >> qcon = qconFactory.createQueueConnection(USER, password); >> qsession = qcon.createQueueSession(transacted, >>Session.CLIENT_ACKNOWLEDGE); >> queue = (Queue) ctx.lookup( queueName ); >> if ( DEBUG ) >> { >> System.out.print("QConnectionManager.init: ConnectionFactory "); >> System.out.println(qconFactory.toString()); >> System.out.print("QConnectionManager.init: Connection "); >> System.out.println(qcon.toString()); >> System.out.print("QConnectionManager.init: Session "); >> System.out.println(qsession.toString()); >> >> if ( queue == null ) >> System.out.println( "Connection Failed."); >> else >> { >> System.out.println( "QConnectionManager.init: Sucessfully >>Connected to " + queueName ); >> System.out.println( "QConnectionManager.init: Details are" ); >> System.out.println( queue.toString() ); >> } >> } >> qsender = qsession.createSender(queue); >> qcon.start(); >> } >> -- Stephen Davidson Java Consultant Delphi Consultants, LLC http://www.delphis.com Phone: 214-696-6224 x208
<?xml version="1.0"?> <!-- HRXCustSetup.jar JBoss Descriptor --> <jboss> <enterprise-beans> <session> <ejb-name>CustSetupEJB</ejb-name> <jndi-name>HRXCustSetup</jndi-name> </session> <message-driven> <ejb-name>CreateSchemaEJB</ejb-name> <destination-jndi-name>/com/hrnexus/CustSetupQueue</destination-jndi-name> <resource-ref> <res-ref-name>jms/QCF</res-ref-name> <jndi-name>QueueConnectionFactory</jndi-name> </resource-ref> </message-driven> </enterprise-beans> </jboss>