[jboss-user] [JBoss Web Services] - POJO Endpoint causes NPE at JBossWebMetaDataParser.parse

abhi0123 do-not-reply at jboss.com
Sat Apr 14 15:36:49 EDT 2012


abhi0123 [https://community.jboss.org/people/abhi0123] created the discussion

"POJO Endpoint causes NPE at JBossWebMetaDataParser.parse"

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

--------------------------------------------------------------
POJO Endpoint deployed with web.xml and jboss-web.xml. When enabled, or attempted to, JBOSS AS 7 fails with NPE. Source code and deployable attached.



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



*TimeServiceSEI.java*

@WebService
public interface TimeServiceSEI {

          public Time getCurrentTime();

          public Time getCurrentTimeAfterHttpBasicAuthentication();

          public Time getCurrentTimeAfterDeclarativeRoleBasedAuthorization();

          public Time getCurrentTimeAfterProgrammaticRoleBasedAuthorization();

          public Time getCurrentTimeAfterUserPrincipalAuthentication();

          public Time getCurrentTimeAfterProgrammaticAuthentication();
}



*TimeService.java*

@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")
@DeclareRoles({ "AppUser" })
public class TimeService implements TimeServiceSEI {

  @WebMethod
  @PermitAll
  @Override
          public Time getCurrentTime() {
                    return new Time();
          }

  /* HttpBasicAuthenticationHandler authenticates this request */
  @WebMethod
  @Override
          public Time getCurrentTimeAfterHttpBasicAuthentication() {
                    return getCurrentTime();
          }

  @WebMethod
  @RolesAllowed("AppUser")
  @Override
          public Time getCurrentTimeAfterDeclarativeRoleBasedAuthorization() {
                    return getCurrentTime();
          }
// some more methods
}



*web.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>All resources</web-resource-name>
  <url-pattern>/*</url-pattern>
  <http-method>POST</http-method>  <!-- GET is used to receive TimeService?wsdl -->
  </web-resource-collection>
  </security-constraint>

  <login-config>
  <auth-method>BASIC</auth-method>
                    <realm-name>Pojo Auth Test Realm</realm-name>
  </login-config>
</web-app>



*jboss-web.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>
--------------------------------------------------------------

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

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/20120414/2eed32af/attachment.html 


More information about the jboss-user mailing list