Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [riena-dev] Serialization of IWorkspace/IProject object on Riena Server

Hi Christian,
     Thank you for your quick reply.
     After sending this email i realized that with Riena Remote Service i am using "Hessian" as the serialization so don't need java Serialization.

    On Server iam executing a shelfCommand.
    ----------------------------------------------------
 Server runTest()
{
  1)  _process = DebugPlugin.exec(cmdLine, workingPath, envVars.getStringArray());
   2) server.serErrorStream(_process.getErrorStream());
   3) server.setInputStream(_process.getInputStream());
   4) server.setServerWorkspace(ResourcesPlugin.getWorkspace().getRoot());

    5) return server;
}

On Client
-------------
I invoke runTest() on server and "server" object is returned to client.
(2),(3) items are serialized fine. But if i add (4) which is IWorkspaceRoot  i get following error. This means that i can serialize ErrorStream and InputStream
fine, but i was wondering how can i send server's IWorkspace object to client. Is it possible?

Thanks much,
Prasanna


javax.servlet.ServletException: 13 class java.lang.Object
    at org.eclipse.riena.communication.publisher.hessian.RienaHessianDispatcherServlet.service(RienaHessianDispatcherServlet.java:155)
    at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
    at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
    at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
    at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:269)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
    at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
    at org.mortbay.http.HttpServer.service(HttpServer.java:909)
    at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
    at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
    at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
May 6, 2009 3:24:46 PM org.mortbay.jetty.servlet.ServletHandler handle
SEVERE: /hessian/testServer?runTest&RID-ee54p68o:
java.lang.RuntimeException: 13 class java.lang.Object
    at com.caucho.hessian.io.BasicSerializer.writeObject(BasicSerializer.java:282)
    at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:490)
    at com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:251)
    at com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:208)
    at com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:172)
    at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:490)
    at com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:251)
    at com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:208)
    at com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:172)
    at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:490)
    at com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:251)
    at com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:208)
    at com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:172)
    at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:490)
    at com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:251)
    at com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:208)
    at com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:172)
    at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:490)
    at com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:251)
    at com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:208)
    at com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:172)
    at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:490)
    at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:174)
    at org.eclipse.riena.communication.publisher.hessian.RienaHessianDispatcherServlet.service(RienaHessianDispatcherServlet.java:147)
    at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
    at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
    at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
    at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:269)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
    at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
    at org.mortbay.http.HttpServer.service(HttpServer.java:909)
    at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
    at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
    at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
May 6, 2009 3:39:24 PM org.mortbay.jetty.servlet.ServletHandler$Context log
   
    



From: christian.campo@xxxxxxxxxxxx
To: riena-dev@xxxxxxxxxxx
Subject: Re: [riena-dev] Serialization of IWorkspace/IProject object on Riena Server
Date: Wed, 6 May 2009 21:41:33 +0200

Hi Prasanna,

I am not sure I am getting this...... Remote service requires a service, an interface for the service (is that the workspace ?) and a client calling it. If you use Riena Remote Service, you use "hessian" as the serialization, so not Java Serialization code is needed. What is the purpose of this serializer code that you are doing on the server (in what service).

Maybe you can explain why you use Java serialization and what is the service ?

christian

Am 06.05.2009 um 21:17 schrieb Prasanna Tummala:

Hi,

        I anyone help me to Serialize IProject object that is created on server and pass it to client and deserialize it.

On Server(At send end) i am doing this..
FileOutputStream underlyingStream = new FileOutputStream("myobject.ser");
        ObjectOutputStream serializer = new ObjectOutputStream(underlyingStream);
        IProject pr = _project.getIProject();
        serializer.writeObject(_project);
        serializer.flush();
        serializer.close();

On client (At receive end) iam doing this
 FileInputStream fis = new FileInputStream("myobject.ser");
                 ObjectInputStream ois = new ObjectInputStream(fis);
                // IProject myDeserializedPorjectObject = (IProject)ois.readObject();
                 Project myDeserializedServerObject = (Project) ois.readObject();
                
                 ois.close();
                 IProject prj = myDeserializedServerObject.getIProject();
                 String path = myDeserializedServerObject.getProjectPath();

here On Client path is returned properly but IProject object is null. What am i missing here, why is IProject object not  passed from server

Here is my Project.java
public class Project implements Serializable {

private  String _projectName;
    private static String _projectPath;
    private static IWorkspace workspace;
    private static IWorkspaceRoot wsRoot;
    
    private  IProject _project = null;

    static final long serialVersionUID = 1L;
    
    /*************************************************************
    ** Constructor.
    *************************************************************/
    public Project(String usrName, String hostName, String projectName) {

        _projectName = projectName;
      
        // Save off the full path for the project.
        workspace = ResourcesPlugin.getWorkspace();
        wsRoot = workspace.getRoot();
       
        IProjectDescription description = workspace.newProjectDescription(projectName);
        // use the dct2000test project nature
       
        _project = workspace.getRoot().getProject("test");
    
       
    }
}



Thanks,
Prasanna


MSN Battles We pitch one stalwart against the other and give you the power. Who will you vote for? Share photos while you chat with Windows Live Messenger. <ATT00001.c>



Get easy photo sharing with Windows LiveT Photos. Drag n' drop

Back to the top