-->
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.  [ 3 posts ] 
Author Message
 Post subject: Prob. w. HibernateEntityManager 3.1beta7 Setup+Dependency
PostPosted: Tue Apr 11, 2006 3:47 pm 
Newbie

Joined: Tue Apr 11, 2006 3:34 pm
Posts: 2
Hello,

I am trying to use the latest release of Hibernate EntityManager (3.1beta7) and I have obtained the dependencies stated in the manual, however I am getting an exception. Show below is the sample code and the exception.

Code:
    public void test_bootstrap() {
        // Use persistence.xml configuration
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("appssoEtyMgr");
        EntityManager em = emf.createEntityManager(); // Retrieve an application managed entity manager

        assertNotNull(em);
        ...
    }


I get the following exception:

Quote:
java.lang.NoClassDefFoundError: org/jboss/util/file/ArchiveBrowser$Filter
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:109)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at com.evergreen.userlinks.biz.EntityManagerConfigTest.test_bootstrap(EntityManagerConfigTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


I am a little surprised by the JBoss-dependency in the exception; I thought Hibernate EntityManager is supposed to act as an EJB3-style facade to Hibernate SessionFactory. Must I use the JBoss AS or microcontainer to use Hibernate EntityManager? The documentation below doesn't say anything about requiring JBoss.

Quote:
2.1. Setup

The EJB3 compatible Hibernate EntityManager is built on top of Hibernate core and Hibernate Annotations. You have to use compatible versions of each module. This version is known to work on Hibernate 3.2.0.CR2 and Hibernate Annotations 3.1beta9. The following libraries have to be in your classpath: hibernate3.jar, hibernate-annotations.jar, hibernate-entity-manager.jar and all needed third party libraries for each package.(incl. ejb-persistence.jar).


Any help appreciated.

Thanks.

PS - I can't find Hibernate 3.2.0CR2 anywhere on the Hibernate web site (only CR1).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 13, 2006 9:32 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Quote:
Must I use the JBoss AS or microcontainer to use Hibernate EntityManager? The documentation below doesn't say anything about requiring JBoss.


No, but you must have those that are in HibEM lib directory:
ejb3-persistance, hib-annotations, javaassist, jboss-archive-browsing

First two are obvious.
Others are utils for browsing through classes.

Your class (org/jboss/util/file/ArchiveBrowser$Filter) is in last one (as expected). And this lib is just 16k.

_________________
--------------------------------
Ales Justin
JBoss, a division of Red Hat


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 7:13 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is just a small jar parsing library that has nothing to do with the MC nor JBossAS. Don't be scared by org.jboss.something :-)

_________________
Emmanuel


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