Hi,

I am using JPA 2.0 in my spring 3.0.5 project for the first time and get the following exception:

java.lang.NoClassDefFoundError: javax/persistence/criteria/Selection
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Cla ss.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java :1836)
at org.springframework.beans.factory.annotation.Autow iredAnnotationBeanPostProcessor.determineCandidate Constructors(AutowiredAnnotationBeanPostProcessor. java:227)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.determineConstructorsFr omBeanPostProcessors(AbstractAutowireCapableBeanFa ctory.java:930)

CriteriaBuilder queryBuilder = em.getCriteriaBuilder();
CriteriaQuery<Order> query = queryBuilder.createQuery(Order.class);
Root<Order> root = query.from(Order.class);
query.select(root); // When this line is removed I don't get the exception

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.5.1-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
</dependency>

The file hibernate-jpa-2.0-api-1.0.0.Final.jar is in WEF-INF/lib and it contains the class.

What am I missing?

Thanks,
Ropo