-->
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.  [ 6 posts ] 
Author Message
 Post subject: i cannot connect to oracle9i database
PostPosted: Tue Aug 30, 2005 11:08 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
..somebody help me because i cannot connect to oracle 9i database im using hibernate 3...here is my config file:

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

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<hibernate-configuration >

<session-factory>
<!-- properties -->

<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">tiger</property>
<property name="hibernate.connection.url">jdbc:oracle:thin@localhost/eman</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.pool_size">1</property>
<property name="hibernate.show_sql">true</property>
<!-- mapping files -->
<mapping resource="ora_spider/Student.hbm.xml"/>

</session-factory>

</hibernate-configuration>

...can somebody help me..pls.tnx.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 11:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
your connection url is not correct for oracle.

assuming that 'eman' is your SID, you'd do:

jdbc:oracle:thin:@localhost:1521:eman


Top
 Profile  
 
 Post subject: ..i try the example connection url
PostPosted: Wed Aug 31, 2005 12:32 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
--hi i try the connection url but it does not work.here is the stack trace...
Exception:
javax.servlet.ServletException: org/hibernate/HibernateException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.student_jsp._jspService(student_jsp.java:99)
-------------------
root cause:
java.lang.NoClassDefFoundError: org/hibernate/HibernateException
org.apache.jsp.student_jsp._jspService(student_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
-------------------------
..what could be other problems cause the error...thnx


Top
 Profile  
 
 Post subject: ....nwei thats for steve...
PostPosted: Wed Aug 31, 2005 12:46 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
....nwei thats for steve...tnx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 4:38 am 
Beginner
Beginner

Joined: Mon Aug 16, 2004 6:15 am
Posts: 24
The NoClassDefFound exception points to that class (org.hibernate.HibernateException) not existing in your classpath.

Since it looks like you're running in a container of some sort (usage of jsps), then I'd check what you have deployed and ensure it is correct.


Top
 Profile  
 
 Post subject: ..tnx for that but i cannot run either
PostPosted: Thu Sep 01, 2005 12:40 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
...i change my config file like this:

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

<hibernate-configuration>
<session-factory >

<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:oracle:thin@spyker:1521:eman</property>
<property name="hibernate.connection.driver_class">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.username">eman</property>
<property name="hibernate.connection.password">password</property>
<!-- property name="hibernate.connection.pool_size"></property -->

<!-- dialect for Oracle 9 -->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</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.JTATransactionFactory</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>

<mapping resource="ora_spider/Student.hbm.xml"/>

</session-factory>
</hibernate-configuration>

----and the error is:

%%% Error Creating SessionFactory %%%%
org.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.Oracle9Dialect
at org.hibernate.dialect.Dialect.getDialect(Dialect.java:501)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:51)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1497)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1041)

---it seems that the dialect was not foound but hibernate3.jar is in my classpath..pls help..tnx.


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