-
1. Re: problem with jms receive in EJB
gaohoward Jan 16, 2013 9:53 AM (in response to pacodelucia)How did you get the connection factory? You need use 'JmsXA' to lookup the connection factory.
-
2. Re: problem with jms receive in EJB
pacodelucia Jan 16, 2013 10:21 AM (in response to gaohoward)Hey! Thanks for the quick response!
No, I used java:RemoteJmsXA to look-up the ConnectionFactory. When I use java:JmsXA then I get the following error:
javax.jms.JMSException: There is no administratively defined queue with name:myqueue
I also thought about the JmsXA factory but I cannot see, how this connects to hornet because in JBoss 5.1 hornet is not the default jms implementation. In my jms-ds.xml JmxXA is definied as follows:
<tx-connection-factory>
<jndi-name>JmsXA</jndi-name>
<xa-transaction />
<rar-name>jms-ra.rar</rar-name>
<connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
<config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
<config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
<max-pool-size>20</max-pool-size>
<security-domain-and-application>JmsXARealm</security-domain-and-application>
<depends>jboss.messaging:service=ServerPeer</depends>
</tx-connection-factory>
The rar-name here is jms-ra.rar. Should I change that to hornet-ra.rar? But then it is basically the same as I have in my hornetq-remote-ds.xml (see above)
Thanks a lot.
Regards
Oliver
-
3. Re: problem with jms receive in EJB
ataylor Jan 16, 2013 10:31 AM (in response to pacodelucia)javax.jms.JMSException: There is no administratively defined queue with name:myqueue
You need to either have the queue defined locally or configure the use of remote jndi, the former is the simplest.
-
4. Re: problem with jms receive in EJB
ataylor Jan 16, 2013 10:34 AM (in response to ataylor)just a note on using a blocking call, this is illegal in JEE spec for good reason, you will find it wont scale and may cause you other problems in th elong run, you should use an MDB
-
5. Re: problem with jms receive in EJB
pacodelucia Jan 16, 2013 10:45 AM (in response to ataylor)Hi Andy. Thanks for your response but what do you mean with "define the queue locally"? I have to use the queue which is provided by another team on their remote server. Is there a way to define it locally but still forward everything to the remote queue?
-
6. Re: problem with jms receive in EJB
ataylor Jan 16, 2013 11:03 AM (in response to pacodelucia)you need to define the queue in the same server as the EJB, this has no bearing on where you actually connect to, its just to use the name so just needs to be identical.
-
7. Re: problem with jms receive in EJB
pacodelucia Jan 16, 2013 11:10 AM (in response to ataylor)I'm not sure that it is really prohibited. The only note I found was that you cannot use e.g. ServerSession and the XA-Interfaces. There is also a list of some methods that can only be used in client containers but receive is not included there (Chapter 6.6 of the JEE Spec v5).
But of course you are right, that this doesn't scale well. In my case this does not matter: I'm currently implementing a simple generic JMS-Administration-GUI. The connections are displayed using a JMS Browser. I think this is correct and does not violate any definitions in the JEE Spec. The problem is deleting a message. Because there is no "delete" method I'm acknowledge the session... but saying it I could also read it with the browser and acknowledge it then I would not have any blocking calls.
-
8. Re: problem with jms receive in EJB
ataylor Jan 16, 2013 11:23 AM (in response to pacodelucia)I'm not sure that it is really prohibited. The only note I found was that you cannot use e.g. ServerSession and the XA-Interfaces. There is also a list of some methods that can only be used in client containers but receive is not included there (Chapter 6.6 of the JEE Spec v5).
Not all methods are actually illegal, some such as setting a message listener should throw an exception, other such as a blocking receive are allowed but are bad practice.
But of course you are right, that this doesn't scale well. In my case this does not matter:
remember this effects the other apps running in the server as wll not just your own.
I'm currently implementing a simple generic JMS-Administration-GUI. The connections are displayed using a JMS Browser. I think this is correct and does not violate any definitions in the JEE Spec. The problem is deleting a message. Because there is no "delete" method I'm acknowledge the session... but saying it I could also read it with the browser and acknowledge it then I would not have any blocking calls.
not sure i get this, what kind of JMS Browser?
also acknowledging a message with a browser will have no effect?
-
9. Re: problem with jms receive in EJB
pacodelucia Jan 16, 2013 11:41 AM (in response to ataylor)Well... I'm probably just too stupid... I still don't get how I would define a queue locally. I did the following in destination-service.xml:
<mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=myqueue">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
But this somwhow "overrides" my remote queue. I just see the local, empty queue. Or should I use a hornetq-specific class in the "code" attribute?
-
10. Re: problem with jms receive in EJB
ataylor Jan 16, 2013 11:45 AM (in response to pacodelucia)ok i see, you dont have HornetQ deployed locally (your config is MQ), in that case you cant use jndi, you will need to use session.createQueue or HornetQJMSClient.createQueue in your code
-
11. Re: problem with jms receive in EJB
pacodelucia Jan 16, 2013 11:57 AM (in response to ataylor)Yes I only have the RAR on my JBoss-Instance. But now I understand what you mean with "configure locally".
I'm already using session.createQueue and it works fine. The problem ist that you told me that I have to use the JmsXA ConnectionFactory in order to get XA working. Is there a way to achiev this without deploying the SAR and define the queue locally?
-
12. Re: problem with jms receive in EJB
ataylor Jan 16, 2013 12:02 PM (in response to pacodelucia)can you post the stack trace you are getting when you use JmsXA, i dont see any reason that it needs to lookup the queue unless you are injecting it as a resource into your EJB
-
13. Re: problem with jms receive in EJB
ataylor Jan 16, 2013 12:09 PM (in response to ataylor)also can you postthe ra.xml that your RemoteJmsXA uses?
-
14. Re: problem with jms receive in EJB
pacodelucia Jan 16, 2013 12:16 PM (in response to ataylor)Here's the stack trace:
javax.jms.JMSException: There is no administratively defined queue with name:mps.mobi24.DLQ
at org.jboss.jms.server.endpoint.ServerSessionEndpoint.createQueue(ServerSessionEndpoint.java:299)
at org.jboss.jms.server.endpoint.advised.SessionAdvised.org$jboss$jms$server$endpoint$advised$SessionAdvised$createQueue$aop(SessionAdvised.java:105)
at org.jboss.jms.server.endpoint.advised.SessionAdvised$createQueue_6431069199924553036.invokeTarget(SessionAdvised$createQueue_6431069199924553036.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.jms.server.endpoint.advised.SessionAdvised.createQueue(SessionAdvised.java)
at org.jboss.jms.wireformat.SessionCreateQueueRequest.serverInvoke(SessionCreateQueueRequest.java:74)
at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
at org.jboss.remoting.Client.invoke(Client.java:1724)
at org.jboss.remoting.Client.invoke(Client.java:629)
at org.jboss.remoting.Client.invoke(Client.java:617)
at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:189)
at org.jboss.jms.client.delegate.DelegateSupport.doInvoke(DelegateSupport.java:160)
at org.jboss.jms.client.delegate.ClientSessionDelegate.org$jboss$jms$client$delegate$ClientSessionDelegate$createQueue$aop(ClientSessionDelegate.java:319)
at org.jboss.jms.client.delegate.ClientSessionDelegate$createQueue_6431069199924553036.invokeTarget(ClientSessionDelegate$createQueue_6431069199924553036.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:92)
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.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.createQueue(ClientSessionDelegate.java)
at org.jboss.jms.client.JBossSession.createQueue(JBossSession.java:250)
at org.jboss.resource.adapter.jms.JmsSession.createQueue(JmsSession.java:539)
at ch.mobi.mps.business.application.admin.JmsDestinationManagerBean.getDestination(JmsDestinationManagerBean.java:346)
at ch.mobi.mps.business.application.admin.JmsDestinationManagerBean.getMessageInfoList(JmsDestinationManagerBean.java:400)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_1081302853.invoke(InvocationContextInterceptor_z_fillMethod_1081302853.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_1081302853.invoke(InvocationContextInterceptor_z_setup_1081302853.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:94)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
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.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
at $Proxy424.getMessageInfoList(Unknown Source)
at ch.mobi.mps.presentation.beans.jmsadmin.JmsManagerBean.loadMessageList(JmsManagerBean.java:121)
at ch.mobi.mps.presentation.beans.jmsadmin.JmsManagerBean.reloadMessageList(JmsManagerBean.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.el.parser.AstValue.invoke(AstValue.java:170)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at ch.mobi.mps.presentation.filter.RequestParameterFilter.doFilter(RequestParameterFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at ch.mobi.mps.presentation.filter.TimeoutCheckFilter.doFilter(TimeoutCheckFilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at ch.mobi.mps.presentation.filter.DisableUrlRewriteFilter.doFilter(DisableUrlRewriteFilter.java:85)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)