com.servoy.j2db.dataprocessing.DataException: Table 'consign_cart.xcart_images_t' doesn't exist
at com.servoy.j2db.dblayer.DBDependentHandler.Za(DBDependentHandler.java:207)
at com.servoy.j2db.persistence.Server.translateSQLException(Server.java:239)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(SQLEngine.java:682)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(SQLEngine.java:401)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(SQLEngine.java:143)
at com.servoy.j2db.dataprocessing.Zgb.performQuery(Zgb.java:28)
at com.servoy.j2db.dataprocessing.RelatedFoundSet.createRelatedFoundSets(RelatedFoundSet.java:307)
at com.servoy.j2db.dataprocessing.Zrb.Za(Zrb.java:571)
at com.servoy.j2db.dataprocessing.FoundSet.getRelatedFoundSet(FoundSet.java:369)
at com.servoy.j2db.dataprocessing.Record.getRelatedFoundSet(Record.java:188)
at com.servoy.j2db.dataprocessing.Record.getValue(Record.java:161)
at com.servoy.j2db.dataprocessing.FoundSet.get(FoundSet.java:475)
at com.servoy.j2db.dataprocessing.RelatedFoundSet.get(RelatedFoundSet.java:267)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1641)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1429)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1418)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3343)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3125)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:66)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:83)
at com.servoy.j2db.FormManager.Za(FormManager.java:498)
at com.servoy.j2db.Zjb.run(Zjb.java:1)
at com.servoy.j2db.server.headlessclient.SessionClient.invokeLater(SessionClient.java:80)
at com.servoy.j2db.FormManager.propertyChange(FormManager.java:324)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at com.servoy.j2db.J2DBGlobals.firePropertyChange(J2DBGlobals.java:29)
at com.servoy.j2db.server.headlessclient.SessionClient.Za(SessionClient.java:35)
at com.servoy.j2db.ClientState.handleLoadedSolution(ClientState.java:402)
at com.servoy.j2db.server.headlessclient.SessionClient.Za(SessionClient.java:389)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:3)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:7)
at com.servoy.j2db.server.Zi.Zf(Zi.java:30)
at com.servoy.j2db.server.Zh.run(Zh.java:2)
at java.lang.Thread.run(Thread.java:619)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'consign_cart.xcart_images_t' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1031)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1888)
at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.servoy.j2db.persistence.datasource.Ze.invoke(Ze.java:5)
at $Proxy1.executeQuery(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at com.servoy.j2db.dataprocessing.SQLEngine.performSelect(SQLEngine.java:487)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(SQLEngine.java:414)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(SQLEngine.java:401)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(SQLEngine.java:143)
at com.servoy.j2db.dataprocessing.Zgb.performQuery(Zgb.java:28)
at com.servoy.j2db.dataprocessing.RelatedFoundSet.createRelatedFoundSets(RelatedFoundSet.java:307)
at com.servoy.j2db.dataprocessing.Zrb.Za(Zrb.java:571)
at com.servoy.j2db.dataprocessing.FoundSet.getRelatedFoundSet(FoundSet.java:369)
at com.servoy.j2db.dataprocessing.Record.getRelatedFoundSet(Record.java:188)
at com.servoy.j2db.dataprocessing.Record.getValue(Record.java:161)
at com.servoy.j2db.dataprocessing.FoundSet.get(FoundSet.java:475)
at com.servoy.j2db.dataprocessing.RelatedFoundSet.get(RelatedFoundSet.java:267)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1641)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1429)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1418)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3343)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3125)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:66)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:83)
at com.servoy.j2db.FormManager.Za(FormManager.java:498)
at com.servoy.j2db.Zjb.run(Zjb.java:1)
at com.servoy.j2db.server.headlessclient.SessionClient.invokeLater(SessionClient.java:80)
at com.servoy.j2db.FormManager.propertyChange(FormManager.java:324)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at com.servoy.j2db.J2DBGlobals.firePropertyChange(J2DBGlobals.java:29)
at com.servoy.j2db.server.headlessclient.SessionClient.Za(SessionClient.java:35)
at com.servoy.j2db.ClientState.handleLoadedSolution(ClientState.java:402)
at com.servoy.j2db.server.headlessclient.SessionClient.Za(SessionClient.java:389)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:3)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:7)
at com.servoy.j2db.server.Zi.Zf(Zi.java:30)
at com.servoy.j2db.server.Zh.run(Zh.java:2)
at java.lang.Thread.run(Thread.java:619)
Ok, I see… I was able to get the same error in Navicat.
This is the query:
select imageid, id, 1 as image_SV_BLOB_M, image_path, image_type, image_x, image_y, image_size, filename, `date`, alt, avail, orderby, md5 from xcart_images_t where id = 1 order by imageid asc limit 100
I have no idea why it would fail tho… still stumped. The versions of MySQL are slightly different, that’s about it. 5.089 (failing db) and 5.022 (non-failing)
This query is triggered by a relationship in Servoy… which I don’t control the code. Any ideas?
When I make a server in Servoy Developer and point it to the xcart database, it creates the tables in servoy but does it all in lower case. So the names are:
When Servoy uses tables from an existing database, we remember the table and column names as reported by the database (including casing).
What you see in Servoy Developer is not the sql-name of the column/table but the name we use internally and in scripting, this is always in lowercase and with some special characters replaced with underscore.
When querying the db, the sql name is always used.
I don’t think casing is the issue here, but you can test this by a simple query ‘select * from xcart_images_T’ in both databases.
Thanks Rob… that’s what I thought, because we have an earlier deployment that is working just fine.
We’re wondering that during some phase of setup, we tried overwriting the casing to get upper to show up in servoy… not knowing what you’ve told me just now.
The thing is the error still happens, and if I take the query that is failing and run it in another tool, I can get it to work by changing the query to use xcart_images_T instead of xcart_images_t… and then it works.
So, on the deployment that is working, the lower_case_table_names is set at 2.
So, I was excited to go check the global_variables in the information_schema for my production server and low and behold, the table that holds this setting does not exist! (see picture)
The server gods are playing with me!
I suppose I could create the tables… but I wonder why it wouldn’t have been created at setup. (I know this isn’t a Servoy issue.)
Update… these errors were a bug… the real error was that the specific settings cannot be changed dynamically and must be changed at startup of the MySQL server.
So the saga continues. So I want to go back to how Servoy stores table names.
We design our solution on a mac. All of our servers are Linux (Cent OS)
The table names we have a problem with have uppercase letters in the name. Servoy displays them as lower case but as Rob says, Servoy remembers the case.
We export out of Servoy Developer and then import on our Linux Server.
When we run the method on the server, on the tables where they really have a capital letter, we get the error that the table can’t be found.
So my questions is WHERE is servoy saving the case information? Is it a spot where we can check and/or update issues if we seem them?
This is not saved anywhere in files or repository.
When Servoy starts up it will look for the table names and column names and use the name as reported by the driver.
So if the driver reports table TesT Servoy creates a table test(TesT) and will use test in scripting and TesT in sql.
In case of switch_server, Servoy only does the discovering in the original server and assumes that the other servers have an identical datamodel.
So, developing against a database that has different casing than your production database should not be a problem.
Using switch_server from one server to another that has different casing is a problem.
I fear that I’ve tried so many things that I’m going crazy.
So, last night, I moved the target databaser (server) to the same server as the original database.
I dropped the original db, then recreated it.
I then did a sql dump of the structure from the target db.
I then used that to create all the fields in the original db.
I then configured our appserver properly … meaning both servers resided on the same db server.
I also restarted the app server several times to make sure that we had a fresh setup.
I expected sucesss. I got the same error.
For the servoy solution in question, I also deleted it from the server and reimported it.
I think today, the client who’s waiting for this is going to hurt me. (just a joke!)