aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Another proxy problem?
Date Fri, 10 Jun 2011 03:05:45 GMT
I saw this...

...
Caused by: java.lang.ClassFormatError: Unexpected error from weaving hook.
	at org.eclipse.osgi.internal.baseadaptor.weaving.WeavingHookConfigurator.processClass(WeavingHookConfigurator.java:74)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:596)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:567)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:490)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:478)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:458)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
	at org.apache.xbean.osgi.bundle.util.BundleClassLoader.loadClass(BundleClassLoader.java:75)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at org.apache.openejb.cdi.CdiScanner.load(CdiScanner.java:146)
	at org.apache.openejb.cdi.CdiScanner.init(CdiScanner.java:128)
	at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:193)
	at org.apache.geronimo.openejb.ThreadSingletonServiceAdapter.initialize(ThreadSingletonServiceAdapter.java:99)
	at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:49)
	at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:682)
	... 68 more
Caused by: org.osgi.framework.hooks.weaving.WeavingException: There was a serious error trying
to weave the class bsh.util.BeanShellBSFEngine. See the associated exception for more information.
	at org.apache.aries.proxy.impl.weaving.ProxyWeavingHook.weave(ProxyWeavingHook.java:75)
	at org.eclipse.osgi.internal.baseadaptor.weaving.WovenClassImpl.call(WovenClassImpl.java:129)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyHookPrivileged(ServiceRegistry.java:1239)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyHooksPrivileged(ServiceRegistry.java:1222)
	at org.eclipse.osgi.internal.baseadaptor.weaving.WovenClassImpl.callHooks(WovenClassImpl.java:154)
	at org.eclipse.osgi.internal.baseadaptor.weaving.WeavingHookConfigurator.processClass(WeavingHookConfigurator.java:68)
	... 91 more
Caused by: java.lang.RuntimeException: Unable to load the super type org.apache.bsf.util.BSFEngineImpl
for class bsh.util.BeanShellBSFEngine.
	at org.apache.aries.proxy.impl.common.AbstractWovenProxyAdapter.visit(AbstractWovenProxyAdapter.java:260)
	at org.objectweb.asm.ClassAdapter.visit(Unknown Source)
	at org.objectweb.asm.commons.SerialVersionUIDAdder.visit(Unknown Source)
	at org.objectweb.asm.ClassReader.accept(Unknown Source)
	at org.objectweb.asm.ClassReader.accept(Unknown Source)
	at org.apache.aries.proxy.impl.weaving.WovenProxyGenerator.getWovenProxy(WovenProxyGenerator.java:52)
	at org.apache.aries.proxy.impl.weaving.ProxyWeavingHook.weave(ProxyWeavingHook.java:62)
	... 96 more
Caused by: java.lang.ClassNotFoundException: org.apache.bsf.util.BSFEngineImpl
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	at org.apache.aries.proxy.impl.common.AbstractWovenProxyAdapter.visit(AbstractWovenProxyAdapter.java:214)
	... 102 more


running the cdi tck.  I think it means that the weaving code is converting a NoClassDefFoundError
due to a missing superclass into a ClassFormatError.  This seems like a mistake.  A lot of
code can deal with a NoClassDefFoundError and its more or less expected sometimes but ClassFormatError
is much less usual.  In particular OpenWebBeans tries to load every class to look for annotations
and doesn't worry if it cant load the class but it's not set up to deal with ClassFormatErrors.

I'm thinking this might be a good idea:

Index: proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
===================================================================
--- proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
   (revision 1134136)
+++ proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/common/AbstractWovenProxyAdapter.java
   (working copy)
@@ -257,7 +257,8 @@
     } catch (ClassNotFoundException e) {
       // If this happens we're about to hit bigger trouble on verify, so we can
       // just throw it
-      throw new RuntimeException(NLS.MESSAGES.getMessage("cannot.load.superclass", superName.replace('/',
'.'), typeBeingWoven.getClassName()), e);
+      UnableToProxyException u = new UnableToProxyException(name, e);
+      throw new RuntimeException(NLS.MESSAGES.getMessage("cannot.load.superclass", superName.replace('/',
'.'), typeBeingWoven.getClassName()), u);
     }
   }

and it seems to fix the immediate problem.

thoughts?

thanks
david jencks


Mime
View raw message