osmosis / postGis setup problem

Hello!
i am having problem’s with the osmosis / postGis:
http://wiki.openstreetmap.org/wiki/Osmosis/PostGIS_Setup
i think i succeded in everything up until the actual import into the database (i ran it on windows)
but when i try to:

/home/disk2/OSM/osmosis/trunk/bin/osmosis --read-xml file=“/home/disk2/OSM/OSM/uk-090610.osm.bz2” --write-pgsql user=“” database=“osm” password=“osm”

i get:

10/07/2011 20:42:59 org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.39
10/07/2011 20:42:59 org.java.plugin.registry.xml.ManifestParser
INFO: got SAX parser factory - org.apache.xerces.jaxp.SAXParserFactoryImpl@360be
0
10/07/2011 20:42:59 org.java.plugin.registry.xml.PluginRegistryImpl configure
INFO: configured, stopOnError=false, isValidating=true
10/07/2011 20:43:00 org.java.plugin.registry.xml.PluginRegistryImpl register
INFO: plug-in and fragment descriptors registered - 1
10/07/2011 20:43:00 org.java.plugin.standard.StandardPluginManager activatePlugi
n
INFO: plug-in started - org.openstreetmap.osmosis.core.plugin.Core@0.39.0
10/07/2011 20:43:00 org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
10/07/2011 20:43:00 org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
10/07/2011 20:43:00 org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
10/07/2011 20:51:04 org.springframework.beans.factory.xml.XmlBeanDefinitionReade
r loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [org/springframework
/jdbc/support/sql-error-codes.xml]
10/07/2011 20:51:04 org.springframework.jdbc.support.SQLErrorCodesFactory

INFO: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Orac
le, PostgreSQL, Sybase]
10/07/2011 20:51:04 org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskMan
ager waitForCompletion
SEVERE: Thread for task 1-read-xml failed
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL gram
mar [DROP INDEX idx_nodes_geom]; nested exception is org.postgresql.util.PSQLExc
eption: ERROR: index “idx_nodes_geom” does not exist
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTra
nslate(SQLStateSQLExceptionTranslator.java:98)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslat
or.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslat
or.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslat
or.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:
406)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:5
18)
at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(Simple
JdbcTemplate.java:248)
at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.IndexManager.prepareFo
rLoad(IndexManager.java:103)
at org.openstreetmap.osmosis.pgsnapshot.v0_6.impl.CopyFilesetLoader.run(
CopyFilesetLoader.java:92)
at org.openstreetmap.osmosis.pgsnapshot.v0_6.PostgreSqlCopyWriter.comple
te(PostgreSqlCopyWriter.java:108)
at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:110)
at java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: ERROR: index “idx_nodes_geom” does
not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryEx
ecutorImpl.java:2062)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutor
Impl.java:1795)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.ja
va:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stat
ement.java:479)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(Abstract
Jdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdb
c2Statement.java:299)
at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingS
tatement.java:228)
at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingS
tatement.java:228)
at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.d
oInStatement(JdbcTemplate.java:508)
at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.d
oInStatement(JdbcTemplate.java:1)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:
395)
… 7 more
10/07/2011 20:51:04 org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed
.
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForComple
tion(Pipeline.java:146)
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Laun
cher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:31)

i am guessing that this:

SEVERE: Thread for task 1-read-xml failed
org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL gram
mar [DROP INDEX idx_nodes_geom]; nested exception is org.postgresql.util.PSQLExc
eption: ERROR: index “idx_nodes_geom” does not exist

is the problem

can anybody point to the problem?i tried it on another file and got the same… so i assume the problem wasn’t in the .osm file i used

thanks in advance!!
Omri

problem solved!
i forgot to run the spatial_ref_sys script :slight_smile:
thanks anyway

I experienced the same issue when I tried to import to the database. I appreciate your thread, because it appear that I made the very same error that you made. Your thread has been extremely helpful in figuring this out, I really appreciate it! I really needed to get this set up right, because I will be beginning my new job as a new jersey mover in a few days, and openstreetmap will be very helpful to me as I will be required to do a lot of driving, and I am not really all that familiar with the Jersey roads. Now I have everything all set up, and it seems to be functioning properly. thank you very much!