-->
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.  [ 2 posts ] 
Author Message
 Post subject: [Newbie] - Could not initialize class org.hibernate.ejb.Ejb3
PostPosted: Wed Apr 02, 2008 4:11 am 
Newbie

Joined: Wed Apr 02, 2008 3:59 am
Posts: 6
Location: Netherlands, Amsterdam
Hi all,

I'm totally new with Hibernate. I've got the book java persistence with Hibernate and I tried several google searches. But I can't figure out what my problem is.

I'm developing in Eclipse with Flex Builder plugin on a Flex-Java Hybrid project (possible since Flex Builder 3 final as far as I know). It has 1 project with a flex_src folder, java_src folder and a WebContent where the compiled classes go (META-INF and WEB-INF and the Flex configuration files in WEB-INF.flex).

I have 1 DAO class with the following code:
Code:
public void storeTextMessage(TextMessage textMessage) {
      EntityManagerFactory emf = Persistence.createEntityManagerFactory("RicohPersistence");
      
      EntityManager em = emf.createEntityManager();
      EntityTransaction transaction = em.getTransaction();
      
      transaction.begin();
      
      /*
      * Store the whole new object tree
      */
      em.persist(textMessage);
      
      /*
      * Commit all changes
      */
      transaction.commit();
      
      /*
      * Close the connection
      */
      em.close();
   }


and a persistence.xml with <persistence-unit name="RicohPersistence"> and a configuration for a SQL server connection. Now when I start the application and go through the storeTextMessage method I get a "Could not initialize class org.hibernate.ejb.Ejb3" error on the line "EntityManagerFactory emf = Persistence.createEntityManagerFactory("RicohPersistence");"

As far as I know I have all the correct jar files added in a user-library that I have added to the project using the Java Build Path -> Libraries in the project properties.

How do I solve this problem?

Cheers,
Rick


Top
 Profile  
 
 Post subject: Re: [Newbie] - Could not initialize class org.hibernate.ejb.
PostPosted: Wed Apr 02, 2008 9:00 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
what is the full stack trace?



Farzad-


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.