0
votes

I am in the process of migrating an application to be built and deployed with Maven. It's deployed on WebSphere 7. I've managed to get part of this application (HTML UI and such) working fine, but the web services are having a problem.

When I try to access the URL for the web service (such as localhost:9000/MyApplication/MyWebServiceProject/MyService), I expect to see a page that say something like "Hello, this is a web service!".

Instead, I see this exception:

[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)

I'm guessing there's some IBM-specific configuration that is needed for deploying web services via Maven, but I'm not sure what it is.

Relevant sections from the POM for the EAR project:

<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 snippet for the web-service sub-project:

        <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>

This wasn't a problem when I was deploying to WAS using RAD (v8.5) - it's only started since I tried build and deploy the application using Maven. Does anyone know how to resolve this error?

1

1 Answers

1
votes

So it turns out that I had to use the same solution as desribed here:

Deployed webservice schema does not match what's in workspace

For some reason, WebSphere was unable to generate the WSDL from code when the WSDL and schema files were not provided in the Maven-build project. The error message I reported is similar to one that I saw when I was running tests with including the WSDL and schema in the EJB project.