我在桌面应用程序中使用spring-security,下面是我的XML文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd" >
<bean id='myProvider' class='MyAuthenticationProvider'/>
<security:authentication-manager>
<security:authentication-provider ref='MyAuthenticationProvider' />
</security:authentication-manager>
<bean id='authenticationHolder' class='AuthenticationHolder' />
<bean scope="request" factory-bean="authenticationHolder" factory-method="getAuthentication" >
<security:user-service id="userDetailsService">
<security:user name="testUser" password="testPassword" authorities="ROLE_USER"/>
</security:user-service>
</bean>
<bean class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" id="passwordEncoder"/>
<bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased">
<property name="decisionVoters">
<list>
<bean class="org.springframework.security.vote.RoleVoter">
<property name="rolePrefix" value="MY_PREFIX_" />
</bean>
</list>
</property>
</bean>
<security:global-method-security secured-annotations="enabled"
access-decision-manager-ref="accessDecisionManager" />
运行时我收到此异常
SEVERE: Failed to load required web classes
java.lang.NoClassDefFoundError: javax/servlet/Filter
有任何帮助吗?感谢
[编辑] 忘了把jar添加到项目中!