-->
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.  [ 12 posts ] 
Author Message
 Post subject: hibernate.cfg.xml
PostPosted: Mon Sep 29, 2003 9:28 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,

Before, I was using hibernate.properties.

Now, I

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2003 10:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The property you are refering to is the JNDI name. Your setup does not require it as you are setting up the internal database connection pool rather then using an external one such as one build within a application server.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2003 10:46 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,


But when I use the file cfg.xml above, it appears the following error:

WARNING: Could not bind factory to JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

What can I do?

Thank you very much

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2003 6:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Ignore the message. It is a warning only.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 7:51 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Before, as I said in another post,
I was using hibernate.properties, it did not appear this warning
and everything was correct, but now, using cfg.xml, when I use
the find method, an error appears:

Hibernate: select from
30/09/2003 08:38:34 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 936, SQLState: 42000
30/09/2003 08:38:34 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-00936: missing expression

Well, I don

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 7:53 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Are you sure your dialect is properly set?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 8:24 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
I believe that yes.

The dialect in my cfg.xml is:

Code:
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>


The connection properties are:

<property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
      <property name="connection.url">jdbc:oracle:thin:@oraserver:1521:devdb</property>
      <property name="connection.username">user</property>
      <property name="connection.password">userpwd</property>

      <property name="connection.pool_size">1</property>

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 8:41 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,

Look at the error:

Code:
Hibernate: select  from
30/09/2003 09:36:07 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 936, SQLState: 42000
30/09/2003 09:36:07 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-00936: missing expression


The query that it appears is "select from" when the correct is
"select column1, column2, from User" and others querys.

The query is wrong, but I don

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 9:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The select clause requires the properties of the java POJO (class) rather than the database columns, eg, mapped to getName() would be alias.name in the select clause. If I am not clear then post the mapping for which you are writing the query.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 10:41 am 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Why when do I user hibernate.properties, the find method
performs properly??

Ex.: list = sess.find("from User");

Thanks for your attention

[]

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 3:48 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
When I use hibernate.cfg.xml, after to execute
Code:
factory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();


Into factory it has the classPersisters and into this it has
table that it contains a HashMap, but this HashMap is empty.

can this be the cause of the following error?

Code:
Hibernate: select  from
30/09/2003 09:36:07 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 936, SQLState: 42000
30/09/2003 09:36:07 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-00936: missing expression


Somebody can help me?

thanks

_________________
Tads


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2003 9:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Not enough information.
Post: hibernate.properties
Post: config xml file
Post: Query /Mapping and class code.


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