Results 1 to 9 of 9

Thread: remoting with spring dm server

  1. #1
    Join Date
    Nov 2008
    Posts
    232

    Default remoting with spring dm server

    I am trying to get the remote service up and running on a dm server through "org.springframework.remoting.httpinvoker.HttpInvo kerServiceExporter"

    But the service is not available while accessing through client [500 error]


    In WEB-INF/spring/service.xml
    Code:
    <bean name="accountExporter" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
    <property name="service" ref="accountService"/>
    <property name="serviceInterface" value="example.AccountService"/>
    </bean>
    In web.xml
    Code:
    <servlet>
    <servlet-name>accountExporter</servlet-name>
    <servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>accountExporter</servlet-name>
    <url-pattern>/remoting/AccountService</url-pattern>
    </servlet-mapping>
    On client side
    Code:
    <bean id="myclient" class="com.pg.remote.client.MyClient" init-method="init">
    		<property name="accountService" ref="httpInvokerProxy"></property>
    	</bean>
    	<bean id="httpInvokerProxy"	class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    		<property name="serviceUrl"	value="http://localhost:8080/remote/remoting/AccountService" />
    		<property name="serviceInterface" value="com.pg.remote.server.AccountService" />
    	</bean>

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Can you post your stacktrace, normally that is quite informative. Also make sure that your application starts correctly...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Nov 2008
    Posts
    232

    Default

    Exception seen when deploying the client bundle

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myclient' defined in URL [bundleentry://121/META-INF/spring/dbaccess-context.xml]: Invocation of init method failed; nested exception is org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://localhost:8080/remote/remoting/AccountService]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 500, status message = [Internal Server Error]
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:288)
    	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:145)
    	at com.springsource.server.kernel.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://localhost:8080/remote/remoting/AccountService]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 500, status message = [Internal Server Error]
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:211)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:144)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    	at $Proxy103.insertAccount(Unknown Source)
    	at com.pg.remote.client.MyClient.init(MyClient.java:24)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    	... 17 more
    Caused by: java.io.IOException: Did not receive successful HTTP response: status code = 500, status message = [Internal Server Error]
    	at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.validateResponse(SimpleHttpInvokerRequestExecutor.java:146)
    	at org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor.doExecuteRequest(SimpleHttpInvokerRequestExecutor.java:65)
    	at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:136)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:191)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:173)
    	at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:141)
    	... 28 more
    Last edited by vishalj; Feb 3rd, 2009 at 10:52 PM.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    Please use [ code][/code ] tags when posting code/xml/stacktraces...

    This seems to be the clientside configuration, there must be however also some server side error...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Nov 2008
    Posts
    232

    Default

    No the server side is being succesfully deployed
    The remoting service is a part of web bundle and am able to access other web content

  6. #6
    Join Date
    Nov 2008
    Posts
    232

    Default

    Sorry the server side was giving run time error and its solved now
    Thanks for the Replies

  7. #7
    Join Date
    Jul 2009
    Posts
    8

    Default

    Quote Originally Posted by vishalj View Post
    Sorry the server side was giving run time error and its solved now
    Thanks for the Replies
    Hi there,

    I have some questions on this, please understand I am a newbie:

    1. Did you build your project using eclipse? If yes, did you export it as a deployable jar and rename it to war extension after the export?
    2. Where did you put the web.xml, I assume it is in /WEB-INF/, correct?
    3. If you don't mind, could you please forward me your entire project on this to my email address because I really wanna know the hierarchy of this project?

    Please help me. Thank you.

    Jeff,

  8. #8
    Join Date
    Nov 2008
    Posts
    232

    Default

    Hi Jeff,
    1.I did build the jar using ant .and yes it was just a jar not a war
    2.Yes the web.xml was in WEB-INF/
    3.Sure will upload the sample here itself

    Regards,
    vishal

  9. #9
    Join Date
    Nov 2008
    Posts
    232

    Default

    Have attached a working sample here
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •