-->
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: SchemaExport not finding JDBC connection
PostPosted: Sun Aug 08, 2004 10:44 pm 
Newbie

Joined: Thu Jul 15, 2004 6:33 pm
Posts: 9
Location: Mill Valley, CA
It looks like schemaexport finds a jdbc connection, based on second
line of build output. But then it bails with "user must supply JDBC connections".

Many thanks for any pointers.

-BC

------------------------------------------------
Hibernate version:

2.1.5

Mapping documents:

hibernate.properties:

hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost/nrd
hibernate.connection.username bc
hibernate.connection.password bc

hibernate.show_sql true


Full stack trace of any exception that occurs:

schema-export:
[schemaexport] [main] INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1.5
[schemaexport] [main] INFO net.sf.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1,


hibernate.connection.username=bc, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:mysql://localhost/nrd, hibernate.show_sql=true, hibernate.connection.password=bc, hibernate.connection.pool_size=1}


[schemaexport] [main] INFO net.sf.hibernate.cfg.Environment - using java.io streams to persist binary types
[schemaexport] [main] INFO net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
[schemaexport] [main] INFO net.sf.hibernate.cfg.Configuration - Mapping file: C:\1-AbundantPlanet\ap\build\classes\org\apnp\nrd\Persona.hbm.xml
[schemaexport] [main] DEBUG net.sf.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
[schemaexport] [main] DEBUG net.sf.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
[schemaexport] [main] INFO net.sf.hibernate.cfg.Binder - Mapping class: org.apnp.nrd.Persona -> PERSONA
[schemaexport] [main] DEBUG net.sf.hibernate.cfg.Binder - Mapped property: id -> ID_PERSONA, type: long
[schemaexport] [main] DEBUG net.sf.hibernate.cfg.Binder - Mapped property: nameFirst -> nameFirst, type: string
[schemaexport] [main] DEBUG net.sf.hibernate.cfg.Binder - Mapped property: nameMiddle -> nameMiddle, type: string
[schemaexport] [main] DEBUG net.sf.hibernate.cfg.Binder - Mapped property: nameLast -> nameLast, type: string
[schemaexport] [main] DEBUG net.sf.hibernate.cfg.Binder - Mapped property: email -> email, type: string
[schemaexport] [main] INFO net.sf.hibernate.dialect.Dialect - Using dialect: net.sf.hibernate.dialect.MySQLDialect
[schemaexport] [main] INFO net.sf.hibernate.cfg.Configuration - processing one-to-many association mappings
[schemaexport] [main] INFO net.sf.hibernate.cfg.Configuration - processing one-to-one association property references
[schemaexport] [main] INFO net.sf.hibernate.cfg.Configuration - processing foreign key constraints
[schemaexport] [main] INFO net.sf.hibernate.cfg.Configuration - processing one-to-many association mappings
[schemaexport] [main] INFO net.sf.hibernate.cfg.Configuration - processing one-to-one association property references
[schemaexport] [main] INFO net.sf.hibernate.cfg.Configuration - processing foreign key constraints
[schemaexport] [main] INFO net.sf.hibernate.tool.hbm2ddl.SchemaExport - Running hbm2ddl schema export
[schemaexport] [main] INFO net.sf.hibernate.tool.hbm2ddl.SchemaExport - exporting generated schema to database


[schemaexport] [main] WARN net.sf.hibernate.connection.UserSuppliedConnectionProvider - No connection properties specified - the user must supply JDBC connections
[schemaexport] [main] ERROR net.sf.hibernate.tool.hbm2ddl.SchemaExport - schema export unsuccessful
[schemaexport] java.lang.UnsupportedOperationException: The user must supply a JDBC connection


[schemaexport] at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:32)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:119)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:84)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:142)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:301)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
[schemaexport] at org.apache.tools.ant.Main.runBuild(Main.java:632)
[schemaexport] at org.apache.tools.ant.Main.startAnt(Main.java:183)
[schemaexport] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
[schemaexport] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)


Name and version of the database you are using:

MySQL 4.0.18-max-debug
Connector: mysql-connector-java-3.0.14.jar


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2004 8:18 am 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
I have downloaded 2.1.5 from CVS and was able to run a schema export out of the box. Most likely it is something in your environment.


1. How are you running the SchemaExport?

2. Is the propeties file you have provided above, the entire thing? If it is not, please provide the entire thing.

3. Are you sure that you do not have any other hibernate.properties or hibernate.cfg.xml in your classpath when running this. By default Hibernate will use the xml config and override any settings found in the properties file.

_________________
Matt Veitas


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2004 8:25 am 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
I do not see anything wrong with the code in ConnectionProviderFactory that would lead to your errors. By default if the hibernate.connection.url property is set, your ConnectionProvider should be the DriverManagerConnectionProvider. At last resort, it uses the UserSuppliedConnectionProvider! Sounds like you might have a type in your ant script.

Can you provide the ant target you are using to run this as well as any properties you have set in the ant script that are related to the task.

_________________
Matt Veitas


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 10, 2004 12:30 am 
Newbie

Joined: Thu Jul 15, 2004 6:33 pm
Posts: 9
Location: Mill Valley, CA
Matt,

Thanks for your suggestions, they got me looking in the right
direction. I did had both hibernate.properties and hibernate.cfg.xml
files in the classpath, and was bollixing it up with this build line:

<schemaexport properties="${dir.metadata}/hibernate.cfg.xml"

Changing that to

<schemaexport config="${dir.metadata}/hibernate.cfg.xml"

and removing the hibernate.properties files, got schemaexport going
and under control (from the cfg.xml file).

Thanks again,

-BC


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.