on 02-25-2006 6:51 AM
hi,
i am using hibernate in my netweaver with maxdb but it is giving below exception
Initial SessionFactory creation failed.org.hibernate.HibernateException: Could not find datasource
java.lang.NullPointerException
please helpme (if posible tell me the procedure)
my xmls.
1)Message.hbm.xml
<hibernate-mapping>
<class name="in.Message" table="TMP_MSGS">
<id name="id" type="long" column="ID" >
<generator class="assigned"/>
</id>
<property name="fname">
<column name="FIRSTNAME" />
</property>
<property name="lname">
<column name="LASTNAME"/>
</property>
<property name="email">
<column name="EMAIL"/>
</property>
</class>
</hibernate-mapping>
2)hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.sap.dbtech.jdbc.DriverSapDB</property>
<property name="hibernate.connection.url">jdbc:sapdb://10.10.0.201:50000/SAPJ2EDB</property>
<property name="hibernate.connection.username">SAPJ2EDB</property>
<property name="hibernate.connection.password">admin</property>
<property name="connection.datasource">J2E/SAPJ2EDB</property>
<property name="dialect">org.hibernate.dialect.SAPDBDialect</property>
<property name="show_sql">false</property>
<!-- Mapping files -->
<mapping resource="Message.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Thanqqqq
Guru
Hi Guru ,
Replace
<property name="connection.datasource">J2E/SAPJ2EDB</property>
with
<property name="connection.datasource">jdbc/SAPJ2EDB</property>
here the datasource name u have to look up with
this way <b>jdbc/SAPJ2EDB</b>
i think this is the problem.
SAPJ2EDB , is the default DataSource name for Max DB .
HI Guru ,
what u have to do here is ,(Main things to note)
1)Create the hibernate.cfg.xml file with ur custom configuration. just keep this within your WEB-INF/classes
of your Web Module project.(Related with this sample application).
2) create ur Message class .(code in example).
3)Create Message.hbm.xml with prefered configuration and put it in the same folder of your class.
Regards
Kishor Gopinthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This link may be useful
http://forum.hibernate.org/viewtopic.php?t=934779&highlight=c3p0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.