JPA 2 « Exception « JPA Q&A





1. JPQL MySQLSyntaxErrorException: You have an error in your SQL syntax    stackoverflow.com

I have two entities User and Group:

@Entity
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private String ...

2. Hibernate - NonUniqueObjectException    stackoverflow.com

I use JPA/Hibernate with Spring transaction management in my application. There is a InspectionEntity which has a one-to-many relation with InspectionDetailEntity. The PKs for both the entity's are created by an insert trigger ...

3. JPA 2.0, How can I fix the following 2 errors    stackoverflow.com

I'm actually learning JPA2.0 and I'm stuck with the following errors, consider than I'm using eclipse as IDE.

Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    at ...

4. "Exception in thread "main" org.apache.openjpa.persistence.RollbackException: near "FOR"" error    stackoverflow.com

I'm encountering this error in JPA using SQLite and I don't know why it does it, help? My persistence.xml:

<persistence 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"
version="1.0">
<persistence-unit name="geronimo" transaction-type="RESOURCE_LOCAL">
    <provider>
      ...

5. solving a exception in jonas As 5.2.1 deployment    stackoverflow.com

I am newbie in develloping with JOnAs platform, also in Spring and more genrally in web devellopments. After having somte troubles with JBoss 5.1.GA and tomcat 6.x,7.x i decided to move ...

7. What is the name of hibernate 2 exception?    coderanch.com

Its a StaleObjectException. The scenario you use is not accurate though. Two seperate processes cannot update the same row concurrently, database transacitons prevent this. However, data about a row held by a client can be updated by another process if the data is held outside a transaction. e.g. : Process 1 Transaction 1: read data. Process 2 Transaction 1: read data. ...

8. ConstraintViolationException working in 2 or more tx    forum.hibernate.org

Newbie Joined: Fri Sep 18, 2009 12:45 pm Posts: 2 Hi When I am saving a large set of objects in a long transaction, I am getting primary key constraintviolation. I am saving a NetworkElement which has children and grandchildren.. The dbobjects are defined in an hierarchy.NetworkElement(has),Shelf(has),Pack(has), DSLPort. All objects have their own oracle sequence defined. NetworkElement also has association with ...

9. JPA 2.0 EnumType ClassCastException java.util.LinkedList    forum.hibernate.org

Hi all, I've been fighting this weird issue with JPA 2.0 + Hibernate 3.5.0 + MySQL with Enums. Here is my query: @NamedQuery(name = "getEventsByDistanceAndEventTypes", query = "SELECT new Event(events.eventId, events.name, events.location, events.startDate, events.endDate, events.resort.location, " + "glength(events.resort.location, :location), events.type, events.contact, events.costs, events.description, events.email, " + "events.url) FROM Event events LEFT JOIN events.resort WHERE contains(:bounds, events.resort.location) = true AND (events.type IN ...





10. Hibernate build errors using JDK 1.2.2    forum.hibernate.org

11. new in 2.1beta5: NullPointerException    forum.hibernate.org

12. Changed code for auction example gives error in 2.1beta5 ??    forum.hibernate.org

Hi all, I have slightly changed/played with auction example in 2.1 Here are my files:

13. java.lang.NoClassDefFoundError in 2.1 rc    forum.hibernate.org

14. compile errors 2.1 rc1    forum.hibernate.org

hi, I have download 2.1 rc1 and tried to ant build but get error down below. With 2.1 beta 6 build works without problems. can someone give me some help ? thanks. Buildfile: build.xml [taskdef] Could not load definitions from resource clovertasks. It could not be found. splash: init: [echo] Build Hibernate-2.1 (2003-12-09 03:21:17) compile: [javac] Compiling 4 source files to ...

15. 2.1 Final IllegalArgumentException and onDelete    forum.hibernate.org

Newbie Joined: Sun Nov 30, 2003 4:11 pm Posts: 11 Hi, More info, of course, excuse me. Please, note that this is a unit test... I think there could be a case in which, in the same session, children would be deleted and then the parent (of course, more things would happen between those two delete() calls) My code is something ...

16. Hibernate2.1: Exception (Cache Provider class not found)    forum.hibernate.org

Hi, I upgraded to hibernate 2.1 from hibernate 2.0.3, and am getting an error (see below). Here is a snippet from the cfg.xml file: Code: ... connection details ... com.sap.dbtech.jdbc.DriverSapDB 10 10 true net.sf.hibernate.dialect.SAPDBDialect true ... mappings ... Here is the error trace: Code: javax.servlet.ServletException: could not instantiate CacheProvider: net.sf.ehcache.hibernate.Provider ...





17. ConcurrentModificationException with Hibernate-2.1.1    forum.hibernate.org

Author Message andy999 Post subject: ConcurrentModificationException with Hibernate-2.1.1 Posted: Sun Jan 11, 2004 10:29 pm Newbie Joined: Wed Dec 10, 2003 8:40 pm Posts: 14 Location: Sydney Hi I am using Hibernate-2.1.1 with MySql-4.0.13 and jboss-3.2.1 and when I try to load any persistent class with a collection I get a java.util.ConcurrentModificationException. The architecture is DAO's behind SLSB's. Here ...

19. Error building hibernate-extensions-2.0.2    forum.hibernate.org

Hi again! Well, I have a little problem. Ive downloaded hibernate and built it with no problem. But, after Ive downloaded hibernate extensions version 2.0.2 and try to build I receive the following error message: ========= linux:/usr/local/hibernate-extensions-2.0.2/tools # ant Buildfile: build.xml init: [echo] Build Hibernate Tools-2.0.1 (2004-02-22 02:54:10) BUILD FAILED /usr/local/hibernate-extensions-2.0.2/tools/build.xml:93: /usr/local/hibernate-extensions-2.0.2/tools/src/java not found. Total time: 3 seconds linux:/usr/local/hibernate-extensions-2.0.2/tools # ============ ...

