-->
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.  [ 5 posts ] 
Author Message
 Post subject: ClassNotFoundException creating hibernate console config
PostPosted: Mon Dec 05, 2005 7:11 pm 
Beginner
Beginner

Joined: Wed Nov 30, 2005 2:41 pm
Posts: 29
First time using the eclipse tools - installed the plugins, but when i used the wizard to create a console configuration, i got this error:

error messages:
Error 2005-12-05 13:51:22.562 ERROR Worker-13 org.hibernate.util.NamingHelper - Could not obtain initial context
javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.naming.java.javaURLContextFactory]
at javax.naming.spi.NamingManager.getInitialContext

I found that class (in naming-factory.jar) & added the jar to the wizard's dialog-box list for "classpath" (along with my jdbc driver jar), but i'm still getting the error. Do i need to add the jar elsewhere? I didnt find anything in docs (or forums) about this.

Hibernate version:3.1rc3, tools 3.1.0.beta1; eclipse 3.1.0
Name and version of the database you are using:DB2/400 (AS400)
(i'm hoping to rev-eng an AS400 db...)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 05, 2005 7:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
there are no datasources in eclipse so you will need to use pocs (plain old connection settings ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 05, 2005 7:40 pm 
Beginner
Beginner

Joined: Wed Nov 30, 2005 2:41 pm
Posts: 29
i don't understand how that relates to the classNotFoundException.

Here's my config file, if that makes a difference. It was created using the wizard:
<hibernate-configuration>
<session-factory name="SessionAS400test">
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.driver_class">com.ibm.as400.access.AS400JDBCDriver</property>
<property name="hibernate.connection.password">pw</property>
<property name="hibernate.connection.url">jdbc:as400://192.100.100.1</property>
<property name="hibernate.connection.username">name</property>
<property name="hibernate.default_schema">bwhtst</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2400Dialect</property>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 2:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and you have no hibernate.properties ?

try and remove the session factory name - it should just work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 12:19 pm 
Beginner
Beginner

Joined: Wed Nov 30, 2005 2:41 pm
Posts: 29
problem solved - bad schema name

Last night I set up an ANT script to do the rev-eng & I eventually got that working. Problem was in the cfg - default_schema had to be uppercase (BWHTST, not bwhtst). When I saw your post I went back & tried it in eclipse, & it works there, too, now. So when the schema name doesn't match, it gets the ClassNotFoundException. Running in the ANT script, there's no error, you just don't get any tables processed.

It would be nice in either situation to get a warning/error message instead of (a) Exception or (b) no output.


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