Announcement Announcement Module
Collapse
No announcement yet.
Error While calling a method on a Remote Bean. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error While calling a method on a Remote Bean.

    Hi All,
    I am trying to implement remoting in my application using Spring provided Hessian service protocol. Am following the steps as discussed here:



    I am successfuly able to get the instance of my Bean class in my client Java code. But when I try to call a simple method that returns a string I get the following error:


    THe error is:
    Code:
    Cannot access Hessian remote service at [http://xpr:8000/r
    emoting/BeanLocatorHessian]; nested exception is com.caucho.hessian.io.HessianPr
    otocolException: expected string at end of file
    org.springframework.remoting.RemoteAccessException: Cannot access Hessian remote
     service at [http://xpr:8000/remoting/BeanLocatorHessian]; nested excep
    tion is com.caucho.hessian.io.HessianProtocolException: expected string at end o
    f file
    Caused by: com.caucho.hessian.io.HessianProtocolException: expected string at en
    d of file
            at com.caucho.hessian.io.HessianInput.error(HessianInput.java:1642)
            at com.caucho.hessian.io.HessianInput.expect(HessianInput.java:1632)
            at com.caucho.hessian.io.HessianInput.readString(HessianInput.java:772)
            at com.caucho.hessian.io.BasicDeserializer.readObject(BasicDeserializer.
    java:176)
            at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java)
            at com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:285)
            at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java)
            at $Proxy7.getObject(Unknown Source)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.springframework.remoting.caucho.HessianClientInterceptor.invoke(H
    essianClientInterceptor.java:164)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
    ReflectiveMethodInvocation.java:161)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
    cAopProxy.java:202)
            at $Proxy8.getObject(Unknown Source)
            at org.oclc.lbs.infra.framework.spring.SimpleObject.test(SimpleObject.ja
    va:45)
            at ejb.components.anujtest2.testanuj2_EJB.test(testanuj2_EJB.java:60)
            at ejb.components.anujtest2.testanuj2Remote.test(testanuj2Remote.java:60
    )
            at ejb.components.anujtest2.testanuj2Remote_DJC.access$101(testanuj2Remo
    te_DJC.java:4)
            at ejb.components.anujtest2.testanuj2Remote_DJC$2.invoke(testanuj2Remote
    _DJC.java:328)
            at com.sybase.djc.transaction.TransactionManager.invokeNotSupported1(Tra
    nsactionManager.java:675)
            at com.sybase.djc.transaction.TransactionManager.invokeNotSupported(Tran
    sactionManager.java:631)
            at ejb.components.anujtest2.testanuj2Remote_DJC.test(testanuj2Remote_DJC
    .java:353)
            at ejb.components.anujtest2.testanuj2Remote_DJC.$invoke(testanuj2Remote_
    DJC.java:138)
            at com.sybase.jaguar.server.JaguarServer.iiopHandler(JaguarServer.java:2
    64)
            at com.sybase.jaguar.server.RequestHandler.processRequest(RequestHandler
    .java:9)
            at com.sybase.djc.rmi.iiop.server.MessageHandler.processRequest(MessageH
    andler.java:625)
            at com.sybase.djc.rmi.iiop.server.MessageHandler.run(MessageHandler.java
    :326)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
    utor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:907)
            at java.lang.Thread.run(Thread.java:619)
    Am I missing something?

  • #2
    Srry I missed the link.
    I am referring to the Spring Framework documentation online:
    Chapter 17. Remoting and web services using Spring

    http://static.springframework.org/sp.../remoting.html

    Comment


    • #3
      Is it something to do with the fact that HessianInput.java file is unbuffered. I saw this comment in the java Docs of HessianInput:

      Input stream for Hessian requests.

      HessianInput is unbuffered, so any client needs to provide its own buffering.

      InputStream is = ...; // from http connection
      HessianInput in = new HessianInput(is);
      String value;

      in.startReply(); // read reply header
      value = in.readString(); // read string value
      in.completeReply(); // read reply footer

      Comment


      • #4
        Latest error message:

        I was initially using Hessian 3.0.2 Jar. I now switched to 3.2.0 jar and I get almost the same exception but with a different string message:

        THe error is:

        Code:
        Cannot access Hessian remote service at [http://xp:8000/r
        emoting/BeanLocatorHessian]; nested exception is com.caucho.hessian.io.HessianPr
        otocolException: expected hessian reply at end of file
        ?
        org.springframework.remoting.RemoteAccessException: Cannot access Hessian remote
         service at [http://xp:8000/remoting/BeanLocatorHessian]; nested excep
        tion is com.caucho.hessian.io.HessianProtocolException: expected hessian reply a
        t end of file
        ?
        Caused by: com.caucho.hessian.io.HessianProtocolException: expected hessian repl
        y at end of file
        ?
                at com.caucho.hessian.io.Hessian2Input.error(Hessian2Input.java:2705)
                at com.caucho.hessian.io.Hessian2Input.startReply(Hessian2Input.java:402
        )
                at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:218)
                at $Proxy4.getObject(Unknown Source)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.springframework.remoting.caucho.HessianClientInterceptor.invoke(H
        essianClientInterceptor.java:164)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
        ReflectiveMethodInvocation.java:161)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
        cAopProxy.java:202)
                at $Proxy5.getObject(Unknown Source)
                at org.oclc.lbs.infra.framework.spring.SimpleObject.test(SimpleObject.ja
        va:45)
                at ejb.components.anujtest2.testanuj2_EJB.test(testanuj2_EJB.java:60)
                at ejb.components.anujtest2.testanuj2Remote.test(testanuj2Remote.java:60
        )
                at ejb.components.anujtest2.testanuj2Remote_DJC.access$101(testanuj2Remo
        te_DJC.java:4)
                at ejb.components.anujtest2.testanuj2Remote_DJC$2.invoke(testanuj2Remote
        _DJC.java:328)
                at com.sybase.djc.transaction.TransactionManager.invokeNotSupported1(Tra
        nsactionManager.java:675)
                at com.sybase.djc.transaction.TransactionManager.invokeNotSupported(Tran
        sactionManager.java:631)
                at ejb.components.anujtest2.testanuj2Remote_DJC.test(testanuj2Remote_DJC
        .java:353)
                at ejb.components.anujtest2.testanuj2Remote_DJC.$invoke(testanuj2Remote_
        DJC.java:138)
                at com.sybase.jaguar.server.JaguarServer.iiopHandler(JaguarServer.java:2
        64)
                at com.sybase.jaguar.server.RequestHandler.processRequest(RequestHandler
        .java:9)
                at com.sybase.djc.rmi.iiop.server.MessageHandler.processRequest(MessageH
        andler.java:625)
                at com.sybase.djc.rmi.iiop.server.MessageHandler.run(MessageHandler.java
        :326)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
        utor.java:885)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
        .java:907)
                at java.lang.Thread.run(Thread.java:619)

        Comment


        • #5
          Can Please somebody help me, or nobody has ever faced this problem before?

          Comment


          • #6
            Same problem here

            Hessian try to serialize the server side exception to client with full stack trace elements. That's fine but under TCPMonitor I found the hessian data payload in the HTTP server response has be truncated.

            Still tracing the root cause of that problem.

            BTW, I'm using Spring-DM server + Spring-Remoting-Hessian.

            Comment


            • #7
              This should be a bug of Hessian 3.1.5

              Problem resolved by downgrading the com.caucho bundle to 3.1.3

              Comment


              • #8
                Hey thanks. I will try it at my end also.

                Comment

                Working...
                X