POJO Endpoint causes NPE at JBossWebMetaDataParser.parse
abhi0123 Apr 14, 2012 6:33 PMPOJO Endpoint deployed with web.xml and jboss-web.xml. When enabled, or attempted to, JBOSS AS 7 fails with NPE. Source code and partial deployable artifact attached. Could not attach the actual deployable because it is 35 Meg but have included my local dependencies. If required, other dependencies could be downloaded by Maven.
{code}
15:16:25,985 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC00001: Failed to start service jboss.deployment.unit."jaxws-pojo-endpoint-1.0.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jaxws-pojo-endpoint-1.0.war".PARSE: Failed to process phase PARSE of deployment "jaxws-pojo-endpoint-1.0.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]
Caused by: java.lang.NullPointerException
at org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser.parse(JBossWebMetaDataParser.java:100)
at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:69)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
{code}
TimeServiceSEI.java
{code}
@WebService
public interface TimeServiceSEI {
public Time getCurrentTime();
public Time getCurrentTimeAfterHttpBasicAuthentication();
public Time getCurrentTimeAfterDeclarativeRoleBasedAuthorization();
public Time getCurrentTimeAfterProgrammaticRoleBasedAuthorization();
public Time getCurrentTimeAfterUserPrincipalAuthentication();
public Time getCurrentTimeAfterProgrammaticAuthentication();
}
{code}
TimeService.java
{code}
@WebService(name = "Time", serviceName = "TimeService", portName = "TimeServicePort", targetNamespace = "http://abhijitsarkar.certification.edu/ocewsd/jaxws/pojo/endpoint", endpointInterface = "edu.certification.abhijitsarkar.ocewsd.jaxws.pojo.endpoint.TimeServiceSEI")
@HandlerChain(file = "handler-chain.xml")
// should be configurable in jboss-web.xml,
// https://issues.jboss.org/browse/JBWS-3487
//@SecurityDomain(value = "other")
//@WebContext(contextRoot = "/jaxws-pojo-endpoint", authMethod = AuthMethod.BASIC, secureWSDLAccess = false, transportGuarantee = TransportGuarantee.NONE, urlPattern = "/TimeService")
public class TimeService implements TimeServiceSEI {
@WebMethod
@Override
public Time getCurrentTime() {
return new Time();
}
/* HttpBasicAuthenticationHandler authenticates this request */
@WebMethod
@Override
public Time getCurrentTimeAfterHttpBasicAuthentication() {
return getCurrentTime();
}
@WebMethod
@Override
public Time getCurrentTimeAfterDeclarativeRoleBasedAuthorization() {
return getCurrentTime();
}
// more methods
}
{code}
web.xml
{code:xml}
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<security-constraint>
<web-resource-collection>
<web-resource-name>TimeService</web-resource-name>
<url-pattern>/TimeService</url-pattern>
<http-method>POST</http-method> <!-- GET is used to receive POJOAuthService?wsdl -->
</web-resource-collection>
<auth-constraint>
<role-name>AppUser</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-role>
<role-name>AppUser</role-name>
</security-role>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Pojo Auth Test Realm</realm-name>
</login-config>
</web-app>
{code}
jboss-web.xml
{code:xml}
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_7_0.xsd"
version="7.0">
<security-domain>other</security-domain>
<context-root>/jaxws-pojo-endpoint</context-root>
</jboss>
{code}
-
jaxws-pojo-endpoint-1.0.war 19.1 KB
-
jaxws-pojo-endpoint.zip 6.3 KB