+ Reply to Thread
Results 1 to 2 of 2

Thread: serializable question when deploy a client program onto Jboss server

  1. #1
    simonlee is offline Junior Member
    Join Date
    March 20th, 2008
    Location
    Changchun, Jili, China
    Posts
    9
    Downloads
    8
    Uploads
    0

    Default serializable question when deploy a client program onto Jboss server

    My Symphony application is based on Symphony 3.1.
    Resently, when I trying to deploy the client application onto a Jboss Server some JNDI questions bothered me.
    In Jboss environment, applications use org.jnp.interfaces.NamingContextFactory as the JNDI server factory. This factory require that all the object on the JNDI server are serializable.
    Jboss provide a NonSerializableFactory to store non-serializable objects, but these objects are valid only within the same JVM. So that, I can not use NonSerializableFactory .

    My client application is a typical Symphony program that has the following code:

    private SessionCreationAttributes attributes;
    //...
    try {
    SoamFactory.initialize();
    this.attributes = new SessionCreationAttributes();
    DefaultSecurityCallback securityCB = new DefaultSecurityCallback(userName, passWord);
    this.attributes.setSessionName(this.appName);
    this.attributes.setSessionType(seesionType);
    this.attributes.setSessionFlags(Session.PARTIAL_AS YNC);
    this.attributes.setSessionCallback(myCallback);
    this.connection = SoamFactory.connect(this.appName,securityCB);
    } catch (SoamException e) {
    e.printStackTrace();
    System.exit(-1);
    }


    In order to put my object onto Jboss JNDI server, I have to make the client class serializable. But during uploading, an exception named java.io.NotSerializableException is catched because the class SessionCreationAttributes is not serializable.
    Can you help me to solve these problem, or would you please give me some advice about this?
    And please correct me if I'm wrong.
    Thank you.
    Sincerely.

  2. #2
    Ajith's Avatar
    Ajith is offline Symphony DE Moderator
    Join Date
    February 28th, 2008
    Location
    Markham, Ontario
    Posts
    104
    Blog Entries
    2
    Downloads
    10
    Uploads
    0

    Default SDK not serializable

    Quote Originally Posted by simonlee View Post
    My Symphony application is based on Symphony 3.1.
    Resently, when I trying to deploy the client application onto a Jboss Server some JNDI questions bothered me.
    In Jboss environment, applications use org.jnp.interfaces.NamingContextFactory as the JNDI server factory. This factory require that all the object on the JNDI server are serializable.
    Jboss provide a NonSerializableFactory to store non-serializable objects, but these objects are valid only within the same JVM. So that, I can not use NonSerializableFactory .

    My client application is a typical Symphony program that has the following code:

    private SessionCreationAttributes attributes;
    //...
    try {
    SoamFactory.initialize();
    this.attributes = new SessionCreationAttributes();
    DefaultSecurityCallback securityCB = new DefaultSecurityCallback(userName, passWord);
    this.attributes.setSessionName(this.appName);
    this.attributes.setSessionType(seesionType);
    this.attributes.setSessionFlags(Session.PARTIAL_AS YNC);
    this.attributes.setSessionCallback(myCallback);
    this.connection = SoamFactory.connect(this.appName,securityCB);
    } catch (SoamException e) {
    e.printStackTrace();
    System.exit(-1);
    }


    In order to put my object onto Jboss JNDI server, I have to make the client class serializable. But during uploading, an exception named java.io.NotSerializableException is catched because the class SessionCreationAttributes is not serializable.
    Can you help me to solve these problem, or would you please give me some advice about this?
    And please correct me if I'm wrong.
    Thank you.
    Sincerely.
    We can't really make the SessionCreationAttributes class Serializable because all of the state is stored in a C++ object in the API core. So the object won't be accurately serialized.

    Can you just mark the member variable with the "transient" keyword? This means that it won't be serialized with the rest of the client members.
    Last edited by Ajith; August 13th, 2008 at 07:41 PM.

+ Reply to 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