Announcement Announcement Module
Collapse
No announcement yet.
Accessing HTTP Service (404 not found)... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing HTTP Service (404 not found)...

    Hello,

    I'm sure I'm missing something quite obvious with this one, but after trying all combinations of URLs in the XML below for the serviceUrl and <bean name...> parameters (eg. myapp/services, /services, /myapp/, etc), I always get the following error...

    WARN PageNotFound - No mapping for [/myapp/services/AuthenticatorService.service] in DispatcherServlet with name 'services'

    Hopefully someone with a little more Spring expertise than I have can let me know what I am doing wrong so I can kick myself when I know what was missing.

    XML is below.

    Thanks,

    Matthew

    spring.xml
    <bean id="service.Authenticator" class="com.myapp.service.impl.AuthenticatorService Impl"/>

    <bean name="/myapp/services/AuthenticatorService.service" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">
    <property name="service" ref="service.Authenticator" />
    <property name="serviceInterface" value="com.myapp.service.AuthenticatorService" />
    </bean>

    <bean id="service.AuthenticatorServiceProxy" class="org.springframework.remoting.httpinvoker.Ht tpInvokerProxyFactoryBean">
    <property name="serviceUrl" value="http://localhost:8080/myapp/services/AuthenticatorService.service"/>
    <property name="serviceInterface" value="com.myapp.service.AuthenticatorService"/>
    </bean>
    services-servlet.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

    <beans>


    </beans>
    web.xml
    <servlet>

    <servlet-name>services</servlet-name>

    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>

    <load-on-startup>1</load-on-startup>

    </servlet>

    <servlet-mapping>
    <servlet-name>services</servlet-name>
    <url-pattern>*.service</url-pattern>
    </servlet-mapping>

  • #2
    You can change the bean name from "/myapp/services/AuthenticatorService.service" to just "/AuthenticatorService.service".

    The request will map the content of the URL that follows the servlet context path - in this case just "/AuthenticationService.service".

    Comment


    • #3
      Hello Mark,

      Thanks for your reply, I tried what you suggested, i.e. I updated my bean name as follows (in spring.xml)...
      <bean name="/AuthenticatorService.service" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">
      <property name="service" ref="service.Authenticator" />
      <property name="serviceInterface" value="com.myapp.service.AuthenticatorService" />
      </bean>

      ...but still get the following...

      WARN PageNotFound - No mapping for [/myapp/services/AuthenticatorService.service] in DispatcherServlet with name 'services'

      Comment


      • #4
        Actually, it looks like you should also remove the "myapp" portion of the url attribute on the client.

        Can you also provide the contextLoaderListener definition from your web.xml?

        Comment

        Working...
        X