karthick
09-07-2010, 06:21 AM
Hi all,
I am using the hessian and spring ,in server side i got the process completed successfully but in client i got the following error like
com.caucho.hessian.io.HessianProtocolException: '?' is an unknown code.
In web.xml
<servlet>
<servlet-name>transactionProcessing</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>transactionProcessing</servlet-name>
<url-pattern>/transactionProcessing/*</url-pattern>
</servlet-mapping>
In transactionProcessing-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework .org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
>
<bean id="transactionProcessingService" class="example.BatchServiceImpl">
<property name="txnprocess" ref="txnProcessingService"/>
</bean>
<bean name="/transactionservice" class="org.springframework.remoting.caucho.HessianService Exporter">
<property name="service" ref="transactionProcessingService"/>
<property name="serviceInterface" value="example.BatchServiceIntf"/>
</bean>
</beans>
My remote invoke call is
package com.sping.Hessian;
import com.caucho.hessian.client.HessianProxyFactory;
import example.BatchServiceIntf;
public class HessianCall {
public BatchServiceIntf getProxyBatchService() {
HessianProxyFactory factory = new HessianProxyFactory();
BatchServiceIntf batch = null;
try {
batch = (BatchServiceIntf) factory.create(BatchServiceIntf.class, "http://localhost:8080/SpringTest/transactionProcessing/transactionservice");
} catch (Exception e) {
e.printStackTrace();
}
return batch;
}
public static void main(String[] args) {
try {
HessianCall hessianObj = new HessianCall();
BatchServiceIntf proxyService = hessianObj.getProxyBatchService();
proxyService.test();
proxyService.test1();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Please kindly do some needful to fix the issue
I am using the hessian and spring ,in server side i got the process completed successfully but in client i got the following error like
com.caucho.hessian.io.HessianProtocolException: '?' is an unknown code.
In web.xml
<servlet>
<servlet-name>transactionProcessing</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>transactionProcessing</servlet-name>
<url-pattern>/transactionProcessing/*</url-pattern>
</servlet-mapping>
In transactionProcessing-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework .org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
>
<bean id="transactionProcessingService" class="example.BatchServiceImpl">
<property name="txnprocess" ref="txnProcessingService"/>
</bean>
<bean name="/transactionservice" class="org.springframework.remoting.caucho.HessianService Exporter">
<property name="service" ref="transactionProcessingService"/>
<property name="serviceInterface" value="example.BatchServiceIntf"/>
</bean>
</beans>
My remote invoke call is
package com.sping.Hessian;
import com.caucho.hessian.client.HessianProxyFactory;
import example.BatchServiceIntf;
public class HessianCall {
public BatchServiceIntf getProxyBatchService() {
HessianProxyFactory factory = new HessianProxyFactory();
BatchServiceIntf batch = null;
try {
batch = (BatchServiceIntf) factory.create(BatchServiceIntf.class, "http://localhost:8080/SpringTest/transactionProcessing/transactionservice");
} catch (Exception e) {
e.printStackTrace();
}
return batch;
}
public static void main(String[] args) {
try {
HessianCall hessianObj = new HessianCall();
BatchServiceIntf proxyService = hessianObj.getProxyBatchService();
proxyService.test();
proxyService.test1();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Please kindly do some needful to fix the issue