ejb client in netbeans platform application module -
im trying create ejb client in netbean platform appliactaions module, call ejb deployed in glassfish.
i have added required jar files ejb server application , required glashfish jars. appserv-rt.jar,javaee.jar, gf-client.jar.
following code works fine when called standalone java application , when try call netbeans platfrom application module , im unable context.
are there netbean platform specific configurations required?
try { properties props = new properties(); props.setproperty("java.naming.factory.initial", "com.sun.enterprise.naming.serialinitcontextfactory"); props.setproperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming"); props.setproperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.jndistatefactoryimpl" ); props.setproperty("org.omg.corba.orbinitialhost", "127.0.0.1"); props.setproperty("org.omg.corba.orbinitialport","3700"); initialcontext ctx = new initialcontext (props); mysessionbeanremote mysessionbean= (mysessionbeanremote)ctx .lookup("sessions.mysessionbeanremote"); userprofile user = new userprofile(); user.setactive('a'); user.setdescription("some desc"); user.setemail("abc"); user.setfirstname("xyz"); user.setlastname("123"); user.setpassword("pwd"); user.setstatus("enabled"); user.setuserid(long.valueof(25)); user.setusername("abc"); mysessionbean.persist(user); } catch (javax.naming.namingexception ne) { ne.printstacktrace(); } catch (exception e) { e.printstacktrace(); }
this not easy task. have @ this tutorial, bit old should still apply.
Comments
Post a Comment