WebLogic 12c 和 Spring MVC 错误 403
WebLogic 12c and Spring MVC error 403
我正面临 Spring MVC / Spring 安全项目的问题,我正试图通过 WebLogic 12c 运行。该项目是使用 Tomcat 创建的,但在 WL 上,我总是遇到错误 403 (http.../project/),或者当我尝试打开应该正常工作的内容时出现 404 URL (http .../project/users/).
该项目与 Spring MVC (4.3.0.RELEASE)、Spring Security (4.1.1.RELEASE) 和 Thymeleaf (3.0.1.RELEASE) 一起工作)
web.xml 文件包含:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<error-page>
<error-code>404</error-code>
<location>/404</location>
</error-page>
还有 weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<context-root>project</context-root>
<session-descriptor>
<cookie-name>PROJECT</cookie-name>
<cookie-path>/project</cookie-path>
</session-descriptor>
</weblogic-web-app>
整个 Spring 配置是使用 Java 而不是 XML 文件进行的。
我一直在尝试在这里和其他论坛找到的不同选项,但直到现在我找不到解决方案。
这样解决了。
对于用于初始化应用程序和安全性的 classes,实现 WebApplicationInitializer。我的具体案例还有另一个 JNDI 问题,但它已通过 weblogic.xml 中的几行和 JPA 数据源中注释的参数 [=17] 解决了=].
我正面临 Spring MVC / Spring 安全项目的问题,我正试图通过 WebLogic 12c 运行。该项目是使用 Tomcat 创建的,但在 WL 上,我总是遇到错误 403 (http.../project/),或者当我尝试打开应该正常工作的内容时出现 404 URL (http .../project/users/).
该项目与 Spring MVC (4.3.0.RELEASE)、Spring Security (4.1.1.RELEASE) 和 Thymeleaf (3.0.1.RELEASE) 一起工作)
web.xml 文件包含:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<error-page>
<error-code>404</error-code>
<location>/404</location>
</error-page>
还有 weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<context-root>project</context-root>
<session-descriptor>
<cookie-name>PROJECT</cookie-name>
<cookie-path>/project</cookie-path>
</session-descriptor>
</weblogic-web-app>
整个 Spring 配置是使用 Java 而不是 XML 文件进行的。
我一直在尝试在这里和其他论坛找到的不同选项,但直到现在我找不到解决方案。
这样解决了。 对于用于初始化应用程序和安全性的 classes,实现 WebApplicationInitializer。我的具体案例还有另一个 JNDI 问题,但它已通过 weblogic.xml 中的几行和 JPA 数据源中注释的参数 [=17] 解决了=].