Total Pageviews

2010/12/24

java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.path

Scenario
As I run SchemaSpy and use this command line:
java -jar "C:\schemaSpy_5.0.0.jar" -dp "C:\ojdbc6.jar" -t ora -db dev02 -s ap_tax -host 192.168.30.102 -port 1521 -u ap_tax -p taxtest -schemas AP_TAX -connprops "C:\schemaSpyGUI\properties\ora.properties" -charset UTF-8 -o "C:\schemaSpyGUI\output" -norows -hq

I got this error message:
 Failed to load driver [oracle.jdbc.driver.OracleDriver] from classpath [file:/C:/ojdbc6.jar]  
 Make sure the reported library (.dll/.lib/.so) from the following line can be  
 found by your PATH (or LIB*PATH) environment variable  
 java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.path  
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)  
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)  
 at java.lang.System.loadLibrary(System.java:1028)  
 at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3535)  
 at java.security.AccessController.doPrivileged(Native Method)  
 at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3531)  
 at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:266)  
 at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:536)  
 at oracle.jdbc.driver.T2CConnection.(T2CConnection.java:162)  
 at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)  
 at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)  
 at net.sourceforge.schemaspy.SchemaAnalyzer.getConnection(SchemaAnalyzer.java:582)  
 at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:157)  
 at net.sourceforge.schemaspy.Main.main(Main.java:42) 

Root Cause
I assign wrong database type and connection property in command line.

Solution
Change database type from ora to orathin:
java -jar "C:\schemaSpy_5.0.0.jar" -dp "C:\ojdbc6.jar" -t orathin -db dev02 -s ap_tax -host 192.168.30.102 -port 1521 -u ap_tax -p taxtest -schemas AP_TAX -connprops "C:\schemaSpyGUI\properties\orathin.properties" -charset UTF-8 -o "C:\schemaSpyGUI\output" -norows -hq

2 comments:

Avner Cohen said...

You are the man !

It solved my problem, thanks!

Tripti said...

Thanks!!! This was really helpful.