Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'

1

I'm trying to configure the iReport preview with JRDataSourceProvider, but despite the fact of including ojdbc6-11.1.0.7.0.jar in both iReport classpath and in \\Jaspersoft\\iReport-4.0.0\\ide10\\modules\\ext I'm still getting the oracle driver not found exception.

Does anybody know what coud be happening:

iReport Console: 

Error filling print... 

java.lang.ExceptionInInitializerError java.lang.RuntimeException: 

org.springframework.jdbc.CannotGetJdbcConnectionException: 

Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: 

Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'

 

Thanks.

drsaturno's picture
Joined: Aug 17 2009 - 2:11pm
Last seen: 2 years 11 months ago

1 Answer:

-1

 

The only and ugly workaround I've found was to put ojdbc6-11.1.0.7.0.jar into the Java jre/lib/ext directory

Stack Trace:

Compiling to file... C:\\amplis\\workspace\\YMF-AMPLIS-WEB\\src\\main\\resources\\br\\com\\ymf\\amplis\\patrimonio\\relatorios\\PTR_49005.jasper
16:42:43,762 [tProcessor] WARN  net.sf.jasperreports.engine.component.ComponentsEnvironment [] - Found two components for namespace http://jasperreports.sourceforge.net/jasperreports/components
Compilation running time: 8.875!
Setting net.sf.jasperreports.engine.query.JRJdbcQueryExecuterFactory as Query Executer Factory for language: sql
  Filling report...
  Locale: português (Brasil)
  Time zone: Default
Error filling print... java.lang.ExceptionInInitializerError java.lang.RuntimeException: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
net.sf.jasperreports.engine.JRRuntimeException: java.lang.ClassNotFoundException: br.com.ymf.amplis.fixedincome.assetholding.model.EvaluationSituationEnum      at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:147)      at com.jaspersoft.ireport.designer.compiler.prompt.Prompter$1.run(Prompter.java:202)      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)      at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)     
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)     
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 
Caused by: java.lang.ClassNotFoundException: br.com.ymf.amplis.fixedincome.assetholding.model.EvaluationSituationEnum      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)      at java.security.AccessController.doPrivileged(Native Method)      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:252)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at java.lang.Class.forName0(Native Method)      at java.lang.Class.forName(Class.java:247)      at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:175)      at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)      at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:143)      ... 10 more  java.lang.reflect.InvocationTargetException      at java.awt.EventQueue.invokeAndWait(EventQueue.java:998)      at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1320)      at com.jaspersoft.ireport.designer.compiler.prompt.Prompter.promptForParameters(Prompter.java:263)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:706)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 
Caused by: net.sf.jasperreports.engine.JRRuntimeException: java.lang.ClassNotFoundException: br.com.ymf.amplis.fixedincome.assetholding.model.EvaluationSituationEnum      at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:147)      at com.jaspersoft.ireport.designer.IReportManager.setLastParameterValue(IReportManager.java:1565)      at com.jaspersoft.ireport.designer.compiler.prompt.Prompter$1.run(Prompter.java:248)      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)      at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 
Caused by: java.lang.ClassNotFoundException: br.com.ymf.amplis.fixedincome.assetholding.model.EvaluationSituationEnum      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)      at java.security.AccessController.doPrivileged(Native Method)      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:252)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at java.lang.Class.forName0(Native Method)      at java.lang.Class.forName(Class.java:247)      at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:175)      at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)      at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:143)      ... 11 more  Erro inicializando log do amplis  org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'      at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)      at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:357)      at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:433)      at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:441)      at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:449)      at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:454)      at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForObject(SimpleJdbcTemplate.java:151)      at br.com.ymf.amplis.base.util.log.AmplisLog.getLogFileName(AmplisLog.java:52)      at br.com.ymf.amplis.base.util.log.AmplisLog4j.Log4jSetup(AmplisLog4j.java:58)      at br.com.ymf.amplis.base.util.log.AmplisLog4j.init(AmplisLog4j.java:41)      at br.com.ymf.amplis.base.util.log.AmplisLog$LazyInstanceHolder.<clinit>(AmplisLog.java:27)      at br.com.ymf.amplis.base.util.log.AmplisLog.of(AmplisLog.java:37)      at br.com.ymf.amplis.base.util.AmplisApplicationContext.<clinit>(AmplisApplicationContext.java:39)      at br.com.ymf.amplis.patrimonio.relatorios.BeansDataSource.init(BeansDataSource.java:36)      at br.com.ymf.amplis.patrimonio.relatorios.BeansDataSource.<init>(BeansDataSource.java:31)      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)      at java.lang.Class.newInstance0(Class.java:355)      at java.lang.Class.newInstance(Class.java:308)      at com.jaspersoft.ireport.designer.connection.JRDataSourceProviderConnection.getDataSourceProvider(JRDataSourceProviderConnection.java:60)      at com.jaspersoft.ireport.designer.connection.JRDataSourceProviderConnection.getJRDataSource(JRDataSourceProviderConnection.java:113)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:898)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'      at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)      at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)      at br.com.ymf.amplis.base.hibernate.connection.TestConnectionProvider.getConnection(TestConnectionProvider.java:59)      at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)      at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)      ... 25 more 
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver     
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)      at java.security.AccessController.doPrivileged(Native Method)      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:252)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at java.lang.Class.forName0(Native Method)      at java.lang.Class.forName(Class.java:169)      at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)      ... 29 more  java.lang.ExceptionInInitializerError      at br.com.ymf.amplis.base.util.log.AmplisLog.of(AmplisLog.java:37)      at br.com.ymf.amplis.base.util.AmplisApplicationContext.<clinit>(AmplisApplicationContext.java:39)      at br.com.ymf.amplis.patrimonio.relatorios.BeansDataSource.init(BeansDataSource.java:36)      at br.com.ymf.amplis.patrimonio.relatorios.BeansDataSource.<init>(BeansDataSource.java:31)      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)      at java.lang.Class.newInstance0(Class.java:355)      at java.lang.Class.newInstance(Class.java:308)      at com.jaspersoft.ireport.designer.connection.JRDataSourceProviderConnection.getDataSourceProvider(JRDataSourceProviderConnection.java:60)      at com.jaspersoft.ireport.designer.connection.JRDataSourceProviderConnection.getJRDataSource(JRDataSourceProviderConnection.java:113)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:898)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 
Caused by: java.lang.RuntimeException: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'      at br.com.ymf.amplis.base.util.log.AmplisLog$LazyInstanceHolder.<clinit>(AmplisLog.java:31)      ... 15 more  Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'      at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)      at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:357)      at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:433)      at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:441)      at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:449)      at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:454)      at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForObject(SimpleJdbcTemplate.java:151)      at br.com.ymf.amplis.base.util.log.AmplisLog.getLogFileName(AmplisLog.java:52)      at br.com.ymf.amplis.base.util.log.AmplisLog4j.Log4jSetup(AmplisLog4j.java:58)      at br.com.ymf.amplis.base.util.log.AmplisLog4j.init(AmplisLog4j.java:41)      at br.com.ymf.amplis.base.util.log.AmplisLog$LazyInstanceHolder.<clinit>(AmplisLog.java:27)      ... 15 more 
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'      at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)      at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)      at br.com.ymf.amplis.base.hibernate.connection.TestConnectionProvider.getConnection(TestConnectionProvider.java:59)      at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)      at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)     
 ... 25 more 
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver     
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)      at java.security.AccessController.doPrivileged(Native Method)      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:252)      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)      at java.lang.Class.forName0(Native Method)      at java.lang.Class.forName(Class.java:169)      at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)      ... 29 more 
Print not filled. Try to use an EmptyDataSource...
 
 

drsaturno's picture
Joined: Aug 17 2009 - 2:11pm
Last seen: 2 years 11 months ago
Feedback