7 Replies Latest reply on Oct 22, 2005 8:49 AM by Neil Avery

    javassist.NotFoundException?: org.neo.swarmdesk.components.S

    Neil Avery Newbie

      Hi All,
      We have added a network based classloader to our app, we successfully load the bytes from the network and then call onto Classloader.defineclass(...)

      javassist throws the following not found on the class we are calling defineclass on.... We are using jboss-aop1.3.3, and java 5._05

      Can anyone help?
      Cheers Neil.

      java.lang.RuntimeException: javassist.NotFoundException: org.neo.swarmdesk.components.SnapshotFeed
       at org.jboss.aop.pointcut.Util.has(Util.java:189)
       at org.jboss.aop.pointcut.Util.has(Util.java:167)
       at org.jboss.aop.pointcut.TypeMatcher.visit(TypeMatcher.java:115)
       at org.jboss.aop.pointcut.ast.ASTHas.jjtAccept(ASTHas.java:22)
       at org.jboss.aop.pointcut.TypeMatcher.visit(TypeMatcher.java:58)
       at org.jboss.aop.pointcut.ast.ASTStart.jjtAccept(ASTStart.java:22)
       at org.jboss.aop.introduction.InterfaceIntroduction.matches(InterfaceIntroduction.java:149)
       at org.jboss.aop.AspectManager.applyInterfaceIntroductions(AspectManager.java:1357)
       at org.jboss.aop.AspectManager.translate(AspectManager.java:749)
       at org.jboss.aop.AspectManager.transform(AspectManager.java:662)
       at org.jboss.aop.standalone.AOPTransformer.aspectTransform(AOPTransformer.java:62)
       at org.jboss.aop.standalone.AOPTransformer.transform(AOPTransformer.java:54)
       at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
       at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
       at org.neo.swarm.core.classloader.SwarmPeerClassLoader.org$neo$swarm$core$classloader$SwarmPeerClassLoader$defineClass$aop(SwarmPeerClassLoader.java:104)
       at org.neo.swarm.core.classloader.SwarmPeerClassLoader$defineClass_1443268605793936711.invokeNext(SwarmPeerClassLoader$defineClass_1443268605793936711.java)
       at org.neo.swarm.interceptor.JBossMethodInvocation.proceed(JBossMethodInvocation.java:32)
       at org.neo.swarm.interceptor.tcp.RemoteMarshallerImpl.invoke(RemoteMarshallerImpl.java:34)
       at org.neo.swarm.jb.interceptor.tcp.RemoteMarshaller.remote(RemoteMarshaller.java:19)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:88)
       at org.neo.swarm.core.classloader.SwarmPeerClassLoader$defineClass_1443268605793936711.invokeNext(SwarmPeerClassLoader$defineClass_1443268605793936711.java)
       at org.neo.swarm.core.classloader.SwarmPeerClassLoader.defineClass(SwarmPeerClassLoader.java)
       at org.neo.swarm.services.tcp.remoting.SwarmRemotingMarshaller.unmarshallInstance(SwarmRemotingMarshaller.java:110)
       at org.neo.swarm.services.tcp.remoting.SwarmRemotingMarshaller.unmarshall(SwarmRemotingMarshaller.java:97)
       at org.neo.swarm.interceptor.tcp.RemoteMarshallerImpl.handleCollection(RemoteMarshallerImpl.java:50)
       at org.neo.swarm.interceptor.tcp.RemoteMarshallerImpl.invoke(RemoteMarshallerImpl.java:41)
       at org.neo.swarm.jb.interceptor.tcp.RemoteMarshaller.remote(RemoteMarshaller.java:19)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:88)
       at org.neo.swarm.DefaultSwarmContainer$findLocalByType_N7477645833130774505.invokeNext(DefaultSwarmContainer$findLocalByType_N7477645833130774505.java)
       at org.neo.swarm.DefaultSwarmContainer.findLocalByType(DefaultSwarmContainer.java)
       at org.neo.admin.model.ServicesNode.getChildCount(ServicesNode.java:46)
       at javax.swing.tree.DefaultTreeModel.getChildCount(DefaultTreeModel.java:168)
       at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1461)
       at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1270)
       at javax.swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(VariableHeightLayoutCache.java:966)
       at javax.swing.tree.VariableHeightLayoutCache.setExpandedState(VariableHeightLayoutCache.java:164)
       at javax.swing.plaf.basic.BasicTreeUI.updateExpandedDescendants(BasicTreeUI.java:1556)
       at javax.swing.plaf.basic.BasicTreeUI$Handler.treeExpanded(BasicTreeUI.java:3645)
       at javax.swing.JTree.fireTreeExpanded(JTree.java:2235)
       at javax.swing.JTree.setExpandedState(JTree.java:3006)
       at javax.swing.JTree.expandPath(JTree.java:1742)
       at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2189)
       at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2176)
       at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2130)
       at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelectionImpl(BasicTreeUI.java:3495)
       at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3480)
       at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3461)
       at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
       at java.awt.Component.processMouseEvent(Component.java:5485)
       at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
       at java.awt.Component.processEvent(Component.java:5253)
       at java.awt.Container.processEvent(Container.java:1966)
       at java.awt.Component.dispatchEventImpl(Component.java:3955)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
       at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
       at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
       at java.awt.Container.dispatchEventImpl(Container.java:2010)
       at java.awt.Window.dispatchEventImpl(Window.java:1774)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      Caused by: javassist.NotFoundException: org.neo.swarmdesk.components.SnapshotFeed
       at javassist.ClassPool.get(ClassPool.java:374)
       at javassist.CtClassType.getSuperclass(CtClassType.java:435)
       at org.jboss.aop.pointcut.Util.has(Util.java:183)
       ... 75 more
      


        • 1. Re: javassist.NotFoundException?: org.neo.swarmdesk.componen
          Kabir Khan Master

          I fixed something a few days ago in cvs that might solve this problem. Let me know how you get on. If you have problems building from cvs, I have the jars here, so you can mail me privately

          • 2. Re: javassist.NotFoundException?: org.neo.swarmdesk.componen
            Neil Avery Newbie

            Hi Kabir,
            Ive tried it against a HEAD build and still get the same problem.. strace follows

            
            method matched binding execution(public * $instanceof{org.neo.swarm.services.tcp.remoting.Remotable}->*(..)) AND !execution(* *->getKey(..)) AND !execution(* *->hashCode(..)) AND !execution(* *->equals(..)) public java.lang.String org.neo.swarm.services.platform.Runtime$$SwarmProxy$$.getVmName()
            method matched binding execution(public * $instanceof{org.neo.swarm.services.tcp.remoting.Remotable}->*(..)) AND !execution(* *->getKey(..)) AND !execution(* *->hashCode(..)) AND !execution(* *->equals(..)) public java.util.List org.neo.swarm.services.platform.Runtime$$SwarmProxy$$.getInputArguments()
            java.lang.RuntimeException: javassist.NotFoundException: org.neo.swarmdesk.components.SnapshotFeed
             at org.jboss.aop.pointcut.Util.has(Util.java:189)
             at org.jboss.aop.pointcut.Util.has(Util.java:167)
             at org.jboss.aop.pointcut.TypeMatcher.visit(TypeMatcher.java:115)
             at org.jboss.aop.pointcut.ast.ASTHas.jjtAccept(ASTHas.java:22)
             at org.jboss.aop.pointcut.TypeMatcher.visit(TypeMatcher.java:58)
             at org.jboss.aop.pointcut.ast.ASTStart.jjtAccept(ASTStart.java:22)
             at org.jboss.aop.introduction.InterfaceIntroduction.matches(InterfaceIntroduction.java:210)
             at org.jboss.aop.AspectManager.applyInterfaceIntroductions(AspectManager.java:1477)
             at org.jboss.aop.AspectManager.translate(AspectManager.java:814)
             at org.jboss.aop.AspectManager.transform(AspectManager.java:727)
             at org.jboss.aop.standalone.AOPTransformer.aspectTransform(AOPTransformer.java:62)
             at org.jboss.aop.standalone.AOPTransformer.transform(AOPTransformer.java:54)
             at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
             at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
             at java.lang.ClassLoader.defineClass1(Native Method)
             at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
             at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
             at org.neo.swarm.core.classloader.SwarmPeerClassLoader.org$neo$swarm$core$classloader$SwarmPeerClassLoader$defineClass$aop(SwarmPeerClassLoader.java:107)
             at org.neo.swarm.core.classloader.SwarmPeerClassLoader$defineClass_1443268605793936711.invokeNext(SwarmPeerClassLoader$defineClass_1443268605793936711.java)
             at org.neo.swarm.interceptor.JBossMethodInvocation.proceed(JBossMethodInvocation.java:32)
             at org.neo.swarm.interceptor.tcp.RemoteMarshallerImpl.invoke(RemoteMarshallerImpl.java:34)
             at org.neo.swarm.jb.interceptor.tcp.RemoteMarshaller.remote(RemoteMarshaller.java:19)
             at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:102)
             at org.neo.swarm.core.classloader.SwarmPeerClassLoader$defineClass_1443268605793936711.invokeNext(SwarmPeerClassLoader$defineClass_1443268605793936711.java)
             at org.neo.swarm.core.classloader.SwarmPeerClassLoader.defineClass(SwarmPeerClassLoader.java)
             at org.neo.swarm.services.tcp.remoting.SwarmRemotingMarshaller.unmarshallInstance(SwarmRemotingMarshaller.java:110)
             at org.neo.swarm.services.tcp.remoting.SwarmRemotingMarshaller.unmarshall(SwarmRemotingMarshaller.java:97)
             at org.neo.swarm.interceptor.tcp.RemoteMarshallerImpl.handleCollection(RemoteMarshallerImpl.java:50)
             at org.neo.swarm.interceptor.tcp.RemoteMarshallerImpl.invoke(RemoteMarshallerImpl.java:41)
             at org.neo.swarm.jb.interceptor.tcp.RemoteMarshaller.remote(RemoteMarshaller.java:19)
             at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:102)
             at org.neo.swarm.DefaultSwarmContainer$findLocalByType_N7477645833130774505.invokeNext(DefaultSwarmContainer$findLocalByType_N7477645833130774505.java)
             at org.neo.swarm.DefaultSwarmContainer.findLocalByType(DefaultSwarmContainer.java)
             at org.neo.admin.model.ServicesNode.getChildCount(ServicesNode.java:46)
             at javax.swing.tree.DefaultTreeModel.getChildCount(DefaultTreeModel.java:168)
             at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1461)
             at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeightLayoutCache.java:1270)
             at javax.swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(VariableHeightLayoutCache.java:966)
             at javax.swing.tree.VariableHeightLayoutCache.setExpandedState(VariableHeightLayoutCache.java:164)
             at javax.swing.plaf.basic.BasicTreeUI.updateExpandedDescendants(BasicTreeUI.java:1556)
             at javax.swing.plaf.basic.BasicTreeUI$Handler.treeExpanded(BasicTreeUI.java:3645)
             at javax.swing.JTree.fireTreeExpanded(JTree.java:2235)
             at javax.swing.JTree.setExpandedState(JTree.java:3006)
             at javax.swing.JTree.expandPath(JTree.java:1742)
             at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2189)
             at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2176)
             at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2130)
             at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelectionImpl(BasicTreeUI.java:3495)
             at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3480)
             at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3461)
             at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
             at java.awt.Component.processMouseEvent(Component.java:5485)
             at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
             at java.awt.Component.processEvent(Component.java:5253)
             at java.awt.Container.processEvent(Container.java:1966)
             at java.awt.Component.dispatchEventImpl(Component.java:3955)
             at java.awt.Container.dispatchEventImpl(Container.java:2024)
             at java.awt.Component.dispatchEvent(Component.java:3803)
             at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
             at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
             at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
             at java.awt.Container.dispatchEventImpl(Container.java:2010)
             at java.awt.Window.dispatchEventImpl(Window.java:1774)
             at java.awt.Component.dispatchEvent(Component.java:3803)
             at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
             at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
             at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
             at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
             at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
             at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
            Caused by: javassist.NotFoundException: org.neo.swarmdesk.components.SnapshotFeed
             at javassist.ClassPool.get(ClassPool.java:374)
             at javassist.CtClassType.getSuperclass(CtClassType.java:435)
             at org.jboss.aop.pointcut.Util.has(Util.java:183)
             ... 75 more


            • 3. Re: javassist.NotFoundException?: org.neo.swarmdesk.componen
              Kabir Khan Master

              Is SnapshotFeed available on the client classpath? Does the $$Proxy$$ inherit from that?

              • 4. Re: javassist.NotFoundException?: org.neo.swarmdesk.componen
                Neil Avery Newbie

                Snapshotfeed is the superclass of Snapshotfeed$$Proxy$$ neither are on the classpath as they are being downloaded across the network.
                Ill put a testcase together for this...
                Thanks
                Neil.

                • 5. Re: javassist.NotFoundException?: org.neo.swarmdesk.componen
                  Neil Avery Newbie

                  On further thought I realise that this wont work....We are create a remote-proxy on an object by generating the bytecode which subclasses the class of interest to which we then apply a remoting aspect. When this $Proxy$ class comes across the wire, looking up the superclass will fail as it doesnt exist.
                  I suspect this is going to be the case for any network based classloader which jboss-aop is weaving. The networked class wont exist on the classpath so it would make sense for jboss to call back onto the defining classloader to request the super. This would allow for the super also be downloaded and defined... (instead of relying on the sytem classloader).

                  • 6. Re: javassist.NotFoundException?: org.neo.swarmdesk.componen
                    Kabir Khan Master

                     

                    "neil_g_avery" wrote:
                    Snapshotfeed is the superclass of Ill put a testcase together for this...


                    Please do, I need to step through this to figure out what is going on :-)

                    • 7. Re: javassist.NotFoundException?: org.neo.swarmdesk.componen
                      Neil Avery Newbie

                      Hi Kabir,
                      We need to integrate our classloader env with Javassist using (ClassPath.appendClassPath(new ClassClassLoader(this))). We then we ran into a classloader related deadlock which was due to part of a classloaderimpl being aspectized. Removing that sorted out the deadlocking and now it all works properly.

                      Thanks for you help.
                      -Neil.