This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hello, creating an STS as shown here[1] results in the below servlet-name/servlet-class mappings in the web.xml file: <servlet> <servlet-name>org.me.my.sts.MySTS</servlet-name> <servlet-class>org.me.my.sts.MySTS</servlet-class> <load-on-startup>0</load-on-startup> </servlet> − <servlet> <servlet-name>com.sun.xml.ws.mex.server.MEXEndpoint</servlet-name> <servlet-class>com.sun.xml.ws.mex.server.MEXEndpoint</servlet-class> <load-on-startup>0</load-on-startup> </servlet> While this will work on GlassFish, Tomcat 6.0 complains when I deploy the dist/STS.war file--it appears to want the servlet-class value to be the standard "com.sun.xml.ws.transport.http.servlet.WSServlet" for both items above. Tomcat error: INFO: Marking servlet org.me.my.sts.MySTS as unavailable Feb 15, 2010 10:28:54 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /MySTSProject threw load() exception java.lang.ClassCastException: org.me.my.sts.MySTS cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1104) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) ... SEVERE: Servlet /MySTSProject threw load() exception java.lang.ClassCastException: com.sun.xml.ws.mex.server.MEXEndpoint cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1104) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045) However, if I switch to com.sun...WSServlet, deployments on GlassFish raise this error: SEVERE: Exception while preparing the app java.lang.RuntimeException: Service MySTSService seems to be a JAXRPC based web service but without the mandatory WSDL and Mapping file. Deployment cannot proceed at org.glassfish.webservices.WebServicesDeployer.prepare(WebServicesDeployer.java:187) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:310) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320) Is it possible to have a servlet-class value that will have both Tomcat and GlassFish happy? That would greatly help portability across servlet containers. See also: http://forums.java.net/jive/thread.jspa?messageID=262102 Thanks, Glen [1] https://jax-ws.dev.java.net/guide/Example_Applications.html#gfrlq
For the web.xml within the STS WAR to be compatible on Tomcat, it is also necessary to add the following context listener to the file: <listener> <listener-class> com.sun.xml.ws.transport.http.servlet.WSServletContextListener </listener-class> </listener> I've tested adding this listener on GlassFish and it seems OK with it (the Calculator client uses the STS successfully), but am unsure if adding this listener causes other problems with GlassFish. If it is known that GlassFish can work with this listener, I think it should be added to the web.xml by default to enhance portability of the webapp WAR to Tomcat. However, going back to my original suggestion to change the servlet-class entries to make them Tomcat-compatible as follows: <servlet> <servlet-name>org.me.my.sts.MySTS</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> <servlet> <servlet-name>com.sun.xml.ws.mex.server.MEXEndpoint</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> Will return this error on GlassFish: WARNING: [AutoDeploy] Autodeploy failed : /work/myapps/sges-v3/glassfish/domains/domain1/autodeploy/MySTSProject.war. INFO: [AutoDeploy] Selecting file /work/myapps/sges-v3/glassfish/domains/domain1/autodeploy/MySTSProject.war for autodeployment. SEVERE: Exception while invoking class org.glassfish.webservices.WebServicesDeployer prepare method java.lang.RuntimeException: Service MySTSService seems to be a JAXRPC based web service but without the mandatory WSDL and Mapping file. Deployment cannot proceed at org.glassfish.webservices.WebServicesDeployer.prepare(WebServicesDeployer.java:187) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) Can NetBeans generate an STS with a servlet-class value of "com.sun.xml.ws.transport.http.servlet.WSServlet" and at the same time do whatever else is necessary for GlassFish *not* to report the error above? The same entries above will work fine on Tomcat.