-->
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.  [ 10 posts ] 
Author Message
 Post subject: XDoclet defective?
PostPosted: Fri May 14, 2004 8:27 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
Hello,

I'm trying to run the [hibernatedoclet] task from a build script . However, the XDoclet doesn't parse my Hibernate file. This should be simple, but I've been working on this for several weeks with no success. Have read most available tutorials and online instructions on the topic, but am mainly using http://www.hibernate.org/66.html. There is no output other than the target name 'xdoclet:' in the command window. Can anyone tell me what the possible causes might be?



<path id="xdoclet.classpath">
<fileset dir="F:\XDoclet121\lib">
<include name="*.jar"/>
</fileset>
</path>

<taskdef
name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask">
<classpath refid="xdoclet.classpath"/>
</taskdef>

<hibernatedoclet
destdir="${build.mappings}"
excludedtags="@version,@author,@todo"
force="true"
verbose="true"
mergedir="${build.mappings}">

<fileset dir="${src.hibernate}">
<include name="*.java"/>
</fileset>

<hibernate version="2.0"/>
</hibernatedoclet>





HERE IS THE CLASS.

package com.kemaiev.jzudi.hibernate;

import java.io.Serializable;
import com.kemaiev.jzudi.Company;

/** A business entity class representing a Company.
*
* @author Itchy
* @hibernate.class table="COMPANY"
*/
public class CompanyHibernateImpl implements Company, Serializable{
private Long companyID;
private String description;
private String companyName;
private String contact;
private String street;
private String zip;
private String city;
private String telephone;
private String telefax;


/** The default constructor for Hibernate to instantiate with.*/
public CompanyHibernateImpl(){
}



/**
* hibernate.id generator-class="sequence"
* column="COMPANY_ID"
*
*/
public Long getCompanyID() {
return (CompanyID);
}
public void setCompanyID(Long long1) {
companyID = long1;
}



/**
*@hibernate.property column="DESCRIPTION"
*
*/
public String getDescription() {
return (description);
}
public void setDescription(String string) {
description = string;
}






/**
* @hibernate.property column="COMPANY_NAME"
*
*/
public String getCompanyName() {
return (companyName);
}
public void setCompanyName(String string) {
companyName = string;
}





/**
* @hibernate.property column="CONTACT"
*
*/
public String getContact() {
return (contact);
}
public void setContact(String string) {
contact = string;
}




/**
* @hibernate.property column="STREET"
*
*/
public String getStreet() {
return (street);
}
public void setStreet(String string) {
street = string;
}




/**
* @hibernate.property column="ZIP"
*
*/
public String getZIP() {
return (zip);
}
public void setZIP(String string) {
zip = string;
}




/**
* @hibernate.property column="CITY"
*
*/
public String getCity() {
return (city);
}
public void setCity(String string) {
city = string;
}



/**
* @hibernate.property column="TELEPHONE"
*
*/
public String getTelephone() {
return (telephone);
}
public void setTelephone(String string) {
telephone = string;
}



/**
* @hibernate.property column="TELEFAX"
*
*/
public String getTelefax() {
return (telefax);
}
public void setTelefax(String string) {
telefax = string;
}

}


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 14, 2004 9:01 am 
Newbie

Joined: Thu May 13, 2004 8:54 am
Posts: 2
I think the problem might be in this part of your ant build file:

Code:
<fileset dir="${src.hibernate}">
  <include name="*.java"/>
</fileset>


If src.hibernate does not point to the exact directory where your java files are you should change <include name="*.java"/>" to <include name="**/*.java"/> to make it look in subdirectories as well.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 14, 2004 9:29 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
Thanks for responding kiemdoder,

I also thought that it wasn't finding the files, but here is the structure:

D:\jZUDIApp\MiddleTier\src\hibernate
MiddleTier is where the build.xml resides.
basedir="."
<property name="src" location="src"/>
<property name="src.hibernate" location="${src}/hibernate"/>

The .java files are located in hibernate. So isn't this correct?

<fileset dir="${src.hibernate}">
<include name="*.java"/>
</fileset>


I'm open to any suggestions. This whole thing is really bizarre. I've tried downloading different versions of XDoclet. Now I have v.1.2.1. Also, Ant v.1.6.1.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 15, 2004 12:50 am 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Run the build with Ant debugging on to see what files it is picking up. As kiemdoder answered you, I bet that you will see that you are not getting any *.java files being processed.


Sherman


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 15, 2004 6:58 am 
Beginner
Beginner

Joined: Tue May 11, 2004 12:08 pm
Posts: 38
Location: Davis,CA,USA
hi i think thats path problem. Try to use...


<include name="**/*.java">

and it should work perfectly


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 11:51 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
Hi,

I changed the path to
<include name="**/*.java">

but it didn't work. I've previously tried many formats, including this one. Running Ant with the -v switch still displays nothing. Doesn't seem to find the files.

Like I said before, this is bizarre. I've even tried downloading new copies of XDoclet from sourceforge, but it makes no difference.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 12:06 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
I have the following system variables set:
XDOCLET_HOME = F:\xdoclet121\lib
CLASSPATH = F:\Hibernate21; C:\j2sdk14204\lib\tools.jar

Does the CLASSPATH and XDOCLET_HOME look right? Do I need to include any additional references to XDoclet class files or jars in build.xml or anywhere else?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 1:17 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Is your source file in src\hibernate\com\kemaiev\jzudi\hibernate?

Does the source file compile on its own?

Because you are implementing com.kemaiev.jzudi.Company, try including that in the hibernatedoclet path.


Sherman


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 4:06 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
sgwood,

Now that is an interesting thought. Unfortunately, I am no longer in the office, so it'll have to wait until tomorrow. But for now, my source directory structure looks like this...

The hibernate .java files are located in:
D:\jZUDIApp\MiddleTier\src\hibernate


When I compile this to D:\jZUDIApp\MiddleTier\build the package declaration automatically causes the com\kemaiev\jzudi\hibernate structure to get created within the build directory.

It is possible that, instead of going to **/src/hibernate, XDoclet is reading the package declaration and getting pointed to a non-existent source directory.

I'll know for sure tomorrow. Thanks!

Itchy


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 18, 2004 10:39 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
That did the trick. Ulimately, I had to create a source directory that looks exactly like the build directory. I couldn't just rely on a simplified source directory structure.

ie.
D:\jZUDIApp\MiddleTier\src\com\kemaiev\jzudi\hibernate
instead of:
D:\jZUDIApp\MiddleTier\src\hibernate

Then, the fileset had to look like this:
<fileset dir="${src}">
<include name="**/hibernate/*.java"/>
</fileset>

This seems to be the only fileset format that works with XDoclet. Or at least, I couldn't find any others that worked.

Thanks a bunch sgwood and all others who posted.

Regards,
Itchy


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