-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: java.lang.NoSuchFieldError: NONE
PostPosted: Thu Jun 03, 2010 11:26 am 
Newbie

Joined: Thu Jun 03, 2010 11:15 am
Posts: 4
I am getting this run time exception when I am running my hello world program using JPA .

The code is as mentioned below --


// Second unit of work
EntityManager newEm = emf.createEntityManager();
EntityTransaction newTx = newEm.getTransaction();
newTx.begin();

//Exception is thrown at this point
List messages =
newEm.createQuery("select m from Message m order by m.text asc").getResultList();

for (Object m : messages) {
Message loadedMsg = (Message) m;
System.out.println(loadedMsg.getText());
}

newTx.commit();
newEm.close();

}catch(Exception e){e.printStackTrace();}

// Shutting down the application
emf.close();
}


The jars which I am using are mentioned below --

1)ejb3-persistence-1.0.2.GA
2)hibernate3
3)hibernate-entitymanager-3.5.1-Final
4)hibernate-jpa-2.0-api-1.0.0.Final
5)hibernate-validator-4.0.2.GA

Database which I am using is hsqldb

I will be very much obliged for the solution of the same , I feel that it is related to versions of the jars but not sure which one to use.

Thx
Sahil Avasthi


Top
 Profile  
 
 Post subject: Re: java.lang.NoSuchFieldError: NONE
PostPosted: Fri Jun 04, 2010 11:08 am 
Newbie

Joined: Wed Feb 13, 2008 3:44 am
Posts: 2
ejb3-persistence-1.0.2.GA and hibernate-jpa-2.0-api-1.0.0.Final seems to be jps specification libraries

I think you need to remove ejb3-persistence-1.0.2.GA if you are using hibernate 3.5

CSJakharia


Top
 Profile  
 
 Post subject: Re: java.lang.NoSuchFieldError: NONE
PostPosted: Sat Jun 05, 2010 3:40 am 
Newbie

Joined: Thu Jun 03, 2010 11:15 am
Posts: 4
csplrj wrote:
ejb3-persistence-1.0.2.GA and hibernate-jpa-2.0-api-1.0.0.Final seems to be jps specification libraries

I think you need to remove ejb3-persistence-1.0.2.GA if you are using hibernate 3.5

CSJakharia


Top
 Profile  
 
 Post subject: Re: java.lang.NoSuchFieldError: NONE
PostPosted: Sat Jun 05, 2010 3:41 am 
Newbie

Joined: Thu Jun 03, 2010 11:15 am
Posts: 4
Thanks very much , it worked ....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.