aspose file tools*
The moose likes Object Relational Mapping and the fly likes Unable to find Data source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Unable to find Data source" Watch "Unable to find Data source" New topic
Author

Unable to find Data source

Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
Hi Everybody,
I am trying to use middlegen to generate .hbm and value objects. When i am deploying my application it can find hibernate.cfg.xml but it cannot detect the datasource. i am posting my hibernate.cfg.xml and mapping file
Can someone suggest me a solution.Thanks in advance....

hibernate.cfg.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory >

<!-- datasource connection properties -->
<property name="connection.datasource">HibernateDS</property>
<property name="hibernate.jndi.url">HibernateDS</property>

<!-- dialect for Oracle (any version) -->
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>

<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<mapping resource="com/ats/axsis/hib/Login.hbm" />
</session-factory>
</hibernate-configuration>

login.hbm:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1

http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->

<class
name="com.ats.axsis.hib.LoginValue"
table="LOGIN"
>
<meta attribute="class-description" inherit="false">
@hibernate.class
table="LOGIN"
</meta>


<meta attribute="field-description" inherit="false">
@hibernate.id
generator-class="assigned"
</meta>
<composite-id>
<key-property
name="username"
column="USERNAME"
type="java.lang.String"
length="20"
>
<meta attribute="field-description">
@hibernate.property
column="USERNAME"
length="20"
</meta>
</key-property>
</composite-id>
<property
name="password"
column="PASSWORD"
type="java.lang.String"
length="20"
>
<meta attribute="field-description">
@hibernate.property
column="PASSWORD"
length="20"
</meta>
</property>
<property
name="role"
column="ROLE"
type="java.lang.String"
length="30"
>
<meta attribute="field-description">
@hibernate.property
column="ROLE"
length="30"
</meta>
</property>



<!-- Associations -->
<!-- derived association(s) for compound key -->
<!-- end of derived association(s) -->


</class>
</hibernate-mapping>


With regards,
venkat Dasari
SCJP 1.4


Regards,<br />Venkat Dasari<br />SCJP 1.4, SCBCD.
Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
I forgot to mention,my datasource is also configured and it can be seen

Thanks,
Venkat Dasari
SCJP 1.4
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to find Data source