-->
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: java.lang.UnsupportedOperationException:The user must suppl
PostPosted: Mon Sep 06, 2004 7:43 am 
Beginner
Beginner

Joined: Wed Mar 24, 2004 8:43 am
Posts: 42
Hibernate version:
2
Mapping documents:
user.hbm.xml,product.hbm.xml,order.hbm.xml,orderitem.hbm.xml
Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
mysql 4
Debug level Hibernate log excerpt:

Hi all

here i have used hibernate.cfg.xml for the database connection, but the system dispalyed the


Could not execute action
java.lang.UnsupportedOperationException: The user must supply a JDBC connection



here is my hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>

<session-factory>
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://gimhanp:3306/asiri</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
net.sf.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.cache.provider_class">
net.sf.hibernate.cache.HashtableCacheProvider
</property>
<property name="hibernate.hbm2ddl.auto">update</property>

<mapping resource="com/virtusa/example/data/Product.hbm.xml"/>
<mapping resource="com/virtusa/example/data/Order.hbm.xml"/>
<mapping resource="com/virtusa/example/data/OrderItem.hbm.xml"/>
<mapping resource="com/virtusa/example/data/User.hbm.xml"/>


</session-factory>




Could not execute action
java.lang.UnsupportedOperationException: The user must supply a JDBC connection



Sep 6, 2004 5:10:50 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.29
Sep 6, 2004 5:10:51 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru
e
Sep 6, 2004 5:10:51 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNul
l=true
Sep 6, 2004 5:10:52 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', retur
nNull=true
Sep 6, 2004 5:10:55 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
Sep 6, 2004 5:10:55 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Sep 6, 2004 5:10:55 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=C:\Program Files\Apache Group\Tomcat 4.1
\conf\jk2.properties
WebappClassLoader: validateJarFile(E:\hiberExample\part4\war\WEB-INF\lib\servlet
.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: ja
vax/servlet/Servlet.class
WARN - Skipping XML action configuration for actions.xml
WARN - Unable to find 'webwork.multipart.saveDir' property setting. Defaulting
to javax.servlet.context.tempdir
INFO - Action dispatcher initialized
INFO - Hibernate 2.1 final
INFO - hibernate.properties not found
INFO - using CGLIB reflection optimizer
INFO - Mapping resource: com/virtusa/example/data/Order.hbm.xml
INFO - Mapping class: com.virtusa.example.data.Order -> orders
INFO - Mapping resource: com/virtusa/example/data/OrderItem.hbm.xml
INFO - Mapping class: com.virtusa.example.data.OrderItem -> items
INFO - Mapping resource: com/virtusa/example/data/Product.hbm.xml
INFO - Mapping class: com.virtusa.example.data.Product -> products
INFO - Mapping resource: com/virtusa/example/data/User.hbm.xml
INFO - Mapping class: com.virtusa.example.data.User -> users
INFO - processing one-to-many association mappings
INFO - Mapping collection: com.virtusa.example.data.Order.orderItems -> items
INFO - Mapping collection: com.virtusa.example.data.Product.productItems -> ite
ms
INFO - processing one-to-one association property references
INFO - processing foreign key constraints
WARN - No dialect set - using GenericDialect: The dialect was not set. Set the
property hibernate.dialect.
INFO - Using dialect: net.sf.hibernate.dialect.GenericDialect
INFO - Use outer join fetching: false
WARN - No connection properties specified - the user must supply JDBC connectio
ns
INFO - No TransactionManagerLookup configured (in JTA environment, use of proce
ss level read-write cache is not recommended)
INFO - Use scrollable result sets: false
INFO - Query language substitutions: {}
INFO - cache provider: net.sf.ehcache.hibernate.Provider
INFO - instantiating and configuring caches
INFO - building session factory
INFO - no JNDI name configured
ERROR - Could not execute action
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnect
ion(UserSuppliedConnectionProvider.java:32)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:262
)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3155)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3138)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.j
ava:61)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:699)

at net.sf.hibernate.loader.Loader.doQuery(Loader.java:180)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:128)
at net.sf.hibernate.loader.Loader.list(Loader.java:918)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:983)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1473)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1452)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1444)
at com.virtusa.example.actions.ProductList.doExecute(ProductList.java:30
)
at webwork.action.ActionSupport.execute(ActionSupport.java:151)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.
java:131)
at webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:1
74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
rValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
t.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
3)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:666)
at java.lang.Thread.run(Thread.java:536)
:32)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 06, 2004 12:21 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The hibernate.Cfg.xml seems not to be find. It has to be loaded (and visible) by the same classloader that load Hibernate

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 06, 2004 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I'd say there is no connection pool configured.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 06, 2004 4:26 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
christian wrote:
I'd say there is no connection pool configured.

Nope, even the Dialect is not configured, this is a config file issue

_________________
Emmanuel


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.