users@glassfish.java.net

Re: GlassFish v3, EJB 3.1 and Standalone Client

From: <glassfish_at_javadesktop.org>
Date: Sun, 13 Dec 2009 21:29:36 PST

also i can post my full example with error stacktrace.
1.session bean (interface not required , as we know from spec.)
[code]
public class MySessBean {

    public String sayHello(String name) throws Exception {
        System.out.println("Method initialized.");
        return "Hello : " + name;
    }
}

[/code]
2.Standalone java client
[code]
public class Main {

    public static void main(String[] args) {
        try {
            Properties jndiProps = new Properties();
            jndiProps.put("java.naming.factory.initial", "com.sun.enterprise.naming.impl.SerialInitContextFactory");
            jndiProps.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
            jndiProps.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            jndiProps.setProperty("org.omg.CORBA.ORBInitialHost", "127.0.0.1");
            jndiProps.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
            Context ctx = new InitialContext(jndiProps);
            System.out.println(ctx.lookup("java:global/MyEJBModule/MySessionBean"));
            MySessionBean mySessionBean = (MySessionBean)ctx.lookup("java:global/MyEJBModule/MySessionBean");
            mySessionBean.sayHello("Paata");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
[/code]

3. error stacktrace on server side:
[code]
WARNING: "IOP00100006: (BAD_PARAM) Class com.magti.billing.ejb.__EJB31_Generated__MySessionBean__Intf____Bean__ is not Serializable"
org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 6 completed: Maybe
        at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemException.java:990)
[/code]


4.client side error stacktrace:
[code]
Dec 14, 2009 9:15:13 AM com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
Dec 14, 2009 9:15:18 AM com.sun.enterprise.naming.impl.SerialContext lookup
SEVERE: enterprise_naming.serialctx_communication_exception
Dec 14, 2009 9:15:18 AM com.sun.enterprise.naming.impl.SerialContext lookup
SEVERE:
java.rmi.MarshalException: CORBA BAD_PARAM 1330446342 Maybe; nested exception is:
        java.io.NotSerializableException: ----------BEGIN server-side stack trace----------
org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 6 completed: Maybe
        at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemException.java:990)
        at com.sun.corba.ee.impl.logging.OMGSystemException.notSerializable(OMGSystemException.java:1005)
        at com.sun.corba.ee.impl.orbutil.ORBUtility.throwNotSerializableForCorba(ORBUtility.java:753)
        at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.writeAny(Util.java:370)
[/code]
[Message sent by forum member 'paata' ]

http://forums.java.net/jive/thread.jspa?messageID=376323