<!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="http://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;">
    Problem with web.xml referencing WEB-INF classes and lib in AS7
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/adinn">Andrew Dinn</a> in <i>JBoss Web Services Development</i> - <a href="http://community.jboss.org/message/608309#608309">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi guys,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I found another problem deploying the XTS interop tests to AS7. I can work round it but I think there issomething wrong in the dpeloyment model.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The deployment is a war which includes a junit jar in WEB-INF/lib and a mix of servlet classes and JaxWS endpoint implementation classes in WEB-INF/classes. When I deploy the web-app the JaxWS endpoint classes are not recognised as JaxWS endpoints even though they do have WebService annottaions (thsi is not a missing depenendencies problem -- the annotations do exist on the class).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">12:39:13,100 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/sc007]] (MSC service thread 1-3) Servlet /sc007 threw load() exception: java.lang.ClassCastException: com.jboss.transaction.wstf.webservices.sc007.sei.ParticipantPortTypeImpl cannot be cast to javax.servlet.Servlet
&#160;&#160;&#160; at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1162) [jbossweb-7.0.0.CR1.jar:7.0.0.Beta4-SNAPSHOT]
&#160;&#160;&#160; at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1108) [jbossweb-7.0.0.CR1.jar:7.0.0.Beta4-SNAPSHOT]
&#160;&#160;&#160; at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.0.CR1.jar:7.0.0.Beta4-SNAPSHOT]
&#160;&#160;&#160; at org.apache.catalina.core.StandardContext.start(StandardContext.java:3840) [jbossweb-7.0.0.CR1.jar:7.0.0.Beta4-SNAPSHOT]
&#160;&#160;&#160; at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Beta4-SNAPSHOT.jar:7.0.0.Beta4-SNAPSHOT]
&#160;&#160;&#160; at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1675)
&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]
&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]
&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It turns out that the problem is to do with the presence of both a WEB-INF classes directory and WEB-INF/lib jars. I stopped the debugger in WSDependenciesProcessor.isJaxwsJseDeployment() and identified the problem.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>private</b></font> <font color="navy"><b>boolean</b></font> isJaxwsJseDeployment(<font color="navy"><b>final</b></font> DeploymentUnit unit) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>final</b></font> <font color="navy"><b>boolean</b></font> isWarDeployment = DeploymentTypeMarker.isType(DeploymentType.WAR, unit);
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>if</b></font> (isWarDeployment) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>final</b></font> Index index = ASHelper.getRootAnnotationIndex(unit);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>final</b></font> WarMetaData warMetaData = ASHelper.getOptionalAttachment(unit, WarMetaData.ATTACHMENT_KEY);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>if</b></font> (warMetaData != <font color="navy"><b>null</b></font> &amp;&amp; warMetaData.getWebMetaData() != <font color="navy"><b>null</b></font>) <font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>return</b></font> (ASHelper.selectWebServiceServlets(index, warMetaData.getWebMetaData().getServlets(), <font color="navy"><b>true</b></font>).size() &gt; 0);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy">}</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy">}</font>
&#160;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="navy"><b>return</b></font> <font color="navy"><b>false</b></font>;
&#160;&#160;&#160; <font color="navy">}</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: arial,helvetica,sans-serif;">The problem is that call to </span><span style="font-family: arial,helvetica,sans-serif;">ASHelper.getRootAnnotationIndex. The deployment has two entries in its annotation map, one for the stuff in WEB-INF/lib and another for the stuff in WEB-INF/classes. </span><span style="font-family: arial,helvetica,sans-serif;">getRootAnnotationIndex picks the first one it finds with the MODULE_ROOT_MARKER tag. Unfortunately both of them have this tag and it returns the one for </span><span style="font-family: arial,helvetica,sans-serif;">WEB-INF/lib losing all info about the annotations on classes in </span><span style="font-family: arial,helvetica,sans-serif;">WEB-INF/classes.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I suppose this is an AS problem more than a WS one but its definitely going to cause some difficulties for WS users.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/608309#608309">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2047">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>