Discussion:
[Springframework-user] Remoting problem
Andreas Zielke
2005-02-18 18:32:19 UTC
Permalink
Hi *,

I've got a remoting problem, which at first seemed very similar to Charlie's
problem (http://sourceforge.net/mailarchive/message.php?msg_id=10887683).

My problem symptoms are exactly the same as in his first posting:
I get an exception in my client code:
org.springframework.remoting.RemoteAccessException: Cannot access HTTP
invoker remote service at
[http://localhost:8080/MMHelloWorld/ServiceFacade]; nested exception is
java.io.FileNotFoundException:
http://localhost:8080/MMHelloWorld/ServiceFacade
java.io.FileNotFoundException:
http://localhost:8080/MMHelloWorld/ServiceFacade
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:798)
at
.......

The server console contains the warning "No mapping for
[/MMHelloWorld/ServiceFacade] in DispatcherServlet with name 'remote'"


I'm using the following web.xml:
==========================================================================
<?xml version="1.0" encoding="UTF-8"?>

<!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 >
<!-- Context Configuration locations for Spring XML files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/applicationContext-resources.xml,
classpath:/applicationContext-hibernate.xml
</param-value>
</context-param>

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

<!-- Dispatch Servlet Configuration -->
<servlet>
<servlet-name>remote</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<!--
I've also included this mapping on and off (due to the chapter 12.4.1
BeanNameUrlHandlerMapping, although it seems to be missing in the remoting
chapter)
<servlet-mapping>
<servlet-name>remote</servlet-name>
<url-pattern>/ServiceFacade</url-pattern>
</servlet-mapping>
-->

</web-app>
==========================================================================
applicationContext-hibernate.xml contains (among other beans)

<bean id="model.ServiceFacade" class="model.ServiceFacade">

<bean name="/ServiceFacade"
class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
<property name="service">
<ref local="model.ServiceFacade"/>
</property>
<property name="serviceInterface">
<value>model.IServiceFacade</value>
</property>
</bean>
==========================================================================
remote-servlet.xml contains no beans, but inherits the parents' beans
I've also tried to explicitly pre-instantiate the
<bean
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
in remote-servlet.xml, but that didn't solve my problem, either
==========================================================================
The client application-context contains only two beans:
<bean id="facadeHolder" class="FacadeHolder">
<property name="facade"><ref bean="serviceFacade"/></property>
</bean>

<bean id="serviceFacade"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl">
<value>http://localhost:8080/MMHelloWorld/ServiceFacade</value>
</property>
<property name="serviceInterface">
<value>buerokino.model.IServiceFacade</value>
</property>
</bean>
==========================================================================

Some further info: my application is *NOT* running as root, so I don't use
http://localhost:8080/ServiceFacade but
http://localhost:8080/MMHelloWorld/ServiceFacade
instead.

Any hints?
(I've got the gut feeling that it could be one of the leading slashes in
the <bean name="/ServiceFacade" ... or the
<url-pattern>/ServiceFacade</url-pattern> and will try to fiddle around with
those.)

Thx for any info,
Andreas
--
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
Andreas Zielke
2005-02-18 19:11:49 UTC
Permalink
Hi *,

I debugged into the BeanNameUrlHandlerMapping (as I didn't get the expected
debuggin-log-outputs) and found out, that I have to define the bean
<bean name="/ServiceFacade" ... whithin my remote-servlet.xml (and change
the local ref to the model.ServiceFacade to a ref bean).
After that everything worked perfectly.

Must reread the documention on how beans are inherited (or not
inherited?)...

Regards,
Andreas



--- Weitergeleitete Nachricht / Forwarded Message ---
Date: Fri, 18 Feb 2005 19:32:19 +0100 (MET)
From: "Andreas Zielke" <***@gmx.net>
To: springframework-***@lists.sourceforge.net
Subject: Remoting problem

Hi *,

I've got a remoting problem, which at first seemed very similar to Charlie's
problem (http://sourceforge.net/mailarchive/message.php?msg_id=10887683).

My problem symptoms are exactly the same as in his first posting:
I get an exception in my client code:
org.springframework.remoting.RemoteAccessException: Cannot access HTTP
invoker remote service at
[http://localhost:8080/MMHelloWorld/ServiceFacade]; nested exception
is
java.io.FileNotFoundException:
http://localhost:8080/MMHelloWorld/ServiceFacade
java.io.FileNotFoundException:
http://localhost:8080/MMHelloWorld/ServiceFacade
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:798)
at
.......

The server console contains the warning "No mapping for
[/MMHelloWorld/ServiceFacade] in DispatcherServlet with name 'remote'"


I'm using the following web.xml:
==========================================================================
<?xml version="1.0" encoding="UTF-8"?>

<!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 >
<!-- Context Configuration locations for Spring XML files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/applicationContext-resources.xml,
classpath:/applicationContext-hibernate.xml
</param-value>
</context-param>

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

<!-- Dispatch Servlet Configuration -->
<servlet>
<servlet-name>remote</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<!--
I've also included this mapping on and off (due to the chapter 12.4.1
BeanNameUrlHandlerMapping, although it seems to be missing in the remoting
chapter)
<servlet-mapping>
<servlet-name>remote</servlet-name>
<url-pattern>/ServiceFacade</url-pattern>
</servlet-mapping>
-->

</web-app>
==========================================================================
applicationContext-hibernate.xml contains (among other beans)

<bean id="model.ServiceFacade" class="model.ServiceFacade">

<bean name="/ServiceFacade"
class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
<property name="service">
<ref local="model.ServiceFacade"/>
</property>
<property name="serviceInterface">
<value>model.IServiceFacade</value>
</property>
</bean>
==========================================================================
remote-servlet.xml contains no beans, but inherits the parents' beans
I've also tried to explicitly pre-instantiate the
<bean
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
in remote-servlet.xml, but that didn't solve my problem, either
==========================================================================
The client application-context contains only two beans:
<bean id="facadeHolder" class="FacadeHolder">
<property name="facade"><ref bean="serviceFacade"/></property>
</bean>

<bean
id="serviceFacade"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl">
<value>http://localhost:8080/MMHelloWorld/ServiceFacade</value>
</property>
<property name="serviceInterface">
<value>buerokino.model.IServiceFacade</value>
</property>
</bean>
==========================================================================

Some further info: my application is *NOT* running as root, so I don't use
http://localhost:8080/ServiceFacade but
http://localhost:8080/MMHelloWorld/ServiceFacade
instead.

Any hints?
(I've got the gut feeling that it could be one of the leading slashes in
the <bean name="/ServiceFacade" ... or the
<url-pattern>/ServiceFacade</url-pattern> and will try to fiddle around with
those.)

Thx for any info,
Andreas
--
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
--
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
Charles N. Harvey III
2005-02-18 19:40:10 UTC
Permalink
Hello.
I have yet another remoting question. :)

Is there a way for me to get a wsdl by hitting my service, like I do
with Axis? With an Axis service I can put ?wsdl at the end and
get the xml file that shows all the methods. This is very helpful
when my Flash developer can drop URLs into Flash and talk to my
webservice.

Besides that, I still can't actually connect to my Spring HTTP
service. Still getting the EOFException and I'm not sure why. Is
it because I haven't POSTed anything? I am just trying to bring
it up in a browser. Is that possible?

Thanks again.


Charlie

Loading...