Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
soarwolf
5 Post subject: An internal error occurred during "Generating Artifacts  PostPosted: Jun 29, 2006 - 09:13 PM



Joined: Jun 29, 2006
Posts: 4

I'm having problems with Hibernate mapping generation with 4.1 GA.
Eclipse SDK: 3.1.2
MyEclipse: 4.1.1GA
Mysql: 5.0
Driver: mysql-connector-java-3.1.12-bin.jar

CREATE TABLE users (
user_id int(24) unsigned NOT NULL auto_increment,
username varchar(50) NOT NULL,
password varchar(10) NOT NULL,
PRIMARY KEY(user_id)
);

When I connect to the mysql, it is ok, I can see all the databases, but When I Hibernate mapping generation, it give me this error:
An internal error occurred during "Generating Artifacts"
Please help me.
Here is hibernate.cfg.xml

<hibernate-configuration>

<session-factory>
<property name="connection.username">root</property>
<property name="connection.url">jdbc:mysql://localhost/demo</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="myeclipse.connection.profile">vipinfo</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>

</session-factory>

</hibernate-configuration>

Thank you very much![/b]
 
 View user's profile Send private message  
Reply with quote Back to top
soarwolf
Post subject:   PostPosted: Jun 29, 2006 - 09:30 PM



Joined: Jun 29, 2006
Posts: 4

and still the Myeclipse give me warnning
your hibernate project is configured for jdbc:mysql://localhost/Demo, but you are generating artifacts from jdbc:mysql://localhost/Demo.
 
 View user's profile Send private message  
Reply with quote Back to top
support-snpe
Post subject:   PostPosted: Jun 30, 2006 - 01:12 AM
Moderator
Moderator


Joined: Feb 03, 2006
Posts: 1117

soarwolf ,

Can you post log for 'Generating Artifacts' error
Open Log Error view and paste content of this error in forum (view is in Windows-Show view-Other-PDE Runime-Error log view)

Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
soarwolf
Post subject:   PostPosted: Jun 30, 2006 - 02:52 PM



Joined: Jun 29, 2006
Posts: 4

Hello: snpe

Here is error log
java.lang.NullPointerException
at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1877)
at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:71)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$5.execute(GenerateArtifactsJob.java:405)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:400)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:266)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
 
 View user's profile Send private message  
Reply with quote Back to top
support-snpe
Post subject:   PostPosted: Jun 30, 2006 - 03:04 PM
Moderator
Moderator


Joined: Feb 03, 2006
Posts: 1117

Hey soarwolf ,

It looks that you have typing error in hibernate.cfg.xml

Please check this line :

<property name="connection.url">jdbc:mysql://localhost/demo</property>

Is your database Demo or demo - set same database name like in database explorer
It's better taht you edit hibernate.cfg.xml with MyEclipse configuration editor (when you have good setting for connection profile and you have it) and you simple choose connection profile - MyEclipse will do other for you.

I suppose that your warning is

your hibernate project is configured for jdbc:mysql://localhost/Demo, but you are generating artifacts from jdbc:mysql://localhost/demo.

different is Demo and demo

Best regards
 
 View user's profile Send private message  
Reply with quote Back to top
soarwolf
Post subject:   PostPosted: Jun 30, 2006 - 03:21 PM



Joined: Jun 29, 2006
Posts: 4

Hey snpe
Thank you very much! I make mistake when i set up Database driver
Have a good day!
 
 View user's profile Send private message  
Reply with quote Back to top
support-snpe
Post subject:   PostPosted: Jun 30, 2006 - 04:08 PM
Moderator
Moderator


Joined: Feb 03, 2006
Posts: 1117

Hey soarwolf,

You are welcome.I'm glad for your success

Thank you
 
 View user's profile Send private message  
Reply with quote Back to top
rteodosio
Post subject:   PostPosted: Sep 21, 2006 - 12:16 AM
Registered Member
Registered Member


Joined: Jul 05, 2005
Posts: 10

hello guys,

I am getting the same error when I am trying to Hibernate Reverse Engineering on MyEclipse 5. Have you guys encountered any problems in "Generating Artifacts" when doing this Reverse Engineering?

Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
support-snpe
Post subject:   PostPosted: Sep 21, 2006 - 12:58 AM
Moderator
Moderator


Joined: Feb 03, 2006
Posts: 1117

rteodosio ,

Please send us more details

- database and jdbc driver version and vendor
- error log

Please, open new thread

Thanks
Peco
 
 View user's profile Send private message  
Reply with quote Back to top
rteodosio
Post subject:   PostPosted: Sep 21, 2006 - 05:53 PM
Registered Member
Registered Member


Joined: Jul 05, 2005
Posts: 10

Hi Peco,

Here is my configuration in hibernate.cfg.xml.

I have used the preconfigure Database Driver in the DB Connect Profile. This set up this configuration below.

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="max_fetch_depth">1</property>
<property name="myeclipse.connection.profile">SYB_NJES_DEV_02</property>
<property name="connection.url">jdbc:sybase:Tds:sybnjesdev02.ny.cantor.com:4200</property>
<property name="connection.username">rteodosio</property>
<property name="connection.password">espeed</property>
<property name="connection.driver_class">com.sybase.jdbc2.jdbc.SybDataSource</property>
<property name="dialect">org.hibernate.dialect.SybaseDialect</property>

</session-factory>

</hibernate-configuration>

I could drag and drop the tables from DB Browswer into Hibernate Mapping, but executing the reverse engineering mapping gives me the same error message.

Thanks,
Ron
 
 View user's profile Send private message  
Reply with quote Back to top
rteodosio
Post subject:   PostPosted: Sep 21, 2006 - 05:58 PM
Registered Member
Registered Member


Joined: Jul 05, 2005
Posts: 10

Hi Peco,

Here is the error log:

java.lang.NoSuchMethodError: org.apache.log4j.Category.log(Ljava/lang/String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Throwable;)V
at org.apache.commons.logging.impl.Log4JCategoryLog.info(Log4JCategoryLog.java:109)
at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:41)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1877)
at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:71)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$6.execute(GenerateArtifactsJob.java:514)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:70)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:509)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:293)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

Thanks,
Ron
 
 View user's profile Send private message  
Reply with quote Back to top
rteodosio
Post subject:   PostPosted: Sep 21, 2006 - 09:17 PM
Registered Member
Registered Member


Joined: Jul 05, 2005
Posts: 10

Hi Peco,

After many head banging, the problem here is the version of log4j being used in hibernate as log provided this evidence:

java.lang.NoSuchMethodError: org.apache.log4j.Category.log(Ljava/lang/String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Throwable;)

in log4j version in the MyEclipse 5 uses Piority object instead of Level. I found an article talking about this incompatiblity:

http://mail-archives.apache.org/mod_mbox/logging-log4j-dev/200512.mbox/%3C438F0EEB.7000104@ptc.com%3E

Do you know by chance what version of log4j are you guys using in development of MyEclipse 5 in hibernate lib?

Thanks,
Ron
 
 View user's profile Send private message  
Reply with quote Back to top
hidejay
Post subject:   PostPosted: Oct 12, 2006 - 03:30 PM



Joined: Oct 12, 2006
Posts: 3

Hi, rteodosio,
Here is the error log:
org.hibernate.exception.GenericJDBCException: Could not get list of tables from database. Probably a JDBC driver problem.
Configured schema:dbo
Configured catalog:BookShop
<SQLException while getting schemas>
<SQLException while getting catalogs>
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.handleSQLException(JDBCMetaDataDialect.java:86)
at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:50)
at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:400)
at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:65)
at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:102)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:87)
at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:134)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$6.execute(GenerateArtifactsJob.java:514)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:70)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:509)
at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:293)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]无效的描述符索引
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.putTablePart(JDBCMetaDataDialect.java:203)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.access$000(JDBCMetaDataDialect.java:25)
at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect$1.convertRow(JDBCMetaDataDialect.java:77)
at org.hibernate.cfg.reveng.dialect.ResultSetIterator.next(ResultSetIterator.java:47)
... 11 more
 
 View user's profile Send private message  
Reply with quote Back to top
hidejay
Post subject:   PostPosted: Oct 12, 2006 - 03:33 PM



Joined: Oct 12, 2006
Posts: 3

Hi Peco,

Here is my configuration in hibernate.cfg.xml.

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="connection.username">sa</property>
<property name="connection.url">jdbc:odbc:LocalServer</property>
<property name="myeclipse.connection.profile">sqlserver</property>
<property name="connection.driver_class">
sun.jdbc.odbc.JdbcOdbcDriver
</property>
<property name="dialect">
org.hibernate.dialect.SQLServerDialect
</property>

</session-factory>

</hibernate-configuration>
 
 View user's profile Send private message  
Reply with quote Back to top
hidejay
Post subject:   PostPosted: Oct 12, 2006 - 03:37 PM



Joined: Oct 12, 2006
Posts: 3

i'm a j2ee new learner,who can help me?
MSN:chelski2007@hotmail.com
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits