<!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;">
    Simple Web Services are NOT Working -- Please Help
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/phanto">phanto</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/630226#630226">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><span style="font-family: helvetica;">Hi Everyone,</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: helvetica;">I am new to JBoss, and Java Web development in general.&#160; We are currently examining SOA based solutions for a future software development project, and we have been working with both JBoss and Glassfish for testing.&#160; Right now, we have been able to get a simple Java Web Service and REST Web Service created in Netbeans and Glassfish.&#160; This process was rather simple.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: helvetica;">We are now trying to do the exact same thing with JBoss and Eclipse.&#160; Thus far, this has been a complete and utter <strong>NIGHTMARE</strong>!&#160; I don't understand whether my problem is with Eclipse, JBoss, or both.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: helvetica;">I have created a simple web service following the insturctions posted here: </span></p><p><a class="jive-link-external-small" href="http://community.jboss.org/docs/DOC-15778" target="_blank">http://community.jboss.org/wiki/UsingTheSampleWebServiceWizards</a><span> .</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It seemed simple to follow, however, I am unable to access the WSDL file and the web service tester tool with the ?wsdl and ?tester urls appended to the web service path.&#160; I followed the JAX-WS example exactly, with the same names used for the example, and I am getting this error while accessing the ?wsdl page:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">java.lang.ClassCastException: org.jboss.samples.webservices.HelloWorld cannot be cast to javax.servlet.Servlet</span></p><p><span style="font-family: courier new,courier;"> org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139)</span></p><p><span style="font-family: courier new,courier;"> org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)</span></p><p><span style="font-family: courier new,courier;"> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)</span></p><p><span style="font-family: courier new,courier;"> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)</span></p><p><span style="font-family: courier new,courier;"> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)</span></p><p><span style="font-family: courier new,courier;"> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)</span></p><p><span style="font-family: courier new,courier;"> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> <span style="font-family: courier new,courier;">java.lang.Thread.run(Thread.java:662)</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I am using JBoss AS 7.0.2 with Eclipse 3.7, and the latest version of the JBoss Tools.&#160; Again, I followed the instructions exactly.&#160; I have absolutely no idea why this isn't working.&#160; So far, my experience with Glassfish has been much more positive, however, we would prefer to stay with JBoss, since it does have a lot of industry backing.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To assist with the debugging, here is the web.xml file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span></p><p><span style="font-family: courier new,courier;">&lt;web-app xmlns:xsi="<a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>" xmlns="<a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a>" xmlns:web="<a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" target="_blank">http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd</a>" xsi:schemaLocation="<a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" target="_blank">http://java.sun.com/xml/ns/javaee</a> <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>" id="WebApp_ID" version="3.0"&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160; &lt;display-name&gt;MySampleWS&lt;/display-name&gt;</span></p><p><span style="font-family: courier new,courier;">&#160; &lt;welcome-file-list&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160; &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;</span></p><p><span style="font-family: courier new,courier;">&#160; &lt;/welcome-file-list&gt;</span></p><p><span style="font-family: courier new,courier;">&#160; &lt;servlet&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160; &lt;display-name&gt;HelloWorld&lt;/display-name&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;servlet-name&gt;HelloWorld&lt;/servlet-name&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;servlet-class&gt;org.jboss.samples.webservices.HelloWorld&lt;/servlet-class&gt;</span></p><p><span style="font-family: courier new,courier;">&#160; &lt;/servlet&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160; &lt;servlet-mapping&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;servlet-name&gt;HelloWorld&lt;/servlet-name&gt;</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; &lt;url-pattern&gt;/HelloWorld&lt;/url-pattern&gt;</span></p><p><span style="font-family: courier new,courier;">&#160; &lt;/servlet-mapping&gt;</span></p><p><span style="font-family: courier new,courier;">&lt;/web-app&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: helvetica;">Here is the HelloWorld.java file:</span></p><p><span style="font-family: courier new,courier;">package org.jboss.samples.webservices;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">import javax.jws.WebMethod;</span></p><p><span style="font-family: courier new,courier;">import javax.jws.WebService;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">@WebService()</span></p><p><span style="font-family: courier new,courier;">public class HelloWorld {</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; @WebMethod()</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; public String sayHello(String name) {</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println("Hello: " + name);</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return "Hello " + name + "!";</span></p><p><span style="font-family: courier new,courier;">&#160;&#160;&#160; }</span></p><p><span style="font-family: courier new,courier;">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>All help is greatly appreciated!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thank You</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/630226#630226">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>