Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-73047

Oracle classes not visible from class loader on startup when using UCP and Oracle 11g Release 2

    Details

      Description

      Steps to reproduce

      1. Build Liferay Portal and setup an Oracle DB 11g Release 2;
      2. Place the ucp.jar and ojdbc6.jar into tomcat_home/lib/ext
      3. Configure server.xml in tomcat_home/conf
        <Resource name="jdbc/LiferayPool" 
        auth="Container" 
        type="oracle.ucp.jdbc.PoolDataSource" factory="oracle.ucp.jdbc.PoolDataSourceImpl"
         connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource" 
         url="jdbc:oracle:thin:@localhost:1521:orcl"
          user="<USERNAME>" password="<PASSWORD>"
        initialPoolSize="10" minPoolSize="10" maxPoolSize="50"
        maxStatements="250" connectionWaitTimeout="30" inactiveConnectionTimeout="300" abandonedConnectionTimeout="30"
        validateConnectionOnBorrow="true" sqlForValidateConnection="select 1 from DUAL" />
        
      1. Configure context.xml
        <ResourceLink name="jdbc/LiferayPool"  global="jdbc/LiferayPool"  type="oracle.ucp.jdbc.PoolDataSource"/>
        
      1. Add to the portal-ext.properties
        jdbc.default.jndi.name=jdbc/LiferayPool
        
        module.framework.properties.org.osgi.framework.bootdelegation=\
                __redirected,\
                com.liferay.aspectj,\
                com.liferay.aspectj.*,\
                com.liferay.portal.servlet.delegate,\
                com.liferay.portal.servlet.delegate*,\
                com.sun.ccpp,\
                com.sun.ccpp.*,\
                com.sun.crypto.*,\
                com.sun.image.*,\
                com.sun.jmx.*,\
                com.sun.jna,\
                com.sun.jndi.*,\
                com.sun.mail.*,\
                com.sun.management.*,\
                com.sun.media.*,\
                com.sun.msv.*,\
                com.sun.org.*,\
                com.sun.syndication,\
                com.sun.tools.*,\
                com.sun.xml.*,\
                com.yourkit.*,\
                sun.*,\
        		oracle.*
        
        
      1. Start the server

      Results of Testing

      Expected Result: Server just start up correctly
      Actual Results: Server fails to start due to error below

      Errors/Logs

      15:58:24,398 ERROR [localhost-startStop-1][MainServlet:272] com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IllegalArgumentException: interface oracle.sql.ClobDBAccess is not visible from class loader
      com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IllegalArgumentException: interface oracle.sql.ClobDBAccess is not visible from class loader
      	at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:265)
      	at com.liferay.portal.service.persistence.impl.ClassNamePersistenceImpl.findAll(ClassNamePersistenceImpl.java:923)
      	at com.liferay.portal.service.persistence.impl.ClassNamePersistenceImpl.findAll(ClassNamePersistenceImpl.java:831)
      	at com.liferay.portal.service.persistence.impl.ClassNamePersistenceImpl.findAll(ClassNamePersistenceImpl.java:797)
      	at com.liferay.portal.service.impl.ClassNameLocalServiceImpl.checkClassNames(ClassNameLocalServiceImpl.java:57)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:46)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:39)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.cache.thread.local.ThreadLocalCacheAdvice.invoke(ThreadLocalCacheAdvice.java:48)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy62.checkClassNames(Unknown Source)
      	at com.liferay.portal.kernel.service.ClassNameLocalServiceUtil.checkClassNames(ClassNameLocalServiceUtil.java:286)
      	at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:227)
      	at com.liferay.portal.ee.license.StartupAction.doRun(Unknown Source)
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:85)
      	at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1326)
      	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:269)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238)
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151)
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038)
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4997)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:585)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: java.lang.IllegalArgumentException: interface oracle.sql.ClobDBAccess is not visible from class loader
      	at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:33)
      	at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:139)
      	at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:110)
      	at com.liferay.portal.kernel.dao.orm.QueryUtil.list(QueryUtil.java:59)
      	at com.liferay.portal.service.persistence.impl.ClassNamePersistenceImpl.findAll(ClassNamePersistenceImpl.java:904)
      	... 58 more
      Caused by: java.lang.IllegalArgumentException: interface oracle.sql.ClobDBAccess is not visible from class loader
      	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:581)
      	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557)
      	at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230)
      	at java.lang.reflect.WeakCache.get(WeakCache.java:127)
      	at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
      	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
      	at oracle.ucp.jdbc.proxy.ConnectionProxyFactory.createConnectionProxy(ConnectionProxyFactory.java:78)
      	at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:934)
      	at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:873)
      	at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:863)
      	at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:403)
      	at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
      	at com.sun.proxy.$Proxy7.prepareStatement(Unknown Source)
      	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
      	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
      	at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
      	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
      	at org.hibernate.loader.Loader.doQuery(Loader.java:801)
      	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
      	at org.hibernate.loader.Loader.doList(Loader.java:2542)
      	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
      	at org.hibernate.loader.Loader.list(Loader.java:2271)
      	at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:940)
      	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
      	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
      	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
      	at com.liferay.portal.dao.orm.hibernate.QueryImpl.list(QueryImpl.java:127)
      	... 61 more
      

      Master

      Unable to reproduce since Oracle it's not a supported database.

      Branch

      Reproduced on 7.0.x @ commit cbf3bbc49295c89e79158dd46ea13cf85702368f
      Reproduced on 6.2.x @ commit f57e59589f4efce0b384562c6824ef9e0964d83b

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              raven.song Raven Song
              Reporter:
              rodrigo.paulino Rodrigo Paulino
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 51 weeks, 2 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 DXP FP23
                  7.0.X EE
                  7.0.4 CE GA5
                  7.1.0 M1
                  Master