[JBoss Messaging] - Re: JBM2 Beta4 with JBAS5.1 - setListener( null )
by jmesnil
"simon_temple" wrote : Using the JMS API. If I attempt to clear the currently registered listener on a QueueReceiver then I get an IllegalStateException when I try to receive on it:
|
| javax.jms.IllegalStateException: Cannot call receive(...) - a MessageHandler is set
| | at org.jboss.messaging.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:161)
| | at org.jboss.messaging.jms.client.JBossMessageConsumer.getMessage(JBossMessageConsumer.java:213)
| | at org.jboss.messaging.jms.client.JBossMessageConsumer.receiveNoWait(JBossMessageConsumer.java:146)
|
| I have a simple test case which looks this:
|
| queueReceiver.setMessageListener( listener );
| |
| | queueConnection.start( );
| | thread.wait( 30000 );
| |
| | queueReceiver.setMessageListener( null );
| | queueReceiver.receiveNoWait( );
| |
|
| How can I clear the message listener attribute from a QueueReceiver once it's been set?
Thre is a bug in the JBossMessageConsumer which prevents to unset the message listener. We'll fix it.
Please not however that even with this bug fixed, your test case may not work.
>From MessageConsumer.setMessageListener() javadoc:
anonymous wrote :
| The effect of calling MessageConsumer.setMessageListener while messages are being consumed by an existing listener or the consumer is being used to consume messages synchronously is undefined.
|
You should stop your queueConnection to prevent message consumption before unsetting the message listener to have a correct behavior.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250322#4250322
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250322
16 years, 10 months
[JBoss Messaging] - JBM2 Beta4 with JBAS5.1 - setListener( null )
by simon_temple
Using the JMS API. If I attempt to clear the currently registered listener on a QueueReceiver then I get an IllegalStateException when I try to receive on it:
javax.jms.IllegalStateException: Cannot call receive(...) - a MessageHandler is set
| at org.jboss.messaging.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:161)
| at org.jboss.messaging.jms.client.JBossMessageConsumer.getMessage(JBossMessageConsumer.java:213)
| at org.jboss.messaging.jms.client.JBossMessageConsumer.receiveNoWait(JBossMessageConsumer.java:146)
I have a simple test case which looks this:
queueReceiver.setMessageListener( listener );
|
| queueConnection.start( );
| thread.wait( 30000 );
|
| queueReceiver.setMessageListener( null );
| queueReceiver.receiveNoWait( );
|
How can I clear the message listener attribute from a QueueReceiver once it's been set?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250320#4250320
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250320
16 years, 10 months
[EJB/JBoss] - EJB3 : "Can not connect http client invoker" with eclipse la
by jean.p
Hello,
I have a problem when I try to call an EJB deployed on JBoss server (4.2.3.GA) from a Main class.
If I call my EJB from a webapp deployed on a JBoss server it works perfectly, but if I try to call the same ejb from a main launched by eclipse the look-up work fine (a sysout on the interface give this result : jboss.j2ee:ear=myEjb.ear,jar=ejb-private.jar,name=myEjbImpl,service=EJB3
).
Nevertheless when I launch a method from the ejb I receive this error : org.jboss.remoting.CannotConnectException: Can not connect http client invoker. Connection refused: connect.
I configured eclipse to use the jboss library in JBOSS_HOME/client when I execute my application.
Thank for any help you can provide.
Jean
PS : the full stacktrace
org.jboss.remoting.CannotConnectException: Can not connect http client invoker. Connection refused: connect.
| at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:348)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.askForPayAuth(Unknown Source)
| at xxxxxx.TesteurMain.main(TesteurMain.java:29)
| Caused by: java.net.ConnectException: Connection refused: connect
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
| at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
| at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
| at java.net.Socket.connect(Socket.java:519)
| at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
| at sun.net.www.http.HttpClient.openServer(HttpClient.java:382)
| at sun.net.www.http.HttpClient.openServer(HttpClient.java:509)
| at sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
| at sun.net.www.http.HttpClient.New(HttpClient.java:304)
| at sun.net.www.http.HttpClient.New(HttpClient.java:316)
| at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:817)
| at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:769)
| at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:694)
| at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:861)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:277)
| at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.askForPayAuth(Unknown Source)
| at xxxxx.factory.TesteurMain.main(TesteurMain.java:29)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| ... 10 more
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250314#4250314
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250314
16 years, 10 months