I am developing Client Server application using HttpInvoker.
[JAVA]
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>OTV_SpringHttpInvoker</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<servlet>
<servlet-name>HttpUserService</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>HttpUserService</servlet-name>
<url-pattern>/HttpUserService</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/pages/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
HttpUserService-servlet.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<!-- Beans Declaration -->
<bean id="UserMap" class="java.util.concurrent.ConcurrentHashMap" />
<bean id="CacheService" class="com.otv.cache.service.CacheService">
<property name="userMap" ref="UserMap"/>
</bean>
<bean id="HttpUserService" class="com.otv.http.server.HttpUserService" >
<property name="cacheService" ref="CacheService"/>
</bean>
<!-- Http Invoker Service Declaration -->
<bean id="HttpUserServiceExporter" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">
<!-- service represents Service Impl -->
<property name="service" ref="HttpUserService"/>
<!-- serviceInterface represents Http Service Interface exposed -->
<property name="serviceInterface" value="com.otv.http.server.IHttpUserService"/>
</bean>
<!-- Mapping configurations from URLs to request handler beans -->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/HttpUserService">HttpUserServiceExporter</prop>
</props>
</property>
</bean>
</beans>
[/JAVA]
Using above code I published service. But while checking this service the following occurs in console.
[JAVA]
17:13:13,925 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
17:13:39,310 ERROR [[HttpUserService]] Servlet.service() for servlet HttpUserService threw exception
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFull y(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.rea dShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at org.springframework.core.ConfigurableObjectInputSt ream.<init>(ConfigurableObjectInputStream.java:47)
at org.springframework.remoting.rmi.CodebaseAwareObje ctInputStream.<init>(CodebaseAwareObjectInputStrea m.java:81)
at org.springframework.remoting.rmi.RemoteInvocationS erializingExporter.createObjectInputStream(RemoteI nvocationSerializingExporter.java:105)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.readRemoteInvocation(HttpInvoker ServiceExporter.java:114)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.readRemoteInvocation(HttpInvoker ServiceExporter.java:95)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.handleRequest(HttpInvokerService Exporter.java:72)
at org.springframework.web.servlet.mvc.HttpRequestHan dlerAdapter.handle(HttpRequestHandlerAdapter.java: 49)
at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:446)
at java.lang.Thread.run(Unknown Source)
17:14:13,925 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
[/JAVA]
How to resolve this ?
And anyone help me to give a sample program to implement client server program using httpinvoker for 2 different systems.