0 Replies Latest reply: Dec 4, 2007 10:03 AM by Xavier Jodoin RSS

    Bug version 3.6 with an addCatch

    Xavier Jodoin Newbie

      I think it's a new bug because the version 3.4 doesn't call exception when I make an add catch.

      ClassPool cp = ClassPool.getDefault();
      CtClass ct = cp.get(beanName);

      CtClass excType = cp.get("java.lang.Exception");
      for (CtMethod method : ct.getDeclaredMethods())
      {

      if (isTransactionRequired(method))
      {
      method.addCatch("{ com.netappsid.naming.NAIDTransactionManager.resetContext(); throw $e; }",excType);

      the exception:

      javassist.CannotCompileException: by javassist.bytecode.BadBytecode: unset variable
      at javassist.CtBehavior.addCatch(CtBehavior.java:913)
      at javassist.CtBehavior.addCatch(CtBehavior.java:857)
      at com.netappsid.naming.LocalNamingContext.lookup(LocalNamingContext.java:411)
      at com.netappsid.naming.LocalNamingContext.checkForInjection(LocalNamingContext.java:215)
      at com.netappsid.naming.LocalNamingContext.lookup(LocalNamingContext.java:524)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      at com.netappsid.utils.ServicesManager.getService(ServicesManager.java:83)
      at com.netappsid.utils.ServicesManager.getService(ServicesManager.java:110)
      at com.netappsid.remote.utils.ServicesManager.getUserServices(ServicesManager.java:43)
      at com.netappsid.remote.gui.SplashScreen.processLogin(SplashScreen.java:584)
      at com.netappsid.remote.gui.SplashScreen.setAllowLogin(SplashScreen.java:571)
      at com.netappsid.remote.gui.Workbench$Initialization.done(Workbench.java:1080)
      at org.jdesktop.swingworker.SwingWorker$5.run(Unknown Source)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
      Caused by: javassist.bytecode.BadBytecode: unset variable
      at javassist.bytecode.stackmap.TypeData.setType(TypeData.java:44)
      at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:645)
      at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:101)
      at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:161)
      at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:192)
      at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:154)
      at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:171)
      at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:120)
      at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:96)
      at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:404)
      at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:389)
      at javassist.CtBehavior.addCatch(CtBehavior.java:905)
      ... 20 more