Java から実行中の ActiveMQ サーブレット (Weblogic 12 上) に接続しようとしていますが、次の例外が発生していますconn.start();
:
javax.jms.JMSException: Could not post command: ConnectionInfo {commandId = 1, responseRequired = true, connectionId = ID:lmdesetup-jab-38449-1378221016985-2:1, clientId = ID:lmdesetup-jab-38449-1378221016985-1:1, clientIp = null, userName = null, password = *****, brokerPath = null, brokerMasterConnector = false, manageable = true, clientMaster = true, faultTolerant = false, failoverReconnect = false} due to: java.io.IOException: Failed to post command: ConnectionInfo {commandId = 1, responseRequired = true, connectionId = ID:lmdesetup-jab-38449-1378221016985-2:1, clientId = ID:lmdesetup-jab-38449-1378221016985-1:1, clientIp = null, userName = null, password = *****, brokerPath = null, brokerMasterConnector = false, manageable = true, clientMaster = true, faultTolerant = false, failoverReconnect = false} as response was: HTTP/1.1 500 Internal Server Error [Connection: close, Date: Tue, 03 Sep 2013 15:11:02 GMT, Content-Length: 3092, Content-Type: text/html; charset=UTF-8, X-Powered-By: Servlet/3.0 JSP/2.2]
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1409)
at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1496)
at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:524)
コードは次のとおりです。
QueueConnectionFactory factory = new ActiveMQConnectionFactory("http://localhost:8888/myApp/amq");
Connection conn = factory.createConnection();
conn.start();
(コードは次の例に基づいています: http://activemq.apache.org/hello-world.html )
js クライアントを使用してメッセージを送受信できるため、ActiveMQ ブローカーと AjaxServlet は問題ないと確信しています。
サーブレットは web.xml で次のように定義されています。
<context-param>
<param-name>org.apache.activemq.brokerURL</param-name>
<param-value>vm://localhost</param-value>
</context-param>
<context-param>
<param-name>org.apache.activemq.embeddedBroker</param-name>
<param-value>true</param-value>
</context-param>
<servlet>
<servlet-name>AjaxServlet</servlet-name>
<servlet-class>org.apache.activemq.web.AjaxServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>AjaxServlet</servlet-name>
<url-pattern>/amq/*</url-pattern>
</servlet-mapping>
...
同じ問題を抱えている人を見つけましたが、解決策はありません: http://blog.gmane.org/gmane.comp.java.activemq.user/month=20090501
Weblogic の例外は次のとおりです。
####<Sep 3, 2013 4:19:32 PM UTC> <Error> <Kernel> <mymachine> <myServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1378225172656> <BEA-000802> <ExecuteRequest failed
java.lang.IllegalStateException: Can NOT error at this state: AsyncCompleted.
java.lang.IllegalStateException: Can NOT error at this state: AsyncCompleted
at weblogic.servlet.internal.async.DefaultState.notifyError(AsyncStates.java:62)
at weblogic.servlet.internal.async.AsyncContextImpl.handleError(AsyncContextImpl.java:125)
at weblogic.servlet.internal.async.DispatchHandler.run(DispatchHandler.java:33)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>
####<Sep 3, 2013 4:19:32 PM UTC> <Error> <HTTP> <mymachine> <myServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1378225172779> <BEA-101020> <[ServletContext@1154401993[app:ino-all module:ino path:null spec-version:3.0]] Servlet failed with an Exception
java.lang.UnsupportedOperationException: A destination must be specified.
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:257)
at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:224)
at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:300)
at org.apache.activemq.web.WebClient.send(WebClient.java:243)
at org.apache.activemq.web.MessageListenerServlet.doPost(MessageListenerServlet.java:219)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:751)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:242)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:216)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:132)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:338)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)