[jboss-user] [JBoss Messaging] - Re: Problem using JBoss Messaging and JTS

lrgalego do-not-reply at jboss.com
Wed Mar 11 16:53:32 EDT 2009


Hi folks, I'm having the same problem described in this post, 
I decided to list everything that I do, so anyone who wants to help could reproduce my error.

1 - 
I follow this article: http://www.jboss.org/community/docs/DOC-13179
and installed jts in my jboss 5.0.1.GA unsing the build.xml and ant that exists into the docs/examples/jts directory.

2-
changed the sucker passord into the  deploy/messaging/messaging-jboss-beans.xml

3-
descomment the sucker password into the deploy/messaging/messaging-service.xml and set it the same as in the file deploy/messaging/messaging-jboss-beans.xml

4-
I implemented the follow MDB:

  | @MessageDriven(activationConfig = {
  | 		@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1"),
  | 		@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
  | 		@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/myQueue") })
  | public class MyMdb implements MessageDrivenBean, MessageListener {
  | 
  | 	public void onMessage(Message message) {
  | 		System.out.println("Message received");
  | 	}
  | 
  | 	public void ejbRemove() throws EJBException {
  | 	}
  | 
  | 	public void setMessageDrivenContext(MessageDrivenContext ctx)
  | 			throws EJBException {
  | 	}
  | }
  | 

5-
Create a destination entry for my queue:

  | <mbean code="org.jboss.jms.server.destination.QueueService"
  |    name="jboss.messaging.destination:service=Queue,name=myQueue" xmbean-dd="xmdesc/Queue-xmbean.xml">
  |   <depends optional-attribute-name="ServerPeer">
  |    jboss.messaging:service=ServerPeer</depends>
  |   <depends>jboss.messaging:service=PostOffice
  |   </depends>
  |       <attribute name="SecurityConfig">
  |          <security>
  |             <role name="guest" read="true" write="true"/>
  |          </security>
  |       </attribute>
  |  </mbean>
  | 


6- Deployed a ear file with the mdb.

7- Then I obtain the same stacktrace that debs show to us.


I also tried to change the deploy/messaging/messaging-jboss-beans.xml changing the definition of the application policy to

  | <application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
  |       <authentication>
  |          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
  |             <module-option name="usersProperties">props/messaging-users.properties</module-option>
  |             <module-option name="rolesProperties">props/messaging-roles.properties</module-option>
  |          </login-module>
  |       </authentication>
  |    </application-policy>
  | 

But the problem was the same.

Talking in the transactions forum
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=152050 
a side effect of the JBossTS was listed(JBTM-466).


So what I did...
I decoreted the class org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStore and made the username and the password be setted by a user present in the properties that I defined to be used in the application-policy.

The JMS works without the error message and the message seen's to be received ok.
But the first time that I received a message the follow stack trace is displayed

  | 2009-03-11 14:08:36,771 ERROR [org.jboss.resource.adapter.jms.inflow.JmsServerSession] (WorkManager(2)-3) Unexpected error delivering message delegator->JBossMessage[20263588915314688]:PERSISTENT, deliveryId=0
  | java.lang.NullPointerException
  |         at org.jboss.ejb3.security.SecurityActions$14.run(SecurityActions.java:415)
  |         at org.jboss.ejb3.security.SecurityActions$14.run(SecurityActions.java:412)
  |         at java.security.AccessController.doPrivileged(Native Method)
  |         at org.jboss.ejb3.security.SecurityActions.popRunAs(SecurityActions.java:410)
  |         at org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:99)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  |         at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:80)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  |         at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  |         at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  |         at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:262)
  |         at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:270)
  |         at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:140)
  |         at $Proxy189.onMessage(Unknown Source)
  |         at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
  |         at org.jboss.jms.client.container.ClientConsumer.callOnMessageStatic(ClientConsumer.java:160)
  |         at org.jboss.jms.client.container.SessionAspect.handleRun(SessionAspect.java:831)
  |         at org.jboss.aop.advice.org.jboss.jms.client.container.SessionAspect_z_handleRun_12144849.invoke(SessionAspect_z_handleRun_12144849.java)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  |         at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
  |         at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
  |         at org.jboss.jms.client.delegate.ClientSessionDelegate.run(ClientSessionDelegate.java)
  |         at org.jboss.jms.client.JBossSession.run(JBossSession.java:199)
  |         at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:234)
  |         at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:213)
  |         at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
  |         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  |         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  |         at java.lang.Thread.run(Thread.java:619)
  | 

So I think that this solution is really ugly. And maybe can create some unexpected errors.

Can anyone help me with this? Thanks for the attention.




View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217175#4217175

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217175



More information about the jboss-user mailing list