Servlet transport problem
gaohoward Apr 9, 2009 8:06 AMHi, I can't get the servlet transport working. I configured a new connection factory that using servlet transport, like:
<connection-factory name="ServletConnectionFactory"> <connector-ref connector-name="netty-servlet"/> <entry name="ServletConnectionFactory"/> <entry name="/ServletConnectionFactory"/> <entry name="/XAServletConnectionFactory"/> <entry name="java:/ServletConnectionFactory"/> <entry name="java:/ServletConnectionFactory"/> </connection-factory>
and the netty-servlet configuration is like
<connector name="netty-servlet"> <factory-class>org.jboss.messaging.integration.transports.netty.NettyConnectorFactory</factory-class> <param key="jbm.remoting.netty.host" value="localhost" type="String"/> <param key="jbm.remoting.netty.port" value="8080" type="Integer"/> <param key="jbm.remoting.netty.useservlet" value="true" type="Boolean"/> <param key="jbm.remoting.netty.servletpath" value="/jms-servlet/JBMServlet" type="String"/> </connector>
After I deployed the war that contains the servlet (web.xml), I run my simple example, and it got exception in create connection, here is the output:
runExample: [java] ------------uri: http://localhost:8080/jms-servlet/JBMServlet [java] ------------------connection create ok. [java] Apr 9, 2009 7:48:17 PM org.jboss.messaging.core.logging.Logger warn [java] WARNING: Connection failure has been detected Netty exception:0 [java] java.lang.InterruptedException [java] at org.jboss.netty.util.LinkedTransferQueue.take(LinkedTransferQueue.java:565) [java] at org.jboss.netty.channel.socket.http.HttpTunnelingClientSocketChannel.receiveChunk(HttpTunnelingClientSocketChannel.java:181) [java] at org.jboss.netty.channel.socket.http.HttpTunnelWorker.run(HttpTunnelWorker.java:66) [java] at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:72) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) [java] at java.lang.Thread.run(Thread.java:595) [java] Exception in thread "Thread-1 (group:jbm-netty-connector-worker-threads-33414193)" java.lang.NullPointerException [java] at org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer(ChannelBuffers.java:242) [java] at org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer(ChannelBuffers.java:232) [java] at org.jboss.netty.channel.socket.http.HttpTunnelWorker.run(HttpTunnelWorker.java:75) [java] at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:72) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) [java] at java.lang.Thread.run(Thread.java:595) [java] Exception in thread "main" javax.jms.JMSException: Timed out waiting for response when sending packet 30 [java] at org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl$ChannelImpl.sendBlocking(RemotingConnectionImpl.java:1186) [java] at org.jboss.messaging.core.client.impl.ConnectionManagerImpl.createSession(ConnectionManagerImpl.java:310) [java] at org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:870) [java] at org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:579) [java] at org.jboss.messaging.jms.client.JBossConnection.authorize(JBossConnection.java:504) [java] at org.jboss.messaging.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:649) [java] at org.jboss.messaging.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:441) [java] at org.jboss.messaging.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:436) [java] at org.jboss.javaee.example.ServletTransportExample.main(ServletTransportExample.java:56) [java] Caused by: MessagingException[errorCode=3 message=Timed out waiting for response when sending packet 30] [java] ... 9 more [java] Java Result: 1 undeploy-servlet: [delete] Deleting directory /home/howard/apps/jboss-5.1.0.CR1/server/jbm2_default/deploy/jms-servlet.war
Looks like a netty problem, I have no idea so far. Anybody can give a hint? thanks.