2015-11-04 81 views
0

我们正在考虑将我们的应用程序升级到Weblogic 12.2.1。服务器正常启动。但我们无法调用任何Web服务。它们使用Spring编写。此外,我们使用的是JDK 8.使用Spring的其他Web服务不在weblogic中调用12.2.1

,在日志出现的错误信息是:

org.springframework.web.servlet.PageNotFound未发现HTTP请求与URI映射[/测试/组件在DispatcherServlet的名为“调度” [noHandlerFound:1120 {}]

问题,只有当我们安装使用安装应用程序来。 当我们在开发环境中部署应用程序时,问题不会出现。我们能够成功调用服务。

我们已经比较了安装程序中的类路径以及开发,它们是相同的。

调度 - servlet.xml中

<beans 
xmlns="http://www.springframework.org/schema/beans" 
xmlns:context="http://www.springframework.org/schema/context" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:mvc="http://www.springframework.org/schema/mvc" 
xmlns:tx="http://www.springframework.org/schema/tx" 
xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-4.1.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-4.1.xsd 
    http://www.springframework.org/schema/mvc 
    http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd 
    http://www.springframework.org/schema/tx 
    http://www.springframework.org/schema/tx/spring-tx.xsd"> 

<context:component-scan base-package="test" /> 

<bean id="localeResolver" 
     class="org.springframework.web.servlet.i18n.CookieLocaleResolver"> 
    <property name="defaultLocale" value="en" /> 
</bean> 

<bean id="mvcConfigurationBeanPostProcessor" 
     class="com.jda.webworks.publicapi.common.SpringMvcConfigBeanPostProcessor"> 
</bean> 

<mvc:annotation-driven> 
    <mvc:message-converters register-defaults="false"> 
     <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" /> 
     <bean class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter" /> 
     <bean class="org.springframework.http.converter.StringHttpMessageConverter" /> 
    </mvc:message-converters> 
</mvc:annotation-driven> 

<!-- enable the configuration of app server transactional behavior based on annotations --> 
<tx:annotation-driven/> 
<tx:jta-transaction-manager/> 

<!-- Create instance of transaction template for programmatic transaction manipulation --> 
<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate"> 
    <property name="transactionManager" ref="transactionManager"></property> 
</bean> 

我们尝试添加<mvc:default-servlet-handler />也。但是这并没有帮助。

的web.xml

<?xml version="1.0" encoding="UTF-8"?> 

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd“>

<servlet> 
    <servlet-name>dispatcher</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

<servlet-mapping> 
    <servlet-name>dispatcher</servlet-name> 
    <url-pattern>/*</url-pattern> 
</servlet-mapping> 

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>/WEB-INF/dispatcher-servlet.xml</param-value> 
</context-param> 

<!-- 
<context-param> 
    <param-name>log4jConfigLocation</param-name> 
    <param-value>/WEB-INF/config/log4j.xml</param-value> 
</context-param> 
--> 

<listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 

<!-- 
<listener> 
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> 
</listener> 
--> 

<session-config> 
    <session-timeout>1</session-timeout> 
</session-config> 

<security-constraint> 
    <web-resource-collection> 
     <web-resource-name>WebWORKS RESTful Services</web-resource-name> 
     <url-pattern>/*</url-pattern> 
     <http-method>POST</http-method> 
     <http-method>GET</http-method> 
     <http-method>PUT</http-method> 
     <http-method>DELETE</http-method> 
    </web-resource-collection> 
    <auth-constraint> 
     <role-name>NetworksUsers</role-name> 
    </auth-constraint> 
</security-constraint> 
<login-config> 
    <auth-method>BASIC</auth-method> 
    <realm-name>default</realm-name> 
</login-config> 
<security-role> 
    <role-name>NetworksUsers</role-name> 
</security-role> 

请给我们有任何帮助解决问题的指针

+0

你可以添加web.xml吗? – HRgiger

回答

0

我们已经向Oracle提出了一个案例,与此同时,我们找到了解决上述问题的方法问题。

如果在WEB-INF/classes或WEB-INF/lib下其余类可用,这似乎可行。以前,我们从ear/lib(通过application.xml设置为lib)从“更高”类加载器加载类,然后我们看到问题。
当然,在WLS 12.1.3中,我们从未遇到任何问题。包含REST类的.jar只在ear/lib中,而不在WAR的WEB-INF中。