openejb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Laskowski <ja...@laskowski.net.pl>
Subject Q: JNDI context factory for OSGi env?
Date Fri, 16 Oct 2009 22:16:16 GMT
Hi,

I'm trying to figure out how to proceed with OSGi'fication of the
current openejb codebase and have created an ejb3 client that worked
fine standalone. When I run the client as a osgi bundle with
appropriate imports the client was not able to instantiate the
LocalInitialContextFactory (I believe it's java.lang.Class.forName
that messes it up). I guess it needs another approach for JNDI context
creation.

Does anybody know if there is another way to create a context so that
it's not javax.naming.spi.NamingManager.getInitialContext which
creates it, but some other code that would look for a service bundle
with the necessary context exposed as a service? Do you think that
javax.naming.spi.* package is the way to go?
InitialContextFactoryBuilder? Any help appreciated.

org.osgi.framework.BundleException: Activator start error in bundle
ejb_client [54].
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:1750)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1621)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:890)
        at org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:114)
        at org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:281)
        at org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:184)
        at java.lang.Thread.run(Thread.java:619)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate
class: org.apache.openejb.client.LocalInitialContextFactory [Root
exception is java.lang.ClassNotFoundException: or
g.apache.openejb.client.LocalInitialContextFactory]
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)
        at ejb_client.Activator.start(Activator.java:23)
        at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:667)
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:1699)
        ... 6 more
Caused by: java.lang.ClassNotFoundException:
org.apache.openejb.client.LocalInitialContextFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
        ... 12 more
javax.naming.NoInitialContextException: Cannot instantiate class:
org.apache.openejb.client.LocalInitialContextFactory [Root exception
is java.lang.ClassNotFoundException: org.apache.op
enejb.client.LocalInitialContextFactory]

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Mime
View raw message