To set the context, this is using Eclipse 3.4.2 (M20090211-1700) on Mac OS X. Running JBoss 4.2.3 GA, and Seam 2.1.2.
The existing application had been working correctly. However, the system threw the following exception:
12:21:55,923 INFO [STDOUT] Hibernate:
select
systcalend0_.scal_id as scal1_42_,
systcalend0_.scal_timestamp as scal2_42_,
systcalend0_.scal_last_updated_by as scal3_42_,
systcalend0_.scal_last_updated as scal4_42_,
systcalend0_.scal_name as scal5_42_
from
agency.agency.syst_calendar systcalend0_
order by
systcalend0_.scal_name
12:21:55,925 WARN [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000
12:21:55,925 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.syst_calendar systcalend0_ order by systcalend0_.scal_name' at line 1
12:21:55,929 ERROR [STDERR] Jul 23, 2009 12:21:55 PM com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/System/Jobs/ScheduleManager.xhtml]
org.jboss.seam.InstantiationException: Could not instantiate Seam component: scheduleManager
at org.jboss.seam.Component.newInstance(Component.java:2144)
...
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
...
12:21:55,930 ERROR [STDERR]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
...
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
...
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.syst_calendar systcalend0_ order by systcalend0_.scal_name' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
12:21:55,976 INFO [STDOUT] initScheduler() called
12:21:55,978 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
12:21:55,978 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple <>; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple <>)
...
The hibernate query is the key. Hibernate was pre-pending an extra schema name to the table. Instead of "agency.syst_calendar", it was trying to access "agency.agency.syst_calendar".
Turns out I'd ended up with the following line in src/main/META-INF/persistence.xml
Removing/commenting this fixed the problem immediately.
No comments:
Post a Comment