一直提示:
- Java code
No mapping found for HTTP request with URI [/test/interface/appInterface] in DispatcherServlet with name 'Dispatcher'
我的web.xml:
- XML code
<?xml version="1.0" encoding="UTF-8"?><web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/*.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>Dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> <init-param> <param-name>contextConfigLocation</param-name> <param-value> </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>Dispatcher</servlet-name> <url-pattern>/interface/*</url-pattern> </servlet-mapping> <session-config> <session-timeout>10</session-timeout> </session-config> <welcome-file-list> <welcome-file>/redirect.jsp</welcome-file> </welcome-file-list></web-app>
现在spring下就一个xml文件:
- XML code
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <bean id="appInterfaceImpl" class="com.irg.app.impl.AppInterfaceImpl" /> <bean name="/appInterface" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service" ref="appInterfaceImpl"/> <property name="serviceInterface" value="com.irg.app.IAppInterface"/> </bean></beans>
log4j我是打开debug,没有任何error信息,如果需要我再贴上来。
使用hessian客户端连接的时候就提示前面说的那个错误。
被迫作java开发,对环境什么都不熟悉,请大家帮帮忙吧!
------解决方案--------------------------------------------------------
<servlet-mapping>
<servlet-name>Dispatcher</servlet-name>
<url-pattern>/interface/*</url-pattern>
</servlet-mapping>
你尝试一下 将 <url-pattern>/interface/* </url-pattern>改为<url-pattern>/interface/*.do</url-pattern>
------解决方案--------------------------------------------------------
<servlet>