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.  [ 11 posts ] 
Author Message
 Post subject: UnsupportedOperation Exception
PostPosted: Sat Aug 27, 2005 3:44 pm 
Newbie

Joined: Sat Aug 27, 2005 2:02 pm
Posts: 13
Hi all,

I'm running my app with hibernate 3.0, in a non managed env, with c3p0. I'm besides configuring hibernate in my java code. While running my app i'm getting a UnsupportedOperation exception, saying me that i should give a JDBC connection. while my driver is in the classpath. to see where's the error i'm just quering a simple "from obj".

Do you have any idea of the reason of this problem?
thank you


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 3:49 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 4:27 pm 
Newbie

Joined: Sat Aug 27, 2005 2:02 pm
Posts: 13
[quote="christian"]Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: said

Mapping documents: the problem is before the mapping

Code between sessionFactory.openSession() and session.close(): i said, query, plus normal transaction

Full stack trace of any exception that occurs: [java] java.lang.UnsupportedOperationException: The user must supply a JDBC
connection
[java] at org.hibernate.connection.UserSuppliedConnectionProvider.getCo
nnection(UserSuppliedConnectionProvider.java:30)
[java] at org.hibernate.jdbc.ConnectionManager.openConnection(Connectio
nManager.java:298)
[java] at org.hibernate.jdbc.ConnectionManager.getConnection(Connection
Manager.java:110)
[java] at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:13
7)
[java] at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransacti
on.java:49)
[java] at org.hibernate.transaction.JDBCTransactionFactory.beginTransac
tion(JDBCTransactionFactory.java:24)
[java] at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.j
ava:271)
[java] at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.j
ava:1079)


Name and version of the database you are using: mysql, 4-1

The generated SQL (show_sql=true):no sql is generated, i cannot get the jdbc :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 4:32 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/v3/re ... orial.html


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 4:35 pm 
Newbie

Joined: Sat Aug 27, 2005 2:02 pm
Posts: 13
i cannot understand if it's an automessage or not!
I repeat, the tutorial doesn't seems to help, i've getting this exception while everything is where should be.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 4:50 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
No, you haven't configured Hibernate for a database connection. Please follow the tutorial step-by-step.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 5:04 pm 
Newbie

Joined: Sat Aug 27, 2005 2:02 pm
Posts: 13
this is the configuration:

cfg.setProperty("connection.url", "jdbc:mysql://localhost/test);
cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
cfg.setProperty("connection.driver_class", "com.mysql.jdbc.Driver");
cfg.setProperty("connection.username", "root");
cfg.setProperty("connection.password", "pass");
cfg.setProperty("show_sql", "true");
cfg.setProperty("c3p0.min_size", "1");
cfg.setProperty("c3p0.max_size", "20");
cfg.setProperty("c3p0.timeout", "300");
cfg.setProperty("c3p0.max_statements", "50");
cfg.setProperty("c3p0.idle_test_period", "3000");
cfg.addClass ....


what's wrong?
I need to configure in the app's code, and not in a file

Thank you christian


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 5:14 pm 
Newbie

Joined: Sat Aug 27, 2005 2:02 pm
Posts: 13
solved thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 5:33 pm 
Newbie

Joined: Sat Aug 27, 2005 2:02 pm
Posts: 13
I'm sorry Christian,
but nothing has been solved, i reask you, nothing seems to me to be wrong, i'm following the hibernate in action chapter about how to configure the whole, but it does always require me the jdbc connection.

I don't know where to look,

thanks for further help for my dumb question


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 6:00 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
The configuration property names are hibernate.* not a mix of random names you copied from somewhere.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 6:25 pm 
Newbie

Joined: Sat Aug 27, 2005 2:02 pm
Posts: 13
Thank you christian.


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