Re: Unknown column
Re: Unknown column
- Subject: Re: Unknown column
- From: Ângelo Andrade Cirino <email@hidden>
- Date: Thu, 13 Sep 2012 17:32:32 -0300
Hi Pascal,
The databases are the same, as can be seen from the logs of a working app and the failed one:
Set 13 16:47:37 Visiontur1.0[60001] DEBUG NSLog - connecting with dictionary: {plugin = "MySQLPlugIn"; username = "aacirino"; driver = "com.mysql.jdbc.Driver"; password = "<password deleted for log>"; URL = "jdbc:mysql://127.0.0.1/visionturTestes"; }
13 Set 17:29:59 vtta[60002] DEBUG NSLog - connecting with dictionary: {plugin = "MySQLPlugIn"; username = "aacirino"; driver = "com.mysql.jdbc.Driver"; password = "<password deleted for log>"; URL = "jdbc:mysql://127.0.0.1/visionturTestes"; }
Angelo
Em 13/09/2012, às 17:23, Pascal Robert escreveu:
> Are you sure you are connecting to the same database as the two applications that works?
>
>> Hi all,
>>
>> What can cause this error?
>>
>> 13 Set 16:21:50 vtta[60002] DEBUG NSLog - === Begin Internal Transaction
>> 13 Set 16:21:50 vtta[60002] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor._MySQLPlugIn$MySQLExpression: "SELECT t0.agência_id, RTRIM(t0.descrição), RTRIM(t0.domínio), t0.entidade_id, t0.imagem_grande_altura, t0.imagem_grande_largura, t0.imagem_pequena_altura, t0.imagem_pequena_largura, t0.logomarca_id, t0.miniatura_altura, t0.miniatura_largura, t0.número_pacotes_principais, t0.parteID, t0.situação, t0.temaID, RTRIM(t0.título_páginas), RTRIM(t0.título_site) FROM agência t0 WHERE t0.agência_id = ?" withBindings: 1:1(agênciaID)>
>> 13 Set 16:21:50 vtta[60002] DEBUG NSLog - === Rollback Internal Transaction
>> 13 Set 16:21:50 vtta[60002] INFO er.transaction.adaptor.Exceptions - Database Exception occured: Unknown column 't0.logomarca_id' in 'field list'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:411)
>> at com.mysql.jdbc.Util.getInstance(Util.java:386)
>> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
>> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
>> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
>> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
>> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
>> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
>> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
>> at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1379)
>> at com.webobjects.jdbcadaptor.JDBCChannel._bindInputVariablesWithBindingsAndExecute(JDBCChannel.java:265)
>> at com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.java:337)
>> at com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.java:296)
>> at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java:220)
>> at com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationEditingContext(EODatabaseChannel.java:897)
>> at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecification(EODatabaseChannel.java:234)
>> at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3055)
>> at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
>> at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
>> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
>> at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1306)
>> at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
>> at com.visionar.modelos._Agência.fetchAgênciaPorID(_Agência.java:879)
>> at vtta.app.Application.<init>(Application.java:48)
>> 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 java.lang.Class.newInstance0(Class.java:355)
>> at java.lang.Class.newInstance(Class.java:308)
>> at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
>> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826)
>> at vtta.app.Application.main(Application.java:31)
>>
>> This logomarcaID is the foreign key for an ERAttachment relationship. I assure you that the table has the column and that the model is correct. The generated class file correctly implements the logomarcaID field and the getter and setter methods. The generated migration class correctly creates the logomarca_id table column. Finally, I have two other applications using the very same model (the model is kept in a framework) that do work and do not show this error.
>>
>> It occurs when I try to fetch an entity at the beginning of the application, it is the first fetch. I tried with a fetch specification I created and with a EOUtilities fetch and the outcome is the same. These are the two methods:
>>
>> @Override
>> public void finishInitialization() {
>> super.finishInitialization();
>>
>> //agência = Agência.fetchAgênciaPorID(editingContext(), agênciaID).objectAtIndex(0);
>> agência = (Agência) EOUtilities.objectsMatchingKeyAndValue(editingContext(), "Agência", "agênciaID", 1).objectAtIndex(0);
>> NSLog.out.appendln("*** Sistema de aplicação web Visiontur para a agência " + agência.títuloSite());
>> }
>>
>> Of course I use one or the other, not both at the same time. Regarding the UTF-8 characters, I have been using them without problem, but in a few points that I have very early identified and were UTF-8 is avoided.
>>
>> Angelo
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden