Hi,

I'm using Maven 1.1.  I'm writing unit tests for a console application but
I'm having trouble connecting to the Oracle database, due to
"java.sql.SQLException: No suitable driver".  Google has told me in so many
words that this is a classpath issue.  I tried adding this line in my JUnit
setUp method:

System.setProperty("java.library.path", "/opt/oracle/lib");

because /opt/oracle/lib contains my classes12.jar file.  But no luck.  Any
ideas how to get this class file into my classpath?  (complete stack trace
of error is below).  Thanks, - Dave


org.hibernate.exception.JDBCConnectionException: Cannot open connection
        at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
        at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
        at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
        at
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
        at
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
        at
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
        at org.hibernate.loader.Loader.doQuery(Loader.java:696)
        at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
        at org.hibernate.loader.Loader.doList(Loader.java:2228)
        at
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
        at org.hibernate.loader.Loader.list(Loader.java:2120)
        at
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
        at
org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328)
        at
myco.dor.dmv.driver.youthful.database.YouthfulDriverDatabase.getVendorRequestFileDigestCount(YouthfulDriverDatabase.java:125)
        at
myco.dor.dmv.driver.youthful.test.AddressFileUtilityTest.testLookupNoPersist(AddressFileUtilityTest.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:1072)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:682)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1434)
        at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:632)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:195)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
        at
org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
        at
org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at
org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
        at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:42)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250)
        at
org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at
org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:83)
        at
org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:116)
        at org.apache.maven.werkz.Goal.fire(Goal.java:691)
        at org.apache.maven.werkz.Goal.attain(Goal.java:623)
        at
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:712)
        at org.apache.maven.MavenSession.attainGoals(MavenSession.java:265)
        at org.apache.maven.cli.App.doMain(App.java:307)
        at org.apache.maven.cli.App.main(App.java:217)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)
Caused by: java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:545)
        at java.sql.DriverManager.getConnection(DriverManager.java:140)
        at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
        at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
        ... 61 more


-- 
View this message in context: 
http://www.nabble.com/What-dependency-do-I-need-to-include--tp26014210p26014210.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to