File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes [Hibernate + JBoss] How to create a session factory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[Hibernate + JBoss] How to create a session factory" Watch "[Hibernate + JBoss] How to create a session factory" New topic

[Hibernate + JBoss] How to create a session factory

Luciano Queiroz
Ranch Hand

Joined: Feb 04, 2002
Posts: 172
Hi guys!

I'm trying to use Hibernate, but found some problems.
When I try to open the session for the first time, Hibernate aparently creates the session, maps the HBMs, but then it returns an error.
Am I missing any configuration in JBoss???
My code is as follows:

InitialContext initialContext = new InitialContext();
SessionFactory sessionFactory = (SessionFactory) initialContext.lookup( sessionFactoryJndiName );
Session session = sessionFactory.openSession();

09:23:48,657 INFO [Configuration] Configuration resource: /organisation.hibernate.cfg.xml
09:23:50,625 INFO [Configuration] Configured SessionFactory: /hibernate/organisationSessionFactory

[AbstractPasswordCredentialLoginModule] The ConnectionManager mbean: jboss.jca:service=LocalTxCM,name=DefaultDS specified in a ConfiguredIdentityLoginModule could not be found. ConnectionFactory will be unusable!

<b>Luciano Queiroz</b><br/>
 <i>SCJP 1.2, SCWCD, IBM 141, IBM 483, SCJP 1.4, IBM 484, IBM 287, SCBCD, SCEA, SCJP 5.0, SCJP 6.0, SCWCD 5</i>
I agree. Here's the link:
subject: [Hibernate + JBoss] How to create a session factory
It's not a secret anymore!