2 Replies Latest reply on Jan 13, 2010 5:24 AM by megalodon

    Runtime Exception when I try to getInterfaces() of a CtClass

      Hello All,

       

      I was trying to getInterfaces() of a CtClass object during load time but I keep getting exceptions of this format

       

      java.lang.RuntimeException: cannot find oracle/jdbc/driver/TypeCopyingBinder: oracle.jdbc.driver.TypeCopyingBinder found in oracle/jdbc/driver/TypeCopyingBinder.class
      java.lang.RuntimeException: cannot find oracle/jdbc/driver/BINARY_DOUBLENullBinder: oracle.jdbc.driver.BINARY_DOUBLENullBinder found in oracle/jdbc/driver/BINARY_DOUBLENullBinder.class

       

      I tried to insert some classpaths to the classpool but I don't know if that worked or if it can be of any use to solve this problem. Does this have anything to do with the interface implementation classes being loaded by different class loaders or through different class pools? If so, how can I find out and get CtClass'es of them?

       

      Please help. Thanks

       

      -Arvind

        • 1. Re: Runtime Exception when I try to getInterfaces() of a CtClass

          Hello All,

           

          Here is some additional information. I don't get this runtime error when I get the CtClass object using ClassPool.get() or when I call functions like getName() or getPackageName() for the obtained CtClass object. However, when I call functions like getModifiers() or getInterfaces(), I get the exception. Here is snip of the stack trace.

           

            javassist.CtClassType.getClassFile2(CtClassType.java:192)
            javassist.CtClassType.getModifiers(CtClassType.java:387)

           

          Please let me know why I am getting this issue. Thanks!

           

          -Arvind

          • 2. Re: Runtime Exception when I try to getInterfaces() of a CtClass
            made a work-around by loading and transforming classes using a standard ClassFileTransformer and using the bytes of the loading class to make CtClass objects using ClassPool.makeClassIfNew() function. Still getting exceptions but i seem to have gotten a little further.