PDA

View Full Version : URL Mapping problem


zosoo7
Mar 20th, 2006, 03:26 PM
I'm trying to expose my java objects as web services using XFire, and JSR181 annotations, I'm able to config everything and have spring manage my services, but if you try to browse to another resource, such as an htm file, I get the following exception:

No mapping for [/InsightWeb/UnSecure/htm/Login.htm] in DispatcherServlet with name 'xfire'

I've tried setting my URL-PATTERN = "/services/*" in my web.xml, but it doesn't do anythig but make my services stop working. Any help would be appreciated. Thanks.

Here is my web.xml:


<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- START SNIPPET: xfire -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml
classpath:org/codehaus/xfire/spring/xfire.xml</param-value>
</context-param>

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>

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

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListe ner</listener-class>
</listener>

<servlet>
<servlet-name>xfire</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>

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

<!-- END SNIPPET: xfire -->
</web-app>


and here is my servlet config:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

<bean id="webAnnotations" class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnn otations"/>
<bean id="handlerMapping" class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMa pping">
<property name="typeMappingRegistry">
<ref bean="xfire.typeMappingRegistry"/>
</property>
<property name="xfire">
<ref bean="xfire"/>
</property>
<property name="webAnnotations">
<ref bean="webAnnotations"/>
</property>
</bean>



<bean id="authenticationService" class="com.sunbridgecapital.insight.services.authenticati on.AuthenticationService">
<property name="userDao">
<ref bean="userDao"/>
</property>
</bean>

<bean class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="alwaysUseFullPath"><value>true</value></property>
<property name="urlMap">
<map>
<entry key="/">
<ref bean="handlerMapping"/>
</entry>
</map>
</property>
</bean>
</beans>

kenevel
Mar 20th, 2006, 03:40 PM
If possible try debugging into the SimpleUrlHandlerMapping (and possibly the UrlPathHelper class) to see what the path that it trying to be matched is - you may find that your container is appending /index.jsp or something like that.

zosoo7
Mar 21st, 2006, 09:39 AM
Well, I think there MAY be a bug with XFire's Jsr181HandlerMapping class, whenever I set the <entry key= "/Services/*">, I would get an exception about there not being an adapter for Jsr181HandlerMapping class. So I scraped the Annotations, made my services POJO's, and used the XFireExporter to export my service interfaces. After I did that, and set the entry key to the above, it worked. If anybody else can verify that this in fact was a bug with XFire's class, I'll submit a bug. Thanks.