Search code examples
javaweb-servicessecurityjava-metro-frameworkwsit

Java STS mechanism exception


I am trying to implement web services that use different security mechanisms to do some performance tests and compare them. I am using Java and Netbeans 7 with Glassfish. I managed to implement all the security mechanisms but i have trouble with the STS. I am following this guide in order to create the STS but after i have done all the steps and i try to run the project i get the following exception:

SEVERE: Exception while loading the app : java.lang.IllegalStateException:
 ContainerBase.addChild: start: org.apache.catalina.LifecycleException: 
org.apache.catalina.LifecycleException: java.lang.ClassCastException: 
org.me.my.sts.MySTS cannot be cast to javax.servlet.Servlet

What is that and any way to overcome it ? Thnx.


Solution

  • Apparently its the bug with the STS wizzard:

    https://netbeans.org/bugzilla/show_bug.cgi?id=210144

    Changing web.xml

    <servlet>
    <servlet-name>MySTSService</servlet-name>
    <servlet-class>MySTSService</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
    

    to

    <servlet>
    <servlet-name>MySTSService</servlet-name>
    <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
    

    should get rid of the problem.