Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rishi Dev Gupta
Using remoting services exposed through hessian
December 7, 2011 2:07 AM
Answer

Rishi Dev Gupta

Rank: Expert

Posts: 255

Join Date: November 23, 2008

Recent Posts

Hi all

I am using LFR 6, I need to call the user service from external server.
I know that Liferay exposes its services for remote calls using Hessian, Burlap to name a few.

I am using Hessian.

So when i make a call from Hessian client whcih is a standalone program running on command prompt.
I get following error

INFO: No server detected
Loading jar:file:/E:/Projects/Core/lib/hessian/portal-impl.jar!/system.properties
Dec 7, 2011 3:24:06 PM com.germinus.easyconf.ConfigurationLoader readPropertiesConfiguration
INFO: Properties for jar:file:/E:/Projects/Core/lib/hessian/portal-impl.jar!/portal loaded from [jar:file:/E:/Projects/Core/lib/hessian/portal-impl.jar!/portal.properties]
Loading jar:file:/E:/Projects/Core/lib/hessian/portal-impl.jar!/portal.properties
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:170)
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:112)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:662)
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:135)
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:114)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:658)
at com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:241)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:179)
at $Proxy0.getUserById(Unknown Source)
at hessian.HessianTest.main(HessianTest.java:33)
Caused by: java.lang.NullPointerException
at java.util.Locale.toLowerCase(Locale.java:1060)
at java.util.Locale.convertOldISOCodes(Locale.java:1083)
at java.util.Locale.<init>(Locale.java:272)
at java.util.Locale.<init>(Locale.java:302)
... 14 more
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.getUserById(Unknown Source)
at hessian.HessianTest.main(HessianTest.java:33)
Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:119)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:662)
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:135)
at com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:114)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:658)
at com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:241)
at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:179)
... 2 more


My code is something like
HessianProxyFactory factory = new HessianProxyFactory();
factory.setUser("test");
factory.setPassword("test");
System.out.println(factory.toString());
UserService service = null;
service = (UserService) factory
.create(
UserService.class,
url);
System.out.println(service.toString());

System.out.println("1111111111111111111");

User user = service.getUserById(10169);

System.out.println(user);


Any idea how to get this reflection error removed. Any suggestion will be appreciated

Thanks
Rishi
Rishi Dev Gupta
RE: Using remoting services exposed through hessian
October 30, 2012 9:19 PM
Answer

Rishi Dev Gupta

Rank: Expert

Posts: 255

Join Date: November 23, 2008

Recent Posts

I used the spring remoting services exposed instead of hessian or burlap.