Null Pointer Exception When Usding Spring 3.0 with Hibernate 3.5.0-Beta-x

Description

Hi guys,

I had an application working fine with OpenJPA, but I decided to migrate to Hibernate and I get a Null pointer exception (see the attached stacktrace).
Let me know if you need some other info. My configuration is below:
persistence.xml:
===========================================
===========================================
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="frontend-ui">
<class>com.fugsley.beech.betting.db.model.User</class>
.........[more here]...................

<!-- provider>org.hibernate.ejb.HibernatePersistence</provider>
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider-->

<properties>
<!-- OpenJPA configuration -->
<!-- property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost:3306/fugsley?useUnicode=true&amp;characterEncoding=UTF-8"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionUserName" value="fugsley"/>
<property name="openjpa.ConnectionPassword" value="r00tka"/>
<property name="openjpa.DetachState" value="DetachedStateField=true"/>
<property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO"/> -->

<!-- configuration pool via c3p0-->
<property name="c3p0.acquire_increment" value="1"/>
<property name="c3p0.idle_test_period" value="100"/> <!-- seconds -->
<property name="c3p0.min_size" value="5"/>
<property name="c3p0.max_size" value="20"/>
<property name="c3p0.timeout" value="1800"/>
<property name="c3p0.max_statements" value="50"/>

<!-- Hibernate configuration -->
<property name="hibernate.archive.autodetection" value="class, hbm"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.password" value="r00tka"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/fugsley?useUnicode=true&amp;characterEncoding=UTF-8"/>
<property name="hibernate.connection.username" value="fugsley"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.timeout" value="300"/>
<property name="hibernate.c3p0.max_statements" value="50"/>
<property name="hibernate.c3p0.idle_test_period" value="3000"/>

</properties>
</persistence-unit>
</persistence>

===============spring-application-context===========================
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
</property>
<property name="dataSource" ref="beechDataSource" />
<property name="jpaVendorAdapter">
<bean
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="database" value="Mysql" />
<property name="showSql" value="false" />
</bean>
</property>
</bean>

Environment

Java, 1.6, Spring 3.0.0 (tested also with 3.0.1.SNAPSHOT)

Activity

Show:
Gail Badner
April 22, 2010, 1:39 AM

Is this still a problem with 3.5.1?

I see from your stacktrace that the NullPointerException happens when the ORDER BY clause of a query is being parsed.

What is the query that is failing?

Steve Ebersole
March 21, 2011, 7:09 PM

Bulk closing stale resolved issues

Assignee

Gail Badner

Reporter

Petar Tahchiev

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Critical
Configure