Announcement Announcement Module
Collapse
No announcement yet.
Trying simple remoting from the example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying simple remoting from the example

    Hi All,
    I am trying the following example, Remoting With Spring to add remoting support to my working application.

    I added the following lines to my appcontext.xml

    Code:
    <bean name="/RuleRemote" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
        	<property name="service" ref="myRepository"/>
        	<property name="serviceInterface" value="com.MyRepository"/>
        </bean>
        
        <bean id="myRepository" parent="txProxy">
        	<property name="target">
        		<bean class="com.MyRepositoryImpl"/>
        	</property>
        </bean>
    Seems fairly straight forward, but in my client i am trying the following bunch of code,
    Code:
    HttpInvokerProxyFactoryBean proxy = new HttpInvokerProxyFactoryBean();
    proxy.setServiceUrl(
    "http://localhost:8080/myApp/RuleRemote");
    proxy.setServiceInterface(RuleRepository.class);
    try {
         proxy.afterPropertiesSet();
    } catch (MalformedURLException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
    }
    MyRepository repository = (MyRepository) proxy.getObject();
    MyRepository.save(rule);
    However, executing it throws an error, saying Status code 404 was thrown. I guess this must be some basic error. Can someone help me out?

    org.springframework.remoting.RemoteAccessException : Cannot access HTTP invoker remote service at [http://localhost:8080/claimprocess/RuleRemote]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 404, status message = [/claimprocess/RuleRemote]
    java.io.IOException: Did not receive successful HTTP response: status code = 404, status message = [/claimprocess/RuleRemote]

  • #2
    Something to do with ViewResolver

    Reading the initial chapters, do i need to declare some ViewResolver or the like? Am not using Springs "View" part in my application

    Comment

    Working...
    X