-->
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.  [ 7 posts ] 
Author Message
 Post subject: Bloody "The user must supply a JDBC connection"
PostPosted: Tue Sep 28, 2004 1:30 am 
Newbie

Joined: Tue Sep 28, 2004 1:21 am
Posts: 4
Hi guys

Please find beloew my hipernate.properties file + error message. I'm successfully configure hibernate with the hibernate.propertires file but I always get this error message. Regarding the manual it should work.

Do I miss something here ? Any help is very much appreciated ?

Cheers
Rolf



[b]hibernate.properties:[/b]
hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
hibernate.connection.url jdbc:microsoft:sqlserver://localhost;DatabaseName=edoc09
hibernate.connection.username edoc_appserver
hibernate.connection.password password
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statements=50
hibernate.dialect = net.sf.hibernate.dialect.SQLServerDialect



[b]Error Message:[/b]


05:32:29,343 INFO [Environment] Hibernate 2.1.6
05:32:29,375 INFO [Environment] loaded properties from resource hibernate.properties: {hibernate.c3
p0.timeout=1800, hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver, hib
ernate.cglib.use_reflection_optimizer=true, hibernate.c3p0.max_statements=50, hibernate.dialect=net.
sf.hibernate.dialect.SQLServerDialect, hibernate.c3p0.max_size=20, hibernate.c3p0.min_size=5, hibern
ate.connection.username=edoc_appserver, hibernate.connection.url=jdbc:microsoft:sqlserver://localhos
t;DatabaseName=edoc09, hibernate.connection.password=password}
05:32:29,375 INFO [Environment] using CGLIB reflection optimizer
05:32:29,390 INFO [Configuration] Mapping resource: au/com/psa/edoc/dbmanager/persistentClasses/Mes
sage.hbm.xml
05:32:29,625 INFO [Binder] Mapping class: au.com.psa.edoc.dbmanager.persistentClasses.Message -> Me
ssage
05:32:30,593 INFO [STDOUT] Created Hibernate Configuration successfull
05:32:30,593 INFO [Configuration] processing one-to-many association mappings
05:32:30,593 INFO [Configuration] processing one-to-one association property references
05:32:30,593 INFO [Configuration] processing foreign key constraints
05:32:30,640 INFO [Dialect] Using dialect: net.sf.hibernate.dialect.SQLServerDialect
05:32:30,656 INFO [SettingsFactory] Use outer join fetching: true
05:32:30,656 WARN [UserSuppliedConnectionProvider] No connection properties specified - the user mu
st supply JDBC connections
05:32:30,671 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA
environment, use of process level read-write cache is not recommended)
05:32:30,671 INFO [SettingsFactory] Use scrollable result sets: false
05:32:30,671 INFO [SettingsFactory] Use JDBC3 getGeneratedKeys(): false
05:32:30,671 INFO [SettingsFactory] Optimize cache for minimal puts: false
05:32:30,671 INFO [SettingsFactory] Query language substitutions: {}
05:32:30,671 INFO [SettingsFactory] cache provider: net.sf.hibernate.cache.EhCacheProvider
05:32:30,687 INFO [Configuration] instantiating and configuring caches
05:32:30,890 INFO [SessionFactoryImpl] building session factory
05:32:31,203 INFO [ReflectHelper] reflection optimizer disabled for: au.com.psa.edoc.dbmanager.pers
istentClasses.Message, IllegalArgumentException: Cannot find matching method/constructor
05:32:31,296 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configure
d
05:32:31,296 INFO [STDOUT] Created Hibernate Session Factory successfull
05:32:31,296 INFO [STDOUT] DBManagerBean - Init
05:32:31,421 ERROR [LogInterceptor] RuntimeException:
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConn
ectionProvider.java:32)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:286)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3326)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3286)
at net.sf.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:42)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:765)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at au.com.psa.edoc.dbmanager.session.DBManagerBean.Init(DBManagerBean.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta
iner.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI
nterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance
Interceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.
java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331
)
at org.jboss.ejb.Container.invoke(Container.java:723)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)


Top
 Profile  
 
 Post subject: Re: Bloody "The user must supply a JDBC connection"
PostPosted: Tue Sep 28, 2004 2:00 am 
Newbie

Joined: Tue Sep 28, 2004 1:56 am
Posts: 1
I want to know.


<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>

<property name="show_sql">true</property>

<property name="connection.datasource">ORACLEEIP</property>

i used jndi


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 6:14 am 
Newbie

Joined: Tue Sep 28, 2004 1:21 am
Posts: 4
I was thinking about it for a while and it just doens't make sense to me.

Well the hibernate.propertie is obviously loaded (see below) but how can it be that I get this warning regarding the UserSuppliedConnectionProvider, which is the source of my problem ??

Cheers
Rolf



05:32:30,656 WARN [UserSuppliedConnectionProvider] [b]No connection properties specified - the user mu
st supply JDBC connections [/b]

[b]loaded properties from resource hibernate.properties[/b]: {hibernate.c3
p0.timeout=1800, hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver, hib
ernate.cglib.use_reflection_optimizer=true, hibernate.c3p0.max_statements=50, hibernate.dialect=net.
sf.hibernate.dialect.SQLServerDialect, hibernate.c3p0.max_size=20, hibernate.c3p0.min_size=5, hibern
ate.connection.username=edoc_appserver, hibernate.connection.url=jdbc:microsoft:sqlserver://localhos
t;DatabaseName=edoc09, hibernate.connection.password=password}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 7:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
In your Configuration code, you must be somehow hammering the properties specified in hibernate.properties


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 7:49 am 
Newbie

Joined: Tue Sep 28, 2004 1:21 am
Posts: 4
Thanks for your quick responds.

Well that what I do in my configuration code:

------------------------------------------------------
Configuration cfg = new Configuration();
cfg.addResource("au/com/psa/edoc/dbmanager/persistentClasses/Mes
sage.hbm.xml");
cfg.setProperty(System.getProperties)

SessionFactory sessionFact = cfg.buildSessionFactory();

Session session = sessionFact.openSession();
Message newMessage = new Message("Test");
session.save(newMessage);
session.close();


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 8:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
The culprit (adjusted for your typos):

Code:
cfg.setProperties(System.getProperties())


read the javadoc


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 8:21 am 
Newbie

Joined: Tue Sep 28, 2004 1:21 am
Posts: 4
Thanks mate, I really appreciated your efforts

Cheers
Rolf


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