-->
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.  [ 1 post ] 
Author Message
 Post subject: JBoss Dev Studio - Error generating Java code from mappings
PostPosted: Thu Dec 18, 2008 9:37 pm 
Newbie

Joined: Thu Dec 18, 2008 9:24 pm
Posts: 1
Location: Australia
Hello,
I am using JBoss Studio (2.0.0.Beta1, windows XP, JDK 1.6.11, Oracle 10G R2) to generate java code from hibernate configuration files. I have manually created some classes and successfully created and run a hibernate session, updating an Oracle table. In short, hibernate is working fine, if I create all code and config by hand. My issue is with Hibernate tools.

When I try to configure Hibernate code generation in the IDE to generate Java it fails with:

org.hibernate.console.HibernateConsoleRuntimeException: Could not resolve audit_fact.hbm.xml to a file
at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.pathToFile(EclipseLaunchConsoleConfigurationPreferences.java:56)
at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.pathToFile(EclipseLaunchConsoleConfigurationPreferences.java:45)
at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.strToFile(EclipseLaunchConsoleConfigurationPreferences.java:38)
at org.hibernate.eclipse.console.EclipseLaunchConsoleConfigurationPreferences.getConfigXMLFil(EclipseLaunchConsoleConfigurationPreferences.java:72)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:272)
at org.hibernate.console.ConsoleConfiguration.configureStandardConfiguration(ConsoleConfiguration.java:575)
at org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:547)
....

As far as I can tell, it seems to look for a file 'audit_fact.hbm.xml' - no matter what my configuration files are called (I actually renamed my file to 'audit_fact.hbm.xml' to see if it would work). This was the file name initially, before I renamed it, so it may be just a caching problem.



Here are my config files (both in java /src directory)

audit_fact.hbm.xml:

<hibernate-mapping>
<class name="nsw.osr.service.audit.data.AuditFact" table="ESB_AUDIT_FACT">
<id name="id" column="AUDIT_ID" type="long">
<generator class="sequence">
<param name="sequence">ESB.ESB_AUDIT_FACT_SEQ</param>
</generator>
</id>

<property name="receivedTime" type="date" column="RECEIVED_TIME" />
<property name="sourceID" type="int" column="SOURCE_ID" />
<property name="destinationID" type="int" column="DESTINATION_ID" />
<property name="fileName" type="string" column="FILENAME" />
<property name="pathID" type="int" column="PATH_ID" />
<property name="userID" type="int" column="USER_ID" />
</class>

</hibernate-mapping>

hibernate.cfg.xml:

<hibernate-configuration>
<session-factory name="SergeLocalORCL">
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
<property name="hibernate.connection.username">system</property>
<property name="hibernate.default_schema">ESB</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<mapping resource="audit_fact.hbm.xml" />
</session-factory>
</hibernate-configuration>


Your help appreciated,
Serge


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.