0

我已将以下代码放入 tomcat 的 server.xml 文件中:

<Connector SSLEnabled="true" clientAuth="false"
    keystoreFile="D:\keystore.jks" keystorePass="****" maxThreads="150"
    port="8443" protocol="HTTP/1.1" scheme="https" secure="true"
    sslProtocol="TLS" />

我有一个基于 spring-mvc 的 Web 应用程序。但是当我尝试部署我的应用程序时,我收到以下错误:

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\Eclipse Workspaces\RPM\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\RPM\WEB-INF\classes\com\rpm\controller\AdminController.class]; nested exception is java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")

我的 web.xml 看起来像这样

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="WebApp_ID" version="3.0">
    <display-name>RPM</display-name>
    <welcome-file-list>
        <welcome-file>admin</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>RPM</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
</web-app>

dispatcher-servlet.xml 代码

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context-3.1.xsd
                        http://www.springframework.org/schema/mvc
                        http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd" >

    <context:component-scan base-package="com.rpm.controller" />
    <mvc:annotation-driven />
    <mvc:resources mapping="/css/**" location="/css/*"/>
    <mvc:resources mapping="/js/**" location="/js/*"/>
    <mvc:resources mapping="/images/**" location="/images/*"/>

    <!-- Beans to be autowired - START-->
    <bean class="com.rpm.beans.Clinic"/>
    <bean class="com.rpm.beans.PatientGroup"/>
    <bean class="com.rpm.beans.Clinician"/>
    <!-- Beans to be autowired - END-->


    <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver" >
        <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView" />
    </bean>
    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" >
        <property name="definitions">
            <list>
                <value>/WEB-INF/tiles/tiles.xml</value>
            </list>
        </property>
    </bean>
</beans>
4

1 回答 1

2

异常是因为安全管理器与 ssl 无关。

于 2012-07-31T07:58:58.033 回答