-
Jan 23rd, 2010, 06:21 AM
#1
Upgrade to spring 3 and http 406
Hi. I have upgraded my application to spring 3 and had to upgrade hessian to 3.2.1 version.
Unfortunately my remote application (tomcat 6, jdk 1.6.16) throws this exception:
Exception in thread "main" org.springframework.remoting.RemoteConnectFailureE xception: Cannot connect to Hessian remote
service at [http://www.opereta.hr/web/remoting/S...eiverService]; nested exception is com.caucho.hessian.client.HessianConnectionExcepti on: 406:
java.io.IOException: Server returned HTTP response code: 406 for URL: http://www.opereta.hr/web/remoting/S...eceiverService
at org.springframework.remoting.caucho.HessianClientI nterceptor.convertHessianAccessException(HessianCl ientInter
ceptor.java:258)
at org.springframework.remoting.caucho.HessianClientI nterceptor.invoke(HessianClientInterceptor.java:22 7)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy1.getCustomText(Unknown Source)
at Test.main(Test.java:21)
Caused by: com.caucho.hessian.client.HessianConnectionExcepti on: 406: java.io.IOException: Server returned HTTP response
code: 406 for URL: http://www.opereta.hr/web/remoting/S...eceiverService
at com.caucho.hessian.client.HessianProxy.invoke(Hess ianProxy.java:202)
at $Proxy0.getCustomText(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.remoting.caucho.HessianClientI nterceptor.invoke(HessianClientInterceptor.java:22 2)
... 4 more
Caused by: java.io.IOException: Server returned HTTP response code: 406 for URL: http://www.opereta.hr/web/remoting/S...eceiverService
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run( Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.http://www.protocol.http.HttpURLConn... ption(Unknown Source)
at sun.net.http://www.protocol.http.HttpURLConn...ream (Unknown Source)
at com.caucho.hessian.client.HessianProxy.invoke(Hess ianProxy.java:184)
... 10 more
Caused by: java.io.IOException: Server returned HTTP response code: 406 for URL: http://www.opereta.hr/web/remoting/S...eceiverService
at sun.net.http://www.protocol.http.HttpURLConn...ream (Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at com.caucho.hessian.client.HessianProxy.invoke(Hess ianProxy.java:173)
... 10 more
When I run it localy it works fine. I guess the problem is the remote location but what should I do?
This is the test client code:
public class Test {
public static void main(String[] args) {
SynchronizationReceiverService service = null;
HessianProxyFactoryBean factory = new HessianProxyFactoryBean();
try {
factory.setServiceInterface(SynchronizationReceive rService.class);
factory.setServiceUrl(args[0]);
factory.afterPropertiesSet();
factory.setDebug(true);
service = (SynchronizationReceiverService) factory.getObject();
}
catch (Exception e) {
throw new RuntimeException(e);
}
String text = service.getCustomText(SynchronizationReceiverServi ce.CUSTOM_TEXT_NEWS + "_hr_HR");
System.out.println("ok. Text: " + text);
}
}
Last edited by zac007; Jan 23rd, 2010 at 01:05 PM.
-
Jan 24th, 2010, 01:08 PM
#2
The problem was the host's security settings. It works now.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules