Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #32550
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2015-09-07 01:41 -0700 |
| Message-ID | <29af886b-e905-4be5-b25d-12d5ea4e547b@googlegroups.com> (permalink) |
| Subject | EJB + Glassfish : remote client |
| From | Benjamin <mampaey.benjamin@mampaeybvba.com> |
Hi all,
I am experimenting with Java Enterprise Beans and Glassfish.
I created also a stand alone client...
It is all running perfectly in Netbeans, but when I try outside Netbeans, it is not working at all.
Also when I download the client-stubs in Glassfish it is not working.
I tried different things, also included different Glassfish jar-files, but nothing worked.
Can anyone help me?
I get following error:
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at jbizclient.functions.General.getBean(General.java:52)
at jbizclient.functions.General.translateCpt(General.java:66)
at jbizclient.core.Loader.<init>(Loader.java:19)
at jbizclient.JBiz.main(JBiz.java:16)
Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
... 7 more
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at jbizclient.functions.General.getBean(General.java:52)
at jbizclient.functions.General.translateCpt(General.java:66)
at jbizclient.functions.General.translateCpt(General.java:91)
at jbizclient.core.Loader.<init>(Loader.java:19)
at jbizclient.JBiz.main(JBiz.java:16)
Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
... 8 more
Exception in thread "main" java.lang.NullPointerException
at jbizclient.functions.General.translateCpt(General.java:79)
at jbizclient.core.Loader.<init>(Loader.java:19)
at jbizclient.JBiz.main(JBiz.java:16)
This is what I do:
jbiz.core.ComponentTranslationRemote cpttr = (jbiz.core.ComponentTranslationRemote)jbizclient.functions.General.getBean("jbiz.core.ComponentTranslationRemote");
String translation = cpttr.translate(parentName, componentName, lang, cpt.getText());
public static Object getBean(String remoteBean) {
try {
Properties props = new Properties();
props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
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");
InitialContext ctx = new InitialContext(props);
return ctx.lookup(remoteBean);
} catch (NamingException e) {
e.printStackTrace();
}
return null;
}
Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread
EJB + Glassfish : remote client Benjamin <mampaey.benjamin@mampaeybvba.com> - 2015-09-07 01:41 -0700
csiph-web