***** ASSERTION FAILED ***** on weblogic 8.1

Help
Oz Nevo
2009-05-22
2013-05-15
  • Oz Nevo
    Oz Nevo
    2009-05-22

    Hi,

    i tried to install glassbox on weblogic 8.1 with jdk 1.4.2 sp11 running on hp-ux 11i with oracle DB 10g.

    The installation went fine and the JAVA_OPTIONS was not removed.
    I added
    #### GlassBox:
    export GLASSBOX_BIN_DIR="/app/webtte04/sns844A/snsdomain/"
    export GLASSBOX_LIB_DIR="/app/webtte04/sns844A/snsdomain/lib"
    export GLASSBOX_HOME="/app/webtte04/sns844A/snsdomain/lib/glassbox"
    export JAVA_OPTIONS="$JAVA_OPTIONS -Xbootclasspath/p:$GLASSBOX_LIB_DIR/java14Adapter.jar -Xbootclasspath/a:$GLASSBOX_LIB_DIR/createJavaAdapter.jar:$GLASSBOX_LIB_DIR/aspectj14Adapter.jar:$GLASSBOX_LIB_DIR/aspectjweaver.jar:$GLASSBOX_LIB_DIR/glassboxMonitor.jar:$GLASSBOX_LIB_DIR/aspectjrt.jar -Daspectwerkz.classloader.preprocessor=org.aspectj.ext.ltw13.ClassPreProcessorAdapter -Dglassbox.install.dir=$GLASSBOX_HOME"

    I started my server and found out the following error:

    java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection'
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:219)
        at weblogic.utils.classloaders.GenericClassLoader.defineCodeGenClass(GenericClassLoader.java:776)
        at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenerator.java:97)
        at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFactory.java:402)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:237)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:200)
        at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:163)
        at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnectionObj(RmiDataSource.java:347)
        at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.java:319)
        at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:334)
    ...
    Caused by: java.lang.ClassFormatError: weblogic/jdbc/wrapper/PoolConnection_oracle_jdbc_driver_T4CConnection (Repetitive method name/signature)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:480)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:182)
        ... 39 more
    --------------- nested within: ------------------
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not find dynamically generated class: 'weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection' ] - with nested exception:
    [java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection']
        at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenerator.java:101)
        at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFactory.java:402)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:237)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:200)
        at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:163)
        at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnectionObj(RmiDataSource.java:347)
        at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.java:319)
    ...
    java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection'
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:219)
        at weblogic.utils.classloaders.GenericClassLoader.defineCodeGenClass(GenericClassLoader.java:776)
        at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenerator.java:97)
        at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFactory.java:402)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:237)
        at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:200)
        at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:163)
        at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnectionObj(RmiDataSource.java:347)
        at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.java:319)
        at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:334)

    Do you have a problem with the oracle.jdbc.driver.OracleDriver JDBC driver?

    Thanks,
    Oz

     
    • Ron Bodkin
      Ron Bodkin
      2009-05-26

      There is a problem with AspectJ load-time weaving using JDBC drivers in some cases where more than one class loader is involved.

      You can work-around it by weaving the JDBC driver offline.

      You can download the AspectJ tools from eclipse.org/aspectj

      Then run:

      jar xf glassboxMonitor.jar META-INF/Xlint.properties

      ajc -inpath oracleDriver.jar -aspectpath glasboxMonitor.jar -outjar oracleDriverWoven.jar -XlintFile META-INF/Xlint.properties

      Then make sure you use the woven driver and not the unwoven driver.

      Thanks also to Jeoff Wilks for working through this:
      http://jeoftp.blogspot.com/2009/03/timing-oracle-sql-queries-with-glassbox.html describes an example of this.

      I'll ping the AspectJ team on this: there's a more general case bug in their bug tracker but I'll raise this specific issue so that hopefully we can get a fix for AspectJ load-time weaving to handle this properly.

      Ron

       
  • Martin Rogers
    Martin Rogers
    2012-05-09

    Is anyone still working on this one?
    I have followed all the steps here and get a different fault.  With verbose on (-Daj.weaving.verbose=true) I see that ALL of my woven classes are successfully loaded apart from oracle.jdbc.OracleConnection.
    The successful ones all look like this:

    info processing reweavable type oracle.jdbc.OracleConnectionWrapper: oracle\jdbc\OracleConnectionWrapper.java
    info successfully verified type glassbox.monitor.resource.JdbcMonitor exists.  Originates from glassbox\monitor\resource\JdbcMonitor.aj

    The failed class gives me this:
    info processing reweavable type oracle.jdbc.OracleConnection: oracle\jdbc\OracleConnection.java
    info successfully verified type glassbox.monitor.resource.JdbcMonitor exists.  Originates from glassbox\monitor\resource\JdbcMonitor.aj
    error aspect 'glassbox.config.EagerConfigurator' woven into 'oracle.jdbc.OracleConnection' must be defined to the weaver (placed on the aspectpath, or defined in an aop.xml file if using LTW).

    The two glassbox classes referenced both exist in the same jar file (glassboxMonitor.jar).  Trying to determine what the difference might be, I used a bytecode editor on the problematic class and on some working classes.

    All  of them implement this interface: glassbox/monitor/resource/JdbcMonitor$TrackedResultSet

    However, so far I have found that OracleConnection (only) also implements this interface:
    glassbox/monitor/MonitoredType

    I do not know if this is significant - any ideas, anyone?