jQuery in Action, 3rd edition
The moose likes Object Relational Mapping and the fly likes Hibernate config on JBOSS 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 config on JBOSS" Watch "Hibernate config on JBOSS" New topic

Hibernate config on JBOSS

M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 397
I am using JBOSS 5 and Hibernate 3. I keep getting an error when I try to access the Session factory, "javax.naming.NameNotFoundException: DSDB not bound"

I assume my config is wrong somehow. Would you take a look?

Java Call:
SessionFactory sf = (SessionFactory) new InitialContext().lookup("java:/DSDB");


<session-factory name="java:/DSDB">
<property name="dialect">
<property name="connection.datasource">java:/DSDB</property>
<property name="connection.username">stuff</property>
<property name="jndi.class"></property>
<property name="connection.password">stuff</property>
<property name="jndi.url">


<?xml version="1.0" encoding="UTF-8"?>


<!-- JBOSS 5.1 Install in \server\default\deploy-->
<new-connection-sql>SELECT 1</new-connection-sql>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<type-mapping>MS SQLSERVER2000</type-mapping>


Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 661

It's typically java:xxx/name or java:env/xxx/name.
Can you please verify the jndi name in console after starting your jboss: http://localhost:8080/?
you can refer this thread for jndi naming conventions in jboss.

If you are not laughing at yourself, then you just didn't get the joke.
I agree. Here's the link: http://aspose.com/file-tools
subject: Hibernate config on JBOSS
It's not a secret anymore!