-->
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.  [ 4 posts ] 
Author Message
 Post subject: cannot generate Session factory using hibernate extV3.0Alpha
PostPosted: Mon May 16, 2005 11:28 pm 
Newbie

Joined: Thu Dec 09, 2004 11:09 am
Posts: 2
Location: Shelton,CT
Hi

I have been trying to get the hibernate ext tools(extV3.0Alpha & hibernate 3.0.3),to work with eclipse Eclipse 3.1M4, I am not able to generate the seeion factory from the console perspective.

this is my cfg 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">
<hibernate-configuration>
<session-factory>
<propertyname="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.connection.url">jdbc:db2:DBNAME</property>
<property name="hibernate.connection.driver_class">com.ibm.db2.jdbc.app.DB2Driver</property>
</session-factory>
</hibernate-configuration>


But even though I have all the necessary DB2 jars in my project library,I always get the following exception,

org.hibernate.console.HibernateConsoleRuntimeException: Problems while loading database driverclass (com.ibm.db2.jdbc.app.DB2Driver)
at org.hibernate.console.ConsoleConfiguration.registerFakeDriver(ConsoleConfiguration.java:195)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:155)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:128)
at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:50)
at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:47)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:555)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:505)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:419)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code))
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined Compiled Code))
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:285)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:710)
at org.eclipse.core.launcher.Main.main(Main.java:694)
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jdbc.app.DB2Driver
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:176)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:103)
at org.hibernate.console.ConsoleConfiguration.registerFakeDriver(ConsoleConfiguration.java:187)
... 27 more



Which is very weird, and frustrating, I use "DB2 connect" to connect to a remote DB(forgive the redundancy), i can connect and query the same database from WSAD with hand coded cfg,hbm and pojo's.

Any help wud be appreciated

Shyam


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 2:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
did you remember to add the driver to the classpath of the console configuration ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 11:52 am 
Newbie

Joined: Thu Dec 09, 2004 11:09 am
Posts: 2
Location: Shelton,CT
Hi
thanks for responding,I do have the drivers in my lib directory and pass that in when the create console dialog shows up.


Shyam


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 12:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you need to add the .jar file not just the directory.

_________________
Max
Don't forget to rate


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