If you want my advice - don't do it. I know what I am talking about.I've
been there, I've seen it, I suffered, it was long time ago, but I still
remember.
If you want your app to talk to EJB backend, do it over HTTP. Write your
own, tiny adapter, simple adapter and expose it over HTTP. Within few hours
you will progress much further than you are now, there will be no client
side magic and server specific libraries. Your life will be easier.
Regards,
Witold Szczerba
29 sie 2014 22:19 "Alexander Schell" <DealeyLama_at_gmx.de> napisaĆ(a):
> Good Evening
>
> Since two days I try to figure out what I'm doing wrong; two days
> without the slightest success...
>
> My Boss already started grinding the Cleaver and I'm beginnig to feel
> nervous when I think about my neck. I need it because it supports my Head.
>
> Anyway...
>
> All I wanted to do is to lookup a remote EJB - It's implementing an
> API-Interface from a another module - using a JNDI-Lookup in a
> stand-alone Client. I've to confess, that I'm completely out of ideas.
>
> Could please somebody look at this mess?
>
> Here's the Stacktrace the client prints:
>
> Exception in thread "main" javax.naming.NamingException: Lookup failed
> for 'java:global/LookupTest/LookupTest-ejb-1.0.0-SNAPSHOT/TestEJB' in
> SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700,
>
> java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory,
> org.omg.CORBA.ORBInitialHost=localhost,
>
> java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
> java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception
> is javax.naming.NamingException: ejb ref resolution error for remote
> business interfacecom.oneandone.qadevacc.lookuptest.api.TestEJBRemote
> [Root exception is java.lang.RuntimeException: Could not invoke
> defineClass!]]
>
> at
> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
> at
> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
> at javax.naming.InitialContext.lookup(InitialContext.java:411)
> at
>
> com.oneandone.qadevacc.lookuptest.client.LookupTestClient.lookup(LookupTestClient.java:63)
> at
>
> com.oneandone.qadevacc.lookuptest.client.LookupTestClient.main(LookupTestClient.java:26)
> Caused by: javax.naming.NamingException: ejb ref resolution error for
> remote business interface org.alex.testRemote [Root exception is
> java.lang.RuntimeException: Could not invoke defineClass!]
> at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:433)
> at
>
> com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:75)
> at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
> at
>
> com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:527)
> at
> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:487)
> ... 4 more
> Caused by: java.lang.RuntimeException: Could not invoke defineClass!
> at
>
> org.glassfish.pfl.dynamic.codegen.impl.CodeGeneratorUtil.makeClass(CodeGeneratorUtil.java:
> at
> org.glassfish.pfl.dynamic.codegen.spi.Wrapper._generate(Wrapper.java:1102)
> at
> org.glassfish.pfl.dynamic.codegen.spi.Wrapper._generate(Wrapper.java:1086)
> at com.sun.ejb.EJBUtils.generateAndLoad(EJBUtils.java:593)
> at
> com.sun.ejb.EJBUtils.loadGeneratedRemoteBusinessClasses(EJBUtils.java:507)
> at
> com.sun.ejb.EJBUtils.loadGeneratedRemoteBusinessClasses(EJBUtils.java:465)
> at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:413)
> ... 8 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
>
> org.glassfish.pfl.dynamic.codegen.impl.CodeGeneratorUtil.makeClass(CodeGeneratorUtil.java:99)
> ... 14 more
> Caused by: java.lang.NoClassDefFoundError:
> com/sun/ejb/containers/RemoteBusinessObject
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
> ... 19 more
> Caused by: java.lang.ClassNotFoundException:
> com.sun.ejb.containers.RemoteBusinessObject
> at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> ... 21 more
>
>
> It would be great if somebody comes up with an idea...
>
>
> Thank you very much
>
>
>
> Best regards
>
> Alex
>
>