I've found that the interface classloader is used to create the proxy when i do a remote call. In my case, i have a specific bundle with the interface (an api bundle ;)) so it doesn't import any specific openejb packages. I think it is the problem.
Rniamo On Tue, Jan 4, 2011 at 10:33 PM, Rniamo <[email protected]> wrote: > Hi, > > i'm trying to use openejb client in an OSGi environment (ServiceMix), > > my server works, my client works in classical environment but in OSGi an > exception is thrown: > > Caused by: java.lang.ExceptionInInitializerError > at > org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(EJBObjectHandler.java:107) > at > org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.java:191) > at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:232) > at javax.naming.InitialContext.lookup(InitialContext.java:392) > at sample.client.Client.call(Client.java:25) > at sample.client.Client.<init>(Client.java:13) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at > org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) > ... 20 more > Caused by: java.lang.RuntimeException: No ProxyFactory Can be installed. > Unable to load the class org.apache.openejb.client.proxy.Jdk13ProxyFactory. > at > org.apache.openejb.client.proxy.ProxyManager.<clinit>(ProxyManager.java:62) > ... 31 more > > My client is simple: > > Properties p = new Properties(); > p.put(Context.INITIAL_CONTEXT_FACTORY, > RemoteInitialContextFactory.class.getName()); > p.put(Context.PROVIDER_URL, "ejbd://localhost:4201"); > Context ctx = new InitialContext(p); > > And my MANIFEST.MF contains: > > Manifest-Version: 1.0 > Built-By: rniamo > Build-Jdk: 1.6.0_22 > Bundle-Version: 1.0.0 > Tool: Bnd-0.0.357 > Bundle-Name: Unnamed - sample-osgi-openejb:sample-client:bundle:1.0 > Bnd-LastModified: 1294176199006 > Created-By: Apache Maven Bundle Plugin > Bundle-ManifestVersion: 2 > Bundle-SymbolicName: sample-osgi-openejb.sample-client > Import-Package: javax.naming,org.apache.openejb.client;version="3.1.4" > > It sounds like a class loading problem but i don't see how to correct it > easily (i tried to add the proxy package but i have a class not found > exception on the ProxyManager class). Did openejb-client already work in > OSGi? > > Rniamo
