Results 1 to 4 of 4

Thread: Connecting to exported Hessian service

  1. #1
    Join Date
    Feb 2006
    Posts
    4

    Question Connecting to exported Hessian service

    Hi all,

    I try to get a connection to a hessian service exported by the liferay portal. The use a Subclass of DispatcherServlet called RemotingServlet.

    In the remoting-servlet.xml there is an entry:
    <bean name="/com_liferay_portal_service_spring_UserService-hessian" class="org.springframework.remoting.caucho.Hessian ServiceExporter">
    <property name="service" ref="com.liferay.portal.service.spring.UserService .professional" />
    <property name="serviceInterface" value="com.liferay.portal.service.spring.UserServi ce" />
    </bean>
    ---------------
    And in the web.xml there is an entry:
    <servlet-mapping>
    <servlet-name>RemotingServlet</servlet-name>
    <url-pattern>/remoting/*</url-pattern>
    </servlet-mapping>

    I try to connect the exported service with the following code:
    ...
    HessianProxyFactory factory = new HessianProxyFactory();
    String userServiceUrl = "http://localhost/remoting/com_liferay_portal_service_spring_UserService-hessian";

    UserService userService = (UserService) factory.create(com.liferay.portal.service.spring.U serService.class, userServiceUrl);

    When I execute it, I get this exception stack:

    java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableException
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :539)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 89)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 35)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:302)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.ja va:1655)
    at java.lang.Class.privateGetPublicMethods(Class.java :1778)
    at java.lang.Class.getMethods(Class.java:832)
    at sun.misc.ProxyGenerator.generateClassFile(ProxyGen erator.java:173)
    at sun.misc.ProxyGenerator.generateProxyClass(ProxyGe nerator.java:74)
    at java.lang.reflect.Proxy.getProxyClass(Proxy.java:4 72)
    at java.lang.reflect.Proxy.newProxyInstance(Proxy.jav a:552)
    at com.caucho.hessian.client.HessianProxyFactory.crea te(HessianProxyFactory.java:203)
    ...

    Could you tell me what is wrong with that code? Am I using a wrong url?

    Looking forward to hearing from you.

    Markus

  2. #2
    Join Date
    Feb 2006
    Posts
    17

    Default

    Please check whether <common-lang.jar> is in your classpath. Perhaps you can paste the whole log and easy to trace of the actual error, thanks.

  3. #3
    Join Date
    Feb 2006
    Posts
    4

    Default

    Thanks for your reply!

    I had'nt "commons-lang.jar" in my classpath on client side. Now I included it and get other errors.

    java.lang.NoClassDefFoundError: com/liferay/util/dao/hibernate/OrderByComparator

    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.ja va:1655)
    at java.lang.Class.privateGetPublicMethods(Class.java :1778)
    at java.lang.Class.getMethods(Class.java:832)
    at sun.misc.ProxyGenerator.generateClassFile(ProxyGen erator.java:173)
    at sun.misc.ProxyGenerator.generateProxyClass(ProxyGe nerator.java:74)
    at java.lang.reflect.Proxy.getProxyClass(Proxy.java:4 72)
    at java.lang.reflect.Proxy.newProxyInstance(Proxy.jav a:552)
    at com.caucho.hessian.client.HessianProxyFactory.crea te(HessianProxyFact
    ory.java:203)

    Are there any other libraries, I have to include?

    Thanks a lot!

    Markus

  4. #4
    Join Date
    Feb 2006
    Posts
    4

    Default

    Sorry I think, I've been to fast with my question:

    > java.lang.NoClassDefFoundError:
    > com/liferay/util/dao/hibernate/OrderByComparator
    This looks like I have to set the classpath so the path with utils for the liferay portal, that I use.

    Markus

Posting Permissions

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