20. Simple class,2 Saves in a row, throws exceptions using SQL.    forum.hibernate.org

Beginner Joined: Thu Feb 26, 2004 11:45 am Posts: 45 I'm having some problems when inserting records under certain circumstances. I'm in the process of trying to do a fairly simple prototype using a few different solutions - Hibernate being one of them. I am extremely impressed with the level of documentation and the breadth of the functionality. It appears to ...

21. After 2 long day- java.lang.UnsupportedOperationException:    forum.hibernate.org

Hello forum, firstly thanks for your time. I have installed hibernate synchronizer on eclipse-SDK-3.0M9-win32 then hook to a oracle10g db, then generated the files of 3 tables. the hbh.xml, the java files. then genrated the apping file cfg.xml. but the tried this small example. I am running it inside eclipse the structure of problem 1: test.java 2:cfg.xml 3: the error message ...

22. java.lang.ClassCastException with hibernate-2.1.4    forum.hibernate.org

java.lang.ClassCastException with hibernate-2.1.4 I have made small program but when I run it inside eclipse I get the following error. please somebody help. 21:10:35,784 INFO Environment:462 - Hibernate 2.1.3 21:10:35,804 INFO Environment:496 - loaded properties from resource hibernate.properties: {hibernate.connection.username=system, hibernate.connection.password=sofus1, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.connection.url=jdbc:oracle:thin:@localhost:1521:pusdb, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver} 21:10:35,824 INFO Environment:519 - using CGLIB reflection optimizer 21:10:35,834 INFO Configuration:872 - configuring from resource: /hibernate.cfg.xml 21:10:35,834 ...

23. [HB-1064] FastClass NoClassDefFoundError w/2.1.4    forum.hibernate.org

2004-07-25 00:39:36,234 [INFO ] f.hibernate.util.ReflectHelper - reflection optimizer disabled for: javax.mail.internet.InternetAddress, CodeGenerationException: java.lang.reflect.InvocationTargetException-->null 2004-07-25 00:39:36,250 [ERROR] work.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in resource [/WEB-INF/applicationContext.xml] of ServletContext: Initialization of bean failed; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:208) at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:92) at net.sf.cglib.reflect.FastClass.create(FastClass.java:74) ... Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/reflect/FastClass at java.lang.ClassLoader.defineClass0(Native Method)

24. AbstractMethodError on 2.1.8    forum.hibernate.org

Hibernate version: 2.1.8 Name and version of the database you are using: Oracle 10g Hello, I'm using Hibernate on spring framework 1.0.2. JDK version is 1.4.2_07. I've been using Hibernate 2.1.7 and working good. But when I migrates to 2.1.8, AbstractMethodError occurs when initializing Hibernate. When I change hibernate2.jar to ver.2.1.7, this don't happen. Any suggestion? Sorry for my poor English. ...

25. NonUniqueObjectException on Hibernate Upgrade to 2.1.8    forum.hibernate.org

Hibernate Community View topic - NonUniqueObjectException on Hibernate Upgrade to 2.1.8 Login Register FAQ Search View unanswered posts | View active topics Board index Hibernate & Java Persistence Hibernate Users All times are UTC - 5 hours [ DST ] NonUniqueObjectException on Hibernate Upgrade to 2.1.8 Page 1 ...

27. ID generated regardless of exception (2.1.7)?    forum.hibernate.org

Hibernate version:2.1.7 Hi. Is it normal that when persisting new object, it's ID gets generated regardless of exception being raised because of some constraint issue? My application manages presentation differently when dealing with fresh (getId() == null) and already persisted objects (getId() != null). Problem is that when new object is to be persisted, in some situations some expected db exception ...

28. AbstractMethodError in configureCaches using 2.1.8    forum.hibernate.org

Hi, After upgrading from Hibernate 2.1.6 to 2.1.8, I get an AbstractMethodError when trying to open a session. Downgrading to 2.1.6 solves the problem. I was using the EHCahce. Since I haven't tried 2.1.7 I don't know if this problem was introduced in 2.1.7, or in 2.1.8. I'm sorry for not yet trying out more, but I don't have time now ...

29. NonUniqueObjectException when 2 objects refer to same object    forum.hibernate.org

Hi, I have a problem where two different objects (A & B) are referring to a third object (C) and B is contained in A. A------- C | B------- C Save is fired on A. I use lifecycle methods on A to save B. i.e. in lifecycle method "onUpdate" of A, I have written [b]session.saveOrUpdate(getB())[/b] While saving it throws exception Caused ...

30. tiro hibernate of error! I make not well ! please help me 2    forum.hibernate.org

Newbie Joined: Tue Dec 12, 2006 11:50 pm Posts: 10 Logic.hbm.xml

31. tiro hibernate of error! I make not well ! please help me 2    forum.hibernate.org

Newbie Joined: Tue Dec 12, 2006 11:50 pm Posts: 10 Logic.hbm.xml

32. Unable to connect after an exception occurs Weblogic 9.2    forum.hibernate.org

this is my hibernate.cfg.xml false datasource.jndi org.hibernate.dialect.Oracle9Dialect org.hibernate.transaction.JTATransactionFactory weblogic/transaction/UserTransaction org.hibernate.transaction.WeblogicTransactionManagerLookup org.hibernate.hql.classic.ClassicQueryTranslatorFactory org.hibernate.cache.EhCacheProvider 0 true