简体   繁体   English

Java STS机制异常

[英]Java STS mechanism exception

I am trying to implement web services that use different security mechanisms to do some performance tests and compare them. 我正在尝试实现使用不同安全性机制的Web服务来进行一些性能测试并进行比较。 I am using Java and Netbeans 7 with Glassfish. 我在Glassfish中使用Java和Netbeans 7。 I managed to implement all the security mechanisms but i have trouble with the STS. 我设法实现了所有安全机制,但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: 我正在按照本指南创建STS,但是在完成所有步骤并尝试运行项目后,出现以下异常:

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. 谢谢

Apparently its the bug with the STS wizzard: 显然是STS向导的错误:

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

Changing web.xml 更改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. 应该摆脱这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM