I want to get the osm data and put it in a mysql database but the error indicated below is raised by osmosis.
I need the data of an osm file to convert int to matrix then put a depot area and treat user's selected nodes as nodes like graph and i will get the fastest o efficient path to route a vehicle with capacity to get some things in the nodes and if the vehicle is full then it will return to the starting area and unload it's current loads then go back to the remaining nodes to get their loads.
20-Nov-2011 15:42:45 org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskMa
nager waitForCompletion
SEVERE: Thread for task 2-buffer failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to bulk insert re
lation members into the database.
at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushRelationMembers
(ApidbWriter.java:895)
at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.addRelationMembers(A
pidbWriter.java:1229)
at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushRelations(Apidb
Writer.java:829)
at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.complete(ApidbWriter
.java:1044)
at org.openstreetmap.osmosis.core.buffer.v0_6.EntityBuffer.run(EntityBuf
fer.java:77)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Incorrect integer value: 'Way' for column 'mem
ber_type' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:2077)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2362)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2280)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
:2265)
at org.openstreetmap.osmosis.apidb.v0_6.ApidbWriter.flushRelationMembers
(ApidbWriter.java:893)
... 5 more
20-Nov-2011 15:42:45 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)
C:\Users\home\Desktop>
Well, the stacktrace is quite obvious:
Caused by: java.sql.SQLException: Incorrect integer value:
'Way' for column 'member_type' at row 1
You are trying to pass a string "Way" to the integer-column "member_type".
Related
I have been trying to run my project which is a web application that takes excel sheet as input and processes the data. Up until recently the execution was taking place smoothly but only today morning that i am getting the below error,do help
Exception in PoolingDAO ==> insertClass() :
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'item_codes' at row 1
at com.mysql.jdbc.PreparedStatement.executeInternal
at com.mysql.jdbc.PreparedStatement.executeUpdate
at com.mysql.jdbc.PreparedStatement.executeUpdate
at com.Fidoop.DAOFactory.PoolingDAO.insert_to_mbill(PoolingDAO.java:471)
at com.Fidoop.util.GetInvoiceRead.Itemlistread(GetInvoiceRead.java:63)
at com.action.user.UploadFileMaster.doPost(UploadFileMaster.java:291)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
at org.apache.catalina.core.ApplicationFilterChain.doFilter
at org.apache.catalina.core.StandardWrapperValve.invoke
at org.apache.catalina.core.StandardContextValve.invoke
at org.apache.catalina.authenticator.AuthenticatorBase.invoke
at org.apache.catalina.core.StandardHostValve.invoke
at org.apache.catalina.valves.ErrorReportValve.invoke
at org.apache.catalina.valves.AccessLogValve.invoke
at org.apache.catalina.core.StandardEngineValve.invoke
at org.apache.catalina.connector.CoyoteAdapter.service
at org.apache.coyote.http11.AbstractHttp11Processor.process
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3489)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at java.lang.Thread.run(Unknown Source)
NEW CONNECTION CREATED
Vector :[com.mysql.jdbc.JDBC4Connection#75c5a4]
Destroy Connection
Removing Duplicate words:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'item_codes' at row 1
This error is coming from MySQL because whatever you're trying to persist is too large for the given field item_codes. You have several options to mitigate this
field length on that table *
adjust the character length in the spreadsheet
programatically trim the length of the input.
I am trying to read an Access database using UCanAccess.
The code is working but is tremendously slow due to the database being large. As the database rarely changes, I am trying to use the keepMirror suggestion in
Slow initial connection to MS access database; .
connection = DriverManager.getConnection(UcanaccessDriver.URL_PREFIX + databaseFile + ";keepMirror=/some/dir/test/resources/db-mirror/mirror");
On the first run, the application works perfectly and creates the mirror files in the directory above. On subsequent runs, however, I get the following exception:
Exception in thread "main" java.lang.RuntimeException:
net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.6 error in
script file line: 289
/some/dir/test/resources/db-mirror/mirror-783471167 a UNIQUE
constraint already exists on the set of columns in statement [CREATE
CACHED TABLE <TABLE DEF> ON DELETE CASCADE ON UPDATE CASCADE)] at
de.gdfsuezenergie.stromnev.enet.ENETConnector.init(ENETConnector.java:69)
at de.gdfsuezenergie.stromnev.Main.setUp(Main.java:374) at
de.gdfsuezenergie.stromnev.Main.main(Main.java:165) at
de.gdfsuezenergie.stromnev.MainTest.main(MainTest.java:9) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483) at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.6
error in script file line: 289
/some/dir/test/resources/db-mirror/mirror-783471167 a UNIQUE
constraint already exists on the set of columns in statement [CREATE
CACHED TABLE <TABLE DEF> ON DELETE CASCADE ON UPDATE CASCADE)] at
net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:264)
at java.sql.DriverManager.getConnection(DriverManager.java:664) at
java.sql.DriverManager.getConnection(DriverManager.java:270) at
de.gdfsuezenergie.stromnev.enet.ENETConnector.createConnection(ENETConnector.java:86)
at
de.gdfsuezenergie.stromnev.enet.ENETConnector.init(ENETConnector.java:57)
... 8 more Caused by: java.sql.SQLException: error in script file
line: 289 /some/dir/test/resources/db-mirror/mirror-783471167 a UNIQUE
constraint already exists on the set of columns in statement [CREATE
CACHED TABLE <TABLE DEF> ON DELETE CASCADE ON UPDATE CASCADE)] at
org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at
org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) at
org.hsqldb.jdbc.JDBCConnection.(Unknown Source) at
org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source) at
org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source) at
java.sql.DriverManager.getConnection(DriverManager.java:664) at
java.sql.DriverManager.getConnection(DriverManager.java:247) at
net.ucanaccess.jdbc.DBReference.getHSQLDBConnection(DBReference.java:440)
at
net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:231)
... 12 more Caused by: org.hsqldb.HsqlException: error in script file
line: 289 /some/dir/test/resources/db-mirror/mirror-783471167 a UNIQUE
constraint already exists on the set of columns in statement [CREATE
CACHED TABLE <TABLE DEF> ON DELETE CASCADE ON UPDATE CASCADE)] at
org.hsqldb.error.Error.error(Unknown Source) at
org.hsqldb.scriptio.ScriptReaderText.readDDL(Unknown Source) at
org.hsqldb.scriptio.ScriptReaderBase.readAll(Unknown Source) at
org.hsqldb.persist.Log.processScript(Unknown Source) at
org.hsqldb.persist.Log.open(Unknown Source) at
org.hsqldb.persist.Logger.open(Unknown Source) at
org.hsqldb.Database.reopen(Unknown Source) at
org.hsqldb.Database.open(Unknown Source) at
org.hsqldb.DatabaseManager.getDatabase(Unknown Source) at
org.hsqldb.DatabaseManager.newSession(Unknown Source) ... 19 more
Caused by: org.hsqldb.HsqlException: a UNIQUE constraint already
exists on the set of columns at org.hsqldb.error.Error.error(Unknown
Source) at org.hsqldb.error.Error.error(Unknown Source) at
org.hsqldb.ParserTable.addTableConstraintDefinitions(Unknown Source)
at org.hsqldb.StatementSchema.getResult(Unknown Source) at
org.hsqldb.StatementSchema.execute(Unknown Source) at
org.hsqldb.Session.executeCompiledStatement(Unknown Source) ... 28
more
I understand that this is therefore violating some constraint on this cached table, what I don't understand is why it is running this script. I thought the whole point of creating the mirror was that I wouldn't need to reapply any scripts?
Does someone know how to read the mirror properly?
Note: <TABLE DEF> => I haves skipped the table definition for brevity.
This issue is known to occur when a table in the Access database has more than one unique index defined for a given column, e.g., a Primary Key index (Primary=Yes, Unique=Yes) and another separate Unique index (Primary=No, Unique=Yes).
Access itself does not have any problem with this, but HSQLDB (which UCanAccess uses for its backing database) does not permit more than one unique constraint on a set of columns.
The best solution is to open the .accdb or .mdb database in Access and remove the redundant non-Primary unique index.
I managed to get it to work but it's a bit hacky. Basically by removing the Unique Constraints from the mirror script it finally managed to get through. Sadly I don't have knowledge of the data, so need to work out if its still correct, but I believe it is.
Thanks for the pointers everyone! Very much appreciated.
I have an application which manipulates the rows of a google spreadsheet. Occasionally, when I call ListEntry.update(), I receive the following stack trace:
Exception in thread "main" java.lang.reflect.InvocationTargetException
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.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: com.google.gdata.util.PreconditionFailedException: Precondition Failed
Mismatch: etags = ["E10QemAgYit7ImA-CEFaShYM"], version = [2ag9hk74om621l]
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:614)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.Service.update(Service.java:1563)
at com.google.gdata.client.Service.update(Service.java:1530)
at com.google.gdata.client.GoogleService.update(GoogleService.java:597)
at com.google.gdata.data.BaseEntry.update(BaseEntry.java:639)
at feedProcessor.ProcessClientFeed.UpdateRow(ProcessClientFeed.java:466)
at feedProcessor.ProcessClientFeed.updateGoogleSpreadsheet(ProcessClientFeed.java:404)
at feedProcessor.ProcessClientFeed.processFeed(ProcessClientFeed.java:318)
at feedProcessor.ProcessClientFeed.main(ProcessClientFeed.java:61)
... 5 more
Here is the relevant documentation:
https://developers.google.com/gdata/javadoc/com/google/gdata/data/spreadsheet/ListEntry
https://developers.google.com/gdata/javadoc/com/google/gdata/data/BaseEntry#update()
According to these docs, the update() function is not even capable of throwing a PreconditionFailedException, so the docs are essentially useless here. Testing the issue has shown that this exception is thrown when you try to call the update() function on the same row more than once in a session. Exactly what defines a 'session' is still unclear, but if you loop through all your rows more than once, and call update() on each row in each iteration, you will get this error. The only resolution I am aware of is to write your software such that each row (ListEntry) has update() called only once.
The problem is caused by Google Spreadsheet API Resource Versioning mecanism.
To be able to edit the entry no matter what - just use:
entry.setEtag("*")
before update.
And yes, this is not multi-user friendly. Refetch the feed if you need multi-user support.
I am building a project which uses Gora-hbase as backend .
Hbase is up and running . I am not using maven or ivy .
Also i have specified the following in /conf/gora.properties :
gora.datastore.default=org.apache.gora.hbase.store.HBaseStore
gora.datastore.autocreateschema=true
In my code, i am using the following piece of code to start a datastore :
datastore =
DataStoreFactory.getDataStore(long.class,UserDetails.class,new
Configuration());
I am getting the following exception at the above line :
13/02/04 23:02:26 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13ca8d9ecac000c, negotiated timeout = 40000
org.apache.gora.util.GoraException: java.lang.RuntimeException: java.net.MalformedURLException
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:167)
at org.apache.gora.store.DataStoreFactory.getDataStore(DataStoreFactory.java:278)
at com.psl.gora.java.model.TestClass.init(TestClass.java:34)
at com.psl.gora.java.model.TestClass.<init>(TestClass.java:23)
at com.psl.gora.java.model.TestClass.main(TestClass.java:47)
Caused by: java.lang.RuntimeException: java.net.MalformedURLException
at org.apache.gora.hbase.store.HBaseStore.initialize(HBaseStore.java:125)
at org.apache.gora.store.DataStoreFactory.initializeDataStore(DataStoreFactory.java:102)
at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:161)
... 4 more
Caused by: java.net.MalformedURLException
at java.net.URL.<init>(URL.java:617)
at java.net.URL.<init>(URL.java:480)
at java.net.URL.<init>(URL.java:429)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:453)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:770)
at org.apache.gora.hbase.store.HBaseStore.readMapping(HBaseStore.java:524)
at org.apache.gora.hbase.store.HBaseStore.initialize(HBaseStore.java:111)
... 6 more
Caused by: java.lang.NullPointerException
at java.net.URL.<init>(URL.java:522)
... 19 more
Is there anything I am missing or am not aware of?
Any help or suggestion appreciated.
When this stacktrace is shown, probably is because gora-hbase-mapping.xml is missing.
This question is from months ago, but if other person has the same problem, maybe this would help.
From HBaseStore:524 is being called builder.build(null) and results are like in http://www.eclipse.org/forums/index.php/t/262714/
---- Other possibility ----
Try as key class String.class and check if it works. (Just checking...)
I'm using play framework for my application
In my application.conf i have given
jvm.memory=-Xmx512M -Xms512M -XX:-UseGCOverheadLimit
I have a function which will be executed for every Customer and for customers each microapp
This function will return records for that customer and for that microapp from DB.
if i run for all customer I'm getting InvocationTargetException for 16th customer.(For 15 customers it ran successfully).
The error is
12:38:30,153 ERROR ~
Execution exception
InvocationTargetException occured : null
play.exceptions.JavaExecutionException
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:230)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.reflect.InvocationTargetException
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:543)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:499)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:475)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:470)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158)
... 1 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.StringValue.from(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at com.mysql.jdbc.SingleByteCharsetConverter.toString(SingleByteCharsetConverter.java:327)
at com.mysql.jdbc.ResultSetRow.getString(ResultSetRow.java:787)
at com.mysql.jdbc.BufferRow.getString(BufferRow.java:539)
at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5571)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5448)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5488)
at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2.doExtract(VarcharTypeDescriptor.java:61)
at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:249)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:229)
at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:330)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2283)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
at org.hibernate.loader.Loader.getRow(Loader.java:1355)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
at org.hibernate.loader.Loader.doQuery(Loader.java:829)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
I found there is something error with that customer . so i run for that customer alone. I'm getting
Exception in thread "Timer-0" java.lang.OutOfMemoryError: Java heap space
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
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 com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:633)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Exception in thread "pool-2-thread-1" java.lang.OutOfMemoryError: Java heap space
For this microapp( Error occuring ) alone i have 421,251 records
What could be the source of error. Please help me.
Your problem is an OutOfMemory error. It happens later when you increase the ram for that reason.
You did not provide any code sample, but I assume you are trying to load into memory too much data from your clients with only one query. That comment about having 421k records kind of confirms this (unless I misunderstood).
Instead of doing a find() (or select, or the cal you are doing) to retrieve all the records, try to retrieve records in batches (100, 200) and process them that way.