-->
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.  [ 2 posts ] 
Author Message
 Post subject: hbm2java, I cannot put the properties files in classpath
PostPosted: Tue Oct 26, 2004 1:19 pm 
Beginner
Beginner

Joined: Fri Oct 15, 2004 2:54 pm
Posts: 33
Location: Austin, TX
Hibernate version:
2.1.3
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class name="de.gloegl.road2hibernate.Event" table="EVENTS">
<id name="id" column="uid" type="long">
<generator class="increment"/>
</id>
<property name="date" type="timestamp"/>
<property name="title" column="eventtitle"/>
</class>

</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:

Name and version of the database you are using:
MySQL 4.x, but I am not there yet :-)
The generated SQL (show_sql=true):
N/A

I am trying middle-out development (hand-done XML mapping docs, generating code and schema from this) because it just makes sense to me right now. I am doing this all in eclipse 3.0 if it matters.

My project has a lib folder with hibernate, mysql and hibernate-ext directories, all with jars in them. My src folder has a mapping folder with the event.hbm.xml file listed above, and a properties folder with the hibernate.properties and log4j.properties files in it.

OK, so I am *this* close to getting hbm2java working with the really simple mapping doc shown above.

I am plugging along, changing an ant build.xml file I downloaded, and testing it out. I get an error about no appenders found and please init the log4j system, so I add the properties directory to my classpath in the ant build file and get the following error:

Buildfile: D:\Eclipse30\workspace\HibernateExample\build.xml
generate:
BUILD FAILED: D:\Eclipse30\workspace\HibernateExample\build.xml:23: D:\Eclipse30\workspace\HibernateExample\src\properties} not found.
Total time: 891 milliseconds

I'm looking right at the directory, and right at the properties files it contains.
Here's the build.xml file:


<project name="Try Hibernate" default="run" basedir=".">

<property name="src.home" value="${basedir}/src" />
<property name="lib.home" value="${basedir}/lib" />
<property name="generated.home" value="${basedir}/src" />
<property name="generate.force" value="true" />

<path id="lib.class.path">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<!-- added to solve the log4j error, causing current one -->
<fileset dir="src/properties}">
<include name="**/*.properties" />
</fileset>

<pathelement location="." />
<pathelement location="generated" />
</path>

<target name="generate">
<java classname="net.sf.hibernate.tool.hbm2java.CodeGenerator" fork="true">

<arg value="src/mapping/event.hbm.xml" />
<classpath refid="lib.class.path" />
</java>
</target>
(... other targets removed to save eyestrain ...)
</project>


I KNOW this is a simple problem, but I am stuck anyway. Any help would be greatly appreciated.

--PK

_________________
--Pierce Krouse


Top
 Profile  
 
 Post subject: grrr ...
PostPosted: Tue Oct 26, 2004 10:09 pm 
Beginner
Beginner

Joined: Fri Oct 15, 2004 2:54 pm
Posts: 33
Location: Austin, TX
Arrgh -- sorry about that folks. I found the problem and fixed it.

_________________
--Pierce Krouse


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