[OSM-dev] Osmosis: Unable to find database driver

Max Power herodot72 at yahoo.de
Wed Nov 14 09:48:28 GMT 2007


OK, here is what i did.

CLASSPATH=C:\Downloads\MySQL5.0.45\mysql-connector-java-5.1.5\mysql-connector-java-5.1.5-bin.jar
CMD-Line: 
java -jar osmosis.jar --read-xml file="../planet.osm.bz2" --write-mysql host="localhost" database="osm" user="osmuser" password="osm"

stack trace:
14.11.2007 10:18:55 com.bretth.osmosis.core.Osmosis main
INFO: Osmosis Version 0.22
14.11.2007 10:18:55 com.bretth.osmosis.core.Osmosis main
INFO: Preparing pipeline.
14.11.2007 10:18:55 com.bretth.osmosis.core.Osmosis main
INFO: Launching pipeline execution.
14.11.2007 10:18:55 com.bretth.osmosis.core.Osmosis main
INFO: Pipeline executing, waiting for completion.
Exception in thread "Thread-1-read-xml" com.bretth.osmosis.core.OsmosisRuntimeEx
ception: Unable to find database driver.
        at com.bretth.osmosis.core.mysql.common.DatabaseContext.loadDatabaseDriv
er(DatabaseContext.java:58)
        at com.bretth.osmosis.core.mysql.common.DatabaseContext.getConnection(Da
tabaseContext.java:77)
        at com.bretth.osmosis.core.mysql.common.DatabaseContext.executeStreaming
Query(DatabaseContext.java:197)
        at com.bretth.osmosis.core.mysql.common.SchemaVersionValidator.validateD
BVersion(SchemaVersionValidator.java:62)
        at com.bretth.osmosis.core.mysql.common.SchemaVersionValidator.validateV
ersion(SchemaVersionValidator.java:44)
        at com.bretth.osmosis.core.mysql.v0_5.MysqlWriter.initialize(MysqlWriter
.java:316)
        at com.bretth.osmosis.core.mysql.v0_5.MysqlWriter.process(MysqlWriter.ja
va:1004)
        at com.bretth.osmosis.core.xml.v0_5.impl.NodeElementProcessor.end(NodeEl
ementProcessor.java:99)
        at com.bretth.osmosis.core.xml.v0_5.impl.OsmHandler.endElement(OsmHandle
r.java:108)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
nt(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanEndElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U
nknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at com.bretth.osmosis.core.xml.v0_5.XmlReader.run(XmlReader.java:101)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at com.bretth.osmosis.core.mysql.common.DatabaseContext.loadDatabaseDriv
er(DatabaseContext.java:55)
        ... 22 more
14.11.2007 10:18:56 com.bretth.osmosis.core.Osmosis main
INFO: Pipeline complete.

Brett Henderson <brett at bretth.com> schrieb: Frederik Ramm wrote:
> Hi,
>
>   
>>    I tried to import the planet.osm file with osmosis but get only the error
>>    message : Unable to find database driver.
>>    I installed MySQL5.0.45 and mysql-connector-java-5.1.5 under Windows XP
>>    and set the CLASSPATH environment variable to the connector path.
>>     
>
> This may be stating the obvious but are you sure you actually included
> the full path name of the connector .jar file in your classpath (as
> opposed to just adding the directory the jar file is in)? Other than
> that I have no idea what could be wrong.
>
> Bye
> Frederik
>
>   
I don't know either.  Can you provide your full command line, the full 
error message (with stack trace) and CLASSPATH?

Brett


_______________________________________________
dev mailing list
dev at openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev


       
---------------------------------
Ihr erstes Fernweh? Wo gibt es den schönsten Strand. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20071114/263bbb79/attachment.html>


More information about the dev mailing list