[jboss-user] [JBoss Web Services] - NullPointerException when deploying JAX-WS web-service in com.sun.xml.ws.policy.jaxws.PolicyWSDLParserExtension line 980.

John Fitzpatrick do-not-reply at jboss.com
Thu Jan 19 16:37:28 EST 2012


John Fitzpatrick [https://community.jboss.org/people/jfitzpatrick] created the discussion

"NullPointerException when deploying JAX-WS web-service in com.sun.xml.ws.policy.jaxws.PolicyWSDLParserExtension line 980."

To view the discussion, visit: https://community.jboss.org/message/647709#647709

--------------------------------------------------------------
Hi There,

I have been struggling to deploy a web-application which implements two JAX-WS endpoints, one of which uses the provider API and the other using the POJO method.

My environment:

jbossws-metro-3.3.1

Java Version: 1.6.0.20

JBoss Version: 5.1.0.GA

OS: Ubuntu 10.04 LTS Desktop

What I do:

Implement a web-application that implements two web-service endpoints, one using the JAX-WS provider API and the other using the POJO approach with relevant @WebService annotation. Example code snippets:

AddNumbersImpl.java:

@ServiceMode(value=Service.Mode.PAYLOAD)
@WebServiceProvider(portName="AddNumbersPort",
        serviceName="AddNumbersService",
        targetNamespace=" http://duke.example.org http://duke.example.org",
        wsdlLocation="WEB-INF/wsdl/AddNumbers.wsdl")
public class AddNumbersImpl implements Provider<Source> {
  .... body of class here
}

SubtractNumbersImpl.java

@WebService(    serviceName = "SubtractNumbersService",
                portName = "SubtractNumbersPort",
                endpointInterface = "provider.server.SubtractNumbersPortType" )
public class  SubtractNumbersImpl {
 .... body of class here
}

I have setup web.xml with all of the relevant servlets and mappings and corresponding wsdl files.

The SubtractNumbersImpl class has a single method called subtractNumbers which throws a single exception.

When I deploy my web-application, I get the following stack trace:

12:35:16,621 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/opt/jboss/jboss-5.1.0.GA/server/web/deploy/jaxws-provider.war/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/opt/jboss/jboss-5.1.0.GA/server/web/deploy/jaxws-provider.war/
    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
    at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
    at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
    at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
    at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
    at org.jboss.Main.boot(Main.java:221)
    at org.jboss.Main$1.run(Main.java:556)
    at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException: Failed to build METRO runtime model
    at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.start(RuntimeModelDeploymentAspect.java:135)
    at org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer.internalDeploy(WSDeploymentAspectDeployer.java:107)
    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
    ... 29 more
Caused by: java.lang.NullPointerException
    at com.sun.xml.ws.policy.jaxws.PolicyWSDLParserExtension.finished(PolicyWSDLParserExtension.java:980)
    at com.sun.xml.ws.wsdl.parser.DelegatingParserExtension.finished(DelegatingParserExtension.java:183)
    at com.sun.xml.ws.wsdl.parser.WSDLParserExtensionFacade.finished(WSDLParserExtensionFacade.java:328)
    at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:229)
    at com.sun.xml.ws.server.EndpointFactory.getWSDLPort(EndpointFactory.java:513)
    at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:199)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
    at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parseAdapters(DeploymentDescriptorParserExt.java:295)
    at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parse(DeploymentDescriptorParserExt.java:171)
    at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.start(RuntimeModelDeploymentAspect.java:111)
    ... 32 more

If I modify the SubtractNumbers service so that no exception is thrown then the application deploys without any problems.

What I Expect:

The web-application should deploy without any exceptions being thrown.

Detailed Replication Steps:

Attached to this post is a zip file containing the test case I am using to replicate this error.

Detailed steps to reproduce the problem:

Pre-requisites:

JBoss 5.1.0.GA

Sun Java 6 JDK

JAX-WS RI 2.1.7

jbossws-metro-3.3.1

1. Download the attached zip file.

2. Extract to a directory somewhere.

3. Open a terminal and move into the directory where the files were extracted.

3. Set JAXWS_HOME to the JAX-WS home.

export JAXWS_HOME=/home/jfitzpatrick/Downloads/jaxws-ri-20090416-2.1.7/

4. Build the server side code.

ant build-server-wsdl

5. Create the war file.

ant create-war

6. Copy the war file to the jboss deployment directory.

cp build/war/jaxws-provider.war /opt/jboss/jboss-5.1.0.GA/server/web/deploy

7. Start JBoss.

/opt/jboss/jboss-5.1.0.GA/bin/run.sh -c web -b 0.0.0.0

8. Observe the exception described above.

If the above steps are repeated after modifying the SubtractNumbers service so that no exceptions are thrown, the application deploys without any errors.

To see this, simply comment out anything related to the fault/exception in the SubtractNumbers.wsdl file and modify SubtractNumbersImpl.java so that the exception is no longer thrown.

After doing an "ant clean" and repeating the steps above, you should observe that the exception is no longer thrown.

My questions:

Has anyone else observed this behaviour?

Am I doing something wrong in regards to the configuration of the application?

Is it possible to deploy JAX-WS with different endpoints using different programming models?

If anyone has any hints, ideas, or anything at all that may help it would be greatly appreciated.

Thank you,

John Fitzpatrick
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/647709#647709]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120119/33e4a4a8/attachment-0001.html 


More information about the jboss-user mailing list