<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
POJO Endpoint causes NPE at JBossWebMetaDataParser.parse
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/abhi0123">abhi0123</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/730079#730079">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-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></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>TimeServiceSEI.java</strong></p><pre class="jive-pre"><code class="jive-code">
@WebService
public interface TimeServiceSEI {
          public Time getCurrentTime();
          public Time getCurrentTimeAfterHttpBasicAuthentication();
          public Time getCurrentTimeAfterDeclarativeRoleBasedAuthorization();
          public Time getCurrentTimeAfterProgrammaticRoleBasedAuthorization();
          public Time getCurrentTimeAfterUserPrincipalAuthentication();
          public Time getCurrentTimeAfterProgrammaticAuthentication();
}
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>TimeService.java</strong></p><pre class="jive-pre"><code class="jive-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")
@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
}
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>web.xml</strong></p><pre class="jive-pre"><code class="jive-code jive-xml">
<span class="jive-xml-tag"><span><web-app xmlns="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a><span>" xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"
  xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a><span> </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" target="_blank">http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd</a><span>"
  version="3.0"></span></span>
  <span class="jive-xml-tag"><security-constraint></span>
  <span class="jive-xml-tag"><web-resource-collection></span>
  <span class="jive-xml-tag"><web-resource-name></span>All resources<span class="jive-xml-tag"></web-resource-name></span>
  <span class="jive-xml-tag"><url-pattern></span>/*<span class="jive-xml-tag"></url-pattern></span>
  <span class="jive-xml-tag"><http-method></span>POST<span class="jive-xml-tag"></http-method></span>  <span class="jive-xml-comment"><!-- GET is used to receive TimeService?wsdl --></span>
  <span class="jive-xml-tag"></web-resource-collection></span>
  <span class="jive-xml-tag"></security-constraint></span>
  <span class="jive-xml-tag"><login-config></span>
  <span class="jive-xml-tag"><auth-method></span>BASIC<span class="jive-xml-tag"></auth-method></span>
                    <span class="jive-xml-tag"><realm-name></span>Pojo Auth Test Realm<span class="jive-xml-tag"></realm-name></span>
  <span class="jive-xml-tag"></login-config></span>
<span class="jive-xml-tag"></web-app></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>jboss-web.xml</strong></p><pre class="jive-pre"><code class="jive-code jive-xml">
<span class="jive-xml-tag"><span><jboss-web xmlns="</span><a class="jive-link-external-small" href="http://www.jboss.com/xml/ns/javaee" target="_blank">http://www.jboss.com/xml/ns/javaee</a><span>"
  xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"
  xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://www.jboss.com/xml/ns/javaee" target="_blank">http://www.jboss.com/xml/ns/javaee</a><span> </span><a class="jive-link-external-small" href="http://www.jboss.org/j2ee/schema/jboss-web_7_0.xsd" target="_blank">http://www.jboss.org/j2ee/schema/jboss-web_7_0.xsd</a><span>"
  version="7.0"></span></span>
  <span class="jive-xml-tag"><security-domain></span>other<span class="jive-xml-tag"></security-domain></span>
  <span class="jive-xml-tag"><context-root></span>/jaxws-pojo-endpoint<span class="jive-xml-tag"></context-root></span>
<span class="jive-xml-tag"></jboss></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/730079#730079">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>