非同期WebService(JBossWS-native)クライアントが含まれるEARファイルをデプロイし、
WebService を invoke すると、IllegalStateExceptionが発生。
解決策が見つからないので、とりあえず同期 invoke で妥協する。

環境

  • Java : JDK6
  • JBoss : 4.2.3.GA
  • JBossWS(Native) : 3.1.1

以下、検索用 StackTrace

11:57:10,415 INFO  [WebappClassLoader] 不正なアクセス: このWebアプリケーションのインスタンスは既に停止されています  Could not load META-INF/services/javax.xml.soap.MessageFactory. 不正なアクセスを引き起こしたスレッドを終了させ、投げられたエラーによりデバッグ用に次のスタックトレースが生成されましたが,機能に影響はありません
11:57:10,415 INFO  [WebappClassLoader] 不正なアクセス: このWebアプリケーションのインスタンスは既に停止されています  Could not load org.jboss.ws.core.soap.MessageFactoryImpl. 不正なアクセスを引き起こしたスレッドを終了させ、投げられたエラーによりデバッグ用に次のスタックトレースが生成されましたが,機能に影響はありません
java.lang.IllegalStateException
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1244)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
	at javax.xml.soap.SAAJFactoryLoader.loadFactory(SAAJFactoryLoader.java:122)
	at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:72)
	at org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getRequestMessage(DispatchSOAPBinding.java:81)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.getRequestMessage(DispatchImpl.java:450)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternalSOAP(DispatchImpl.java:183)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternal(DispatchImpl.java:170)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.access$000(DispatchImpl.java:91)
	at org.jboss.ws.core.jaxws.client.DispatchImpl$AsyncRunnable.run(DispatchImpl.java:498)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	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)
11:57:10,415 ERROR [DispatchImpl] Cannot dispatch message
javax.xml.ws.WebServiceException: Cannot create request message
	at org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getRequestMessage(DispatchSOAPBinding.java:135)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.getRequestMessage(DispatchImpl.java:450)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternalSOAP(DispatchImpl.java:183)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternal(DispatchImpl.java:170)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.access$000(DispatchImpl.java:91)
	at org.jboss.ws.core.jaxws.client.DispatchImpl$AsyncRunnable.run(DispatchImpl.java:498)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	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)
Caused by: javax.xml.soap.SOAPException: java.lang.IllegalStateException: Failed to load javax.xml.soap.MessageFactory: org.jboss.ws.core.soap.MessageFactoryImpl
	at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:76)
	at org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getRequestMessage(DispatchSOAPBinding.java:81)
	... 11 more
Caused by: java.lang.IllegalStateException: Failed to load javax.xml.soap.MessageFactory: org.jboss.ws.core.soap.MessageFactoryImpl
	at javax.xml.soap.SAAJFactoryLoader.loadFactory(SAAJFactoryLoader.java:128)
	at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:72)
	... 12 more
Caused by: java.lang.ClassNotFoundException: org.jboss.ws.core.soap.MessageFactoryImpl
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
	at javax.xml.soap.SAAJFactoryLoader.loadFactory(SAAJFactoryLoader.java:122)
	... 13 more
11:57:10,446 ERROR [[HogeHogeServlet]] サーブレット HogeHogeServlet のServlet.service()が例外を投げました
javax.xml.ws.WebServiceException: Cannot create request message
	at org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getRequestMessage(DispatchSOAPBinding.java:135)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.getRequestMessage(DispatchImpl.java:450)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternalSOAP(DispatchImpl.java:183)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.invokeInternal(DispatchImpl.java:170)
	at org.jboss.ws.core.jaxws.client.DispatchImpl.access$000(DispatchImpl.java:91)
	at org.jboss.ws.core.jaxws.client.DispatchImpl$AsyncRunnable.run(DispatchImpl.java:498)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	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)
Caused by: javax.xml.soap.SOAPException: java.lang.IllegalStateException: Failed to load javax.xml.soap.MessageFactory: org.jboss.ws.core.soap.MessageFactoryImpl
	at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:76)
	at org.jboss.ws.core.jaxws.client.DispatchSOAPBinding.getRequestMessage(DispatchSOAPBinding.java:81)
	... 11 more
Caused by: java.lang.IllegalStateException: Failed to load javax.xml.soap.MessageFactory: org.jboss.ws.core.soap.MessageFactoryImpl
	at javax.xml.soap.SAAJFactoryLoader.loadFactory(SAAJFactoryLoader.java:128)
	at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:72)
	... 12 more
Caused by: java.lang.ClassNotFoundException: org.jboss.ws.core.soap.MessageFactoryImpl
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
	at javax.xml.soap.SAAJFactoryLoader.loadFactory(SAAJFactoryLoader.java:122)
	... 13 more