[hibernate-issues] [Hibernate-JIRA] Created: (BVAL-207) Hibernate 3.5.1-Final cannot parse order-by fragment

Vladimir Kobetic (JIRA) noreply at atlassian.com
Tue Apr 27 09:20:33 EDT 2010


Hibernate 3.5.1-Final cannot parse order-by fragment
----------------------------------------------------

                 Key: BVAL-207
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-207
             Project: Bean Validation
          Issue Type: Bug
         Environment: Hibernate 3.5.1-Final
MySQL 5.0
Spring 2.5
            Reporter: Vladimir Kobetic
            Priority: Critical


When upgrading from Hibernate 3.2.5.ga to the newest Hibernate 3.5.1-Final with the newest build-with dependent libraries an error occurs during initial phase of launching application.

I tried to build and run with all libraries from lib directory from Hibernate zip download.

The order-by clause is configured in hbm.xml:
<hibernate-mapping>
	<class name="com.test.Object" table="err">
		<id name="id" type="java.lang.Long">
			<generator class="native" />
		</id>

		<set name="history" table="history" lazy="true" order-by="timestamp desc" cascade="all-delete-orphan">
			<key column="object_id" />
			<one-to-many class="com.test.Event" />
		</set>

	</class>
</hibernate-mapping>


The exception is:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dao-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to parse order-by fragment
Caused by: org.hibernate.HibernateException: Unable to parse order-by fragment
	at org.hibernate.sql.ordering.antlr.OrderByFragmentTranslator.render(OrderByFragmentTranslator.java:66)
	at org.hibernate.sql.Template.renderOrderByStringTemplate(Template.java:310)
	at org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:557)
	at org.hibernate.persister.collection.OneToManyPersister.<init>(OneToManyPersister.java:84)
	at org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:104)
and more...
Caused by: java.lang.NullPointerException
	at org.hibernate.sql.ordering.antlr.OrderByFragmentParser.resolveFunction(OrderByFragmentParser.java:115)
	at org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.expression(GeneratedOrderByFragmentParser.java:619)
	at org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.sortKey(GeneratedOrderByFragmentParser.java:337)
	at org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.sortSpecification(GeneratedOrderByFragmentParser.java:248)
	at org.hibernate.sql.ordering.antlr.GeneratedOrderByFragmentParser.orderByFragment(GeneratedOrderByFragmentParser.java:192)
	at org.hibernate.sql.ordering.antlr.OrderByFragmentTranslator.render(OrderByFragmentTranslator.java:60)
	... 38 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list