我正在遷移要使用Maven構建和部署的應用程序。它部署在WebSphere 7上。我已經成功部署了此應用程序(HTML UI等),但Web服務遇到了問題。使用Maven構建/部署時webservices的WebSphere問題
當我嘗試訪問Web服務的URL(例如localhost:9000/MyApplication/MyWebServiceProject/MyService
)時,我希望看到一個頁面,上面寫着「Hello,this is a web service!」。
相反,我看到這個異常:
[4/1/13 11:49:37:484 EDT] 0000001d WASAxis2Servl E The following exception was encountered while attempting to load the ConfigurationContext for the servlet: com.ibm.ws.websvcs.exception.ConfigurationException: Could not retrieve server module metadata in Axis servlet for module: MyWebServiceProject com.ibm.ws.websvcs.exception.ConfigurationException: Could not retrieve server module metadata in Axis servlet for module: MyWebServiceProject at com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.init(WASAxis2Servlet.java:290) at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:171) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:739) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1613)
我猜有是需要通過Maven的部署Web服務的一些IBM特定的配置,但我不知道它是什麼。
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.7</version>
<configuration>
<applicationName>PolicyGatewayEAR</applicationName>
<defaultLibBundleDir>lib/</defaultLibBundleDir>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>was6-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>integration-test</phase>
<id>uninstall</id>
<goals>
<goal>wsUninstallApp</goal>
</goals>
<configuration>
<wasHome>${was7Home}</wasHome>
<verbose>false</verbose>
<failOnError>false</failOnError>
<profileName>was70profile1</profileName>
<workingDirectory>${project.build.directory}/was6-maven-plugin</workingDirectory>
<applicationName>MyApplication</applicationName>
</configuration>
</execution>
<execution>
<phase>integration-test</phase>
<id>installation</id>
<goals>
<goal>installApp</goal>
</goals>
<configuration>
<wasHome>${was7Home}</wasHome>
<verbose>false</verbose>
<failOnError>true</failOnError>
<updateExisting>false</updateExisting>
<profileName>was70profile1</profileName>
<workingDirectory>${project.build.directory}/was6-maven-plugin</workingDirectory>
<applicationName>MyApplication</applicationName>
</configuration>
</execution>
</executions>
</plugin>
POM片段爲Web服務子項目:
從POM的EAR項目的有關章節
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>true</failOnMissingWebXml>
<warSourceDirectory>WebContent</warSourceDirectory>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
這不是當我部署的一個問題使用RAD(v8.5) - 它只是在我嘗試使用Maven構建和部署應用程序時才啓動。有誰知道如何解決這個錯誤?