Doesn't support apps using Apache Jackr...

2010-07-15
2013-05-15
  • ballpointpenthief

    Hi,
    I have installed glassbox on our test server, however our webapp no longer starts up. Glassbox throws an NPE while Jackrabbit is loading with MySql.

    I would love to get it working. Here is the relevant stack trace:

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jcrSessionFactory' defined in ServletContext resource : Cannot resolve ref
    erence to bean 'repository' while setting bean property 'repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repository' defined
    in ServletContext resource : Invocation of init method failed; nested exception is javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbi
    t.core.persistence.pool.MySqlPersistenceManager
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1317)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1076)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
            … 52 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repository' defined in ServletContext resource : Invocation of init method
    failed; nested exception is javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
            … 62 more
    Caused by: javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager
            at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1433)
            at org.apache.jackrabbit.core.RepositoryImpl.access$800(RepositoryImpl.java:125)
            at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:2011)
            at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1994)
            at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:535)
            at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:366)
            at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:673)
            at org.springmodules.jcr.jackrabbit.RepositoryFactoryBean.createRepository(RepositoryFactoryBean.java:57)
            at org.springmodules.jcr.RepositoryFactoryBean.afterPropertiesSet(RepositoryFactoryBean.java:57)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
            … 69 more
    Caused by: java.lang.NullPointerException
            at glassbox.monitor.resource.JdbcMonitor.ajc$interFieldGetDispatch$glassbox_monitor_resource_JdbcMonitor$glassbox_monitor_resource_JdbcMonitor$TrackedStatement$key(JdbcMonitor.aj)
            at glassbox.monitor.resource.JdbcMonitor.getStatementKey(JdbcMonitor.aj:418)
            at glassbox.monitor.resource.JdbcMonitor.ajc$if_5(JdbcMonitor.aj:133)
            at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7078)
            at org.apache.jackrabbit.core.util.db.ConnectionHelper.tableExists(ConnectionHelper.java:189)
            at org.apache.jackrabbit.core.util.db.CheckSchemaOperation.run(CheckSchemaOperation.java:79)
            at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:529)
            at org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager.init(MySqlPersistenceManager.java:51)
            at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1429)
            … 79 more
    15-Jul-2010 09:53:07 org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    15-Jul-2010 09:53:07 org.apache.catalina.core.StandardContext start
    SEVERE: Context  startup failed due to previous errors

     
  • Ron Bodkin

    Ron Bodkin - 2010-07-21

    This is probably caused by having your MySQL JDBC driver loaded in a parent classloader. To work-around it, try weaving the JDBC at build time instead of using load-time weaving. This blog describes how to do it (for an Oracle JDBC driver but the concept is the same): http://jeoftp.blogspot.com/2009/03/timing-oracle-sql-queries-with-glassbox.html

    Let me know how it works and if you have problems.
    Ron

     
  • ballpointpenthief

    I tried to get this working today. (Instrumenting the MySQL JDBC driver with an ant task.)

    I couldn't get it working because of some dependencies which I didn't have. I removed the jboss  and c3po packages from the JDBC jar which got me down to 10 errors.

    I haven't been able to progress from there because of I problem with com.sleepycat.dbxml.XmlTransaction. I couldn't find where this was being referenced from, nor could I find a download for it. (It's the Berkeley DB XML API).

    Thanks for the tip about instrumenting the JDBC driver. I you have any other ideas I will give them a go.
    Matt

    The errors from the ant task are like this:

      /Users/matt/Documents/workspace/Project/war/WEB-INF/lib/mysql-connector.jar:0::0 can't determine modifiers of missing type com.sleepycat.dbxml.XmlTransaction
          when processing type mungers com.mysql.jdbc.AssertionFailedException
          when processing type mungers
          when weaving
          when batch building BuildConfig #Files=0 AopXmls=#0
          
          error at (no source information available)
          /Users/matt/Documents/workspace/Project/war/WEB-INF/lib/mysql-connector.jar:0::0 can't determine modifiers of missing type com.sleepycat.dbxml.XmlManager
          when weaving type com.mysql.jdbc.AssertionFailedException
          when weaving classes
          when weaving
          when batch building BuildConfig #Files=0 AopXmls=#0
          
          error at (no source information available)
          /Users/matt/Documents/workspace/Project/war/WEB-INF/lib/mysql-connector.jar:0::0 can't determine modifiers of missing type com.sleepycat.dbxml.XmlContainer
          when weaving type com.mysql.jdbc.AssertionFailedException
          when weaving classes
          when weaving
          when batch building BuildConfig #Files=0 AopXmls=#0
          
          error at (no source information available)
          /Users/matt/Documents/workspace/Project/war/WEB-INF/lib/mysql-connector.jar:0::0 can't determine modifiers of missing type com.sleepycat.dbxml.XmlManager
          when weaving type com.mysql.jdbc.AssertionFailedException
          when weaving classes
          when weaving
          when batch building BuildConfig #Files=0 AopXmls=#0
          
          error at (no source information available)
          /Users/matt/Documents/workspace/Project/war/WEB-INF/lib/mysql-connector.jar:0::0 can't determine modifiers of missing type com.sleepycat.dbxml.XmlQueryExpression

     
  • ballpointpenthief

    Thanks for the tip.

    I have the ant task working, and after bringing all the AspectJ libraries' versions into sync as much as I can I get the exception below when starting my app (fairly late on, as it happens).

    I get the iajc Ant task from aspectjtools-1.5.3.jar, and I ran the following command to find which files define CFlowCounter:

    $ find webapps/ROOT/WEB-INF/lib/ -name '*.jar' -exec bash -c 'f={}; jar -tf $f|grep CFlowCounter && echo $f' \;

    This told me that aspectjrt-1.5.3.jar and com.springsource.org.aspectj.tools-1.6.6.RELEASE.jar contained CFlowCounter.class so  I cleared the whole /org/aspectj/runtime package from this jar. (I cannot remove this jar completely.)

    I'm not entirely sure what is going on other TBH. Perhaps I need a version of aspectj-tools.jar which is compatible with the aspectjrt.jar in glassbox and then use that version everywhere. I do not know which version it uses though as it is marked with AspectJ for Glassbox 2.0 so I cannot try try easily.

    Stack trace follows.

    Caused by: java.lang.LinkageError: org/aspectj/runtime/internal/CFlowCounter
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks