Jump to content
Changes to the Jaspersoft community edition download ×
  • cant find org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory


    jzhou_1
    Problem:
     
    Looks like Jasper references org.apache.tomcat.dbcp.dbcp.* package, instead of org.apache.tomcat.dbcp.dbcp2 as defined in Apache's Tomcat 8 guidelines. Is there something I need to do to workaround this? (cant find org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory)
     
    error below: 
    15-Feb-2016 13:45:16.447 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/Cellar/tomcat/8.0.32/libexec/webapps/ROOT 
    15-Feb-2016 13:45:28.618 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
    org.apache.catalina.LifecycleException: Failed to start component [standardEngine[Catalina].StandardHost[localhost].StandardContext[]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) 
    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.deployDirectory(HostConfig.java:1091) 
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1830) 
    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:745) 
    Caused by: java.lang.NoClassDefFoundError: org/apache/tomcat/dbcp/dbcp/BasicDataSourceFactory 
    at java.lang.ClassLoader.defineClass1(Native Method) 
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760) 
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) 
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2469) 
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:835) 
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1277) 
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1142) 
    at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:61) 
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321) 
    at org.apache.naming.NamingContext.lookup(NamingContext.java:841) 
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152) 
    at org.apache.naming.NamingContext.lookup(NamingContext.java:829) 
    at org.apache.naming.NamingContext.lookup(NamingContext.java:166) 
    at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1084) 
    at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:663) 
    at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:256) 
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95) 
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) 
    ... 10 more 
    Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory 
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308) 
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1142) 
    ... 30 more

     

    Workaround:

    The reference to JSBasicDataSourceFactory extends a library that Tomcat8 no longer supports (see first post)

    Need to update the context.xml from com.jaspersoft.jasperserver.tomcat.jndi.JSBasicDataSourceFactory to com.jaspersoft.jasperserver.tomcat.jndi.JSCommonsBasicDataSourceFactory since that uses org.apache.commons.dbcp.BasicDataSourceFactory, not the tomcat one org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory.

    Here is jasperserver webapp's conf/context.xml resource definition: 

    <Resource name="jdbc/jasperserver" auth="Container" type="javax.sql.DataSource" 
    maxActive="100" maxIdle="30" maxWait="10000" 
    username="postgres" password="postgres" 
    driverClassName="org.postgresql.Driver" 
    accessToUnderlyingConnectionAllowed = "true" 
    validationQuery="SELECT 1" 
    testOnBorrow="true" 
    url="jdbc:postgresql://localhost:5432/jasperserver" 
    factory="com.jaspersoft.jasperserver.tomcat.jndi.JSCommonsBasicDataSourceFactory
    /> 
     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...