-->
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: where cfg file should be placed inside the web application
PostPosted: Sat Dec 15, 2007 11:29 pm 
Newbie

Joined: Sat Dec 15, 2007 11:19 pm
Posts: 2
the stack trace is:
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection
(UserSuppliedConnectionProvider.java:30)

i knoe that the problem is in specifying cfg file location

please help me out .thanks in advance

upendra


Top
 Profile  
 
 Post subject: Re: where cfg file should be placed inside the web applicati
PostPosted: Mon Dec 17, 2007 12:26 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
upendram wrote:
the stack trace is:
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection
(UserSuppliedConnectionProvider.java:30)

i knoe that the problem is in specifying cfg file location

please help me out .thanks in advance

upendra



WB-INF/classes should be fine. Where do you put it?


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 1:01 am 
Newbie

Joined: Sat Dec 15, 2007 11:19 pm
Posts: 2
Hi

thank u Farzad.I placed it in classes folder only but still it gives me same error.is there something worng with this statement:

private static final Configuration CFG = new Configuration().configure("/hibernate.cfg.xml");

and how to test it whether it is able to recognize the cfg file or not.
if i delcare a connection variable and make connection and declare
sessionFactory.openSession(conn);

then everything is cool and even able to insert values.

thanks in advance

Upendra.M


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 1:35 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
upendram wrote:
Hi

thank u Farzad.I placed it in classes folder only but still it gives me same error.is there something worng with this statement:

private static final Configuration CFG = new Configuration().configure("/hibernate.cfg.xml");

and how to test it whether it is able to recognize the cfg file or not.
if i delcare a connection variable and make connection and declare
sessionFactory.openSession(conn);

then everything is cool and even able to insert values.

thanks in advance

Upendra.M


Your problem should be somewhere else because I did a small test and it finds the cfg file. Can you show us how your cfg file looks like? UserSuppliedConnectionProvider is used when you don't specify a connection setting.


Farzad-


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.