-->
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.  [ 1 post ] 
Author Message
 Post subject: The user must supply a JDBC connection
PostPosted: Fri Sep 17, 2004 8:05 am 
Newbie

Joined: Fri Sep 17, 2004 8:00 am
Posts: 6
Hibernate version:
2.1
Mapping documents:

Code between sessionFactory.openSession() and session.close():
Transaction tx = null;

// An element
Element elem = new Element();
elem.setAge( 30 );
elem.setDescription( "Some long winded description" );
elem.setName( "Element1Name" );
Element elem2 = new Element();
elem2.setAge( 15 );
elem2.setDescription( "Some more long winded description2" );
elem2.setName( "Element2Name" );

// Make a list of elements;
ArrayList elements = new ArrayList();
elements.add( elem );
elements.add( elem2 );

// Make a component
Component comp = new Component();
// Assign the elements
comp.setElements( elements );

// Create a list of components
ArrayList components = new ArrayList();
components.add( comp );

// Make a list view

ListView listView = new ListView();
listView.setColor( "Red" + new Date() );
listView.setViewtitle( "Subclass (List) View Title" + new Date() );
listView.setComponents( components );


/**************************************************8
* Experimentation goes here.
*/
Template testTemplate = new Template();
testTemplate.setTitle( "Test B" );
testTemplate.setViews( views );
try
{
tx = sess.beginTransaction();
sess.saveOrUpdateCopy( testTemplate, new Long( 2 ) );
tx.commit();
} catch ( HibernateException e2 )
{
if ( tx != null ) tx.rollback();
throw e2;
}

Full stack trace of any exception that occurs:
Sep 17, 2004 12:38:36 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.4
Sep 17, 2004 12:38:36 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Sep 17, 2004 12:38:36 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Sep 17, 2004 12:38:36 PM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: com/cibenix/test/hibernate/persist/View.hbm.xml
Sep 17, 2004 12:38:36 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.cibenix.test.hibernate.persist.View -> View
Sep 17, 2004 12:38:36 PM net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: com.cibenix.test.hibernate.persist.View.components -> components_in_view
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Binder bindJoinedSubclass
INFO: Mapping joined-subclass: com.cibenix.test.hibernate.persist.ListView -> ListView
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Binder bindJoinedSubclass
INFO: Mapping joined-subclass: com.cibenix.test.hibernate.persist.PopUpListView -> PopUpListView
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: com/cibenix/test/hibernate/persist/Component.hbm.xml
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.cibenix.test.hibernate.persist.Component -> Component
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: com.cibenix.test.hibernate.persist.Component.elements -> elements_in_component
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: com/cibenix/test/hibernate/persist/Element.hbm.xml
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.cibenix.test.hibernate.persist.Element -> Element
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: com/cibenix/test/hibernate/persist/Template.hbm.xml
Sep 17, 2004 12:38:37 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.cibenix.test.hibernate.persist.Template -> Template
Sep 17, 2004 12:38:39 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Sep 17, 2004 12:38:39 PM net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: com.cibenix.test.hibernate.persist.Template.views -> View
Sep 17, 2004 12:38:39 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
Sep 17, 2004 12:38:39 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Sep 17, 2004 12:38:39 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
WARNING: No dialect set - using GenericDialect: The dialect was not set. Set the property hibernate.dialect.
Sep 17, 2004 12:38:39 PM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.GenericDialect
Sep 17, 2004 12:38:39 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: false
Sep 17, 2004 12:38:40 PM net.sf.hibernate.connection.UserSuppliedConnectionProvider configure
WARNING: No connection properties specified - the user must supply JDBC connections
Sep 17, 2004 12:38:40 PM net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
Sep 17, 2004 12:38:40 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: false
Sep 17, 2004 12:38:40 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
Sep 17, 2004 12:38:40 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
Sep 17, 2004 12:38:40 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Sep 17, 2004 12:38:40 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.ehcache.hibernate.Provider
Sep 17, 2004 12:38:40 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Sep 17, 2004 12:38:40 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Sep 17, 2004 12:38:41 PM net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: no JNDI name configured
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:32)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3302)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3282)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2227)
at com.cibenix.test.hibernate.example.Example.<init>(Example.java:124)
at com.cibenix.test.hibernate.example.Example.main(Example.java:27)

Name and version of the database you are using:
Using Oracle 9i Version 2
The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:



So has anyone got any ideas as to the problem... am it has got to do with the hibernate.xml file not being found so does where do i put it? I am trying to run hibernate in a simple standalone application with no servers or anything like that

thanks in advance guys


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.