-->
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.  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: hbm2ddl not working for annotations (NoSuchMethodError)
PostPosted: Wed Aug 24, 2005 2:07 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Hibernate version:
Hibernate 3.1beta2
Hibernate Annotations 3.1beta4

$ java -version
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)


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">
<hibernate-configuration>
<session-factory>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.query.substitutions">true 1, false 0</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://192.168.69.10/bk?useUnicode=true</property>
<property name="hibernate.connection.username">bk</property>
<property name="hibernate.connection.password">bk</property>
<!-- Mapping files -->
<mapping package="com.som.bk.server.data"/>
<mapping class="com.som.bk.server.data.CommandName"/>
</session-factory>
</hibernate-configuration>



build.xml section
<!-- javac classpath -->
<path id="classpath.default">
<fileset dir="${dir.lib}" >
<include name="**/*.jar" />
</fileset>
<pathelement path="${dir.src.java}"/>
<pathelement path="${dir.work.java}"/>
</path>
<property name="classpath.default" refid="classpath.default"/>

<!-- build tools classpath -->
<path id="classpath.build">
<fileset dir="${dir.build.lib}" >
<include name="**/*.jar" />
</fileset>
<pathelement path="${dir.build.class}"/>
<path refid="classpath.default"/>
</path>
<property name="classpath.build" refid="classpath.build"/>


<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath.build"/>


<target name="dbschema" depends="init,compile" description="Generate the database schema">
<hibernatetool destdir="${dir.work.sql}">
<classpath refid="classpath.build"/>
<annotationconfiguration configurationfile="${dir.work.conf}/hibernate.cfg.xml"/>
<hbm2ddl drop="false" outputfilename="${ant.project.name}-schema.sql"/>
</hibernatetool>
</target>


CommandName.java
@Entity
public class CommandName implements Serializable
{
public static final long serialVersionUID = 1;

private static org.apache.log4j.Logger log
= org.apache.log4j.Logger.getLogger(CommandName.class);

public CommandName() {}
public CommandName(String name)
{
this.name = name;
}

@Id
public long getId() {return id;}
public void setId(long x) {id = x;}
private long id = -1;
public static final String ID = "id";

public String getName() {return name;}
public void setName(String x) {name = x;}
public static final String NAME = "name";
private String name = null;

//---------------------------------------------------------------------------- Logic
public String toString() {
return new ToStringBuilder(this)
.append("id", getId())
.append("name", getName())
.toString();
}

public boolean equals(Object other) {
if ( !(other instanceof CommandName) ) return false;
CommandName castOther = (CommandName) other;
return new EqualsBuilder()
.append(this.getId(), castOther.getId())
.isEquals();
}

public int hashCode() {
return new HashCodeBuilder()
.append(getId())
.toHashCode();
}
}


Debug level Hibernate log excerpt:
$ ant dbschema
Buildfile: build.xml

init:

compile:

dbschema:
[hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[hibernatetool] 14:50:06,640 [INFO ] Environment - Hibernate 3.1 beta 2
[hibernatetool] 14:50:06,656 [INFO ] Environment - hibernate.properties not found
[hibernatetool] 14:50:06,671 [INFO ] Environment - using CGLIB reflection optimizer
[hibernatetool] 14:50:06,671 [INFO ] Environment - using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 14:50:06,859 [INFO ] Configuration - configuring from file: hibernate.cfg.xml
[hibernatetool] 14:50:06,968 [DEBUG] DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
[hibernatetool] 14:50:06,984 [DEBUG] DTDEntityResolver - found http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
[hibernatetool] 14:50:07,156 [DEBUG] Configuration - show_sql=true
[hibernatetool] 14:50:07,156 [DEBUG] Configuration - dialect=net.sf.hibernate.dialect.PostgreSQLDialect
[hibernatetool] 14:50:07,156 [DEBUG] Configuration - hibernate.query.substitutions=true 1, false 0
[hibernatetool] 14:50:07,156 [DEBUG] Configuration - hibernate.connection.driver_class=org.postgresql.Driver
[hibernatetool] 14:50:07,156 [DEBUG] Configuration - hibernate.connection.url=jdbc:postgresql://192.168.69.10/bk?useUnicode=true
[hibernatetool] 14:50:07,156 [DEBUG] Configuration - hibernate.connection.username=bk
[hibernatetool] 14:50:07,171 [DEBUG] Configuration - hibernate.connection.password=bk
[hibernatetool] 14:50:07,171 [DEBUG] AnnotationConfiguration - null<-org.dom4j.tree.DefaultAttribute@cd5f8b [Attribute: name package value "com.som.bk.server.data"]
[hibernatetool] 14:50:07,171 [INFO ] AnnotationConfiguration - Mapping package com.som.bk.server.data

BUILD FAILED
java.lang.NoSuchMethodError: org.hibernate.cfg.Mappings.<init>(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;)V

Total time: 2 seconds


--------

Does anyone know what would cause this problem?
I think I did the same setup as in the documentation, although the annotations documentation contains errors (malformed xml and such) so I'm not sure.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 2:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - hibernate annotations latest release doesnt work with hibernate 3.1beta2 ... you'll have to use the alpha4 tools.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 5:10 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Okay, I replaced hibernate3.jar and hibernate-tools.jar with the ones from hibernate-tools-3.0.0.alpha4a, but now I get this error:

$ ant dbschema
Buildfile: build.xml

init:

compile:

dbschema:
[hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)

BUILD FAILED
java.lang.ExceptionInInitializerError

Total time: 1 second


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 6:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
run with ant -debug and see what the debug exception states...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 9:40 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
The long and short of the error is this:
Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)


I don't know what would be causing this since I only have one instance of the commons logging jarfile:

$ find |grep log
./build/class/log4j.properties
./lib/commons-logging-1.0.4.jar
./lib/log4j-1.2.9.jar
./src/conf/log4j.properties
./work/conf/log4j.properties


The classloader explanation at http://qos.ch/logging/classloader.jsp talks about the child classloader getting ahold of the same jarfile... I'm not sure if that's what's happening here.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 9:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - this is a known bug in alpha4 (which is fixed in alpha4)

solution: put all the required jars in the taskdef classpath.

Search the forum/jira for more details.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 7:39 pm 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Ok, got past that hurdle... One more to go I think. Thanks for the help btw.

It seems to die when I try to process a OneToMany tag:

Role.java
@Entity
public class Role implements Serializable
{
...
@Id
public long getId() {return id;}
public void setId(long x) {id = x;}
public static final String ID = "id";
private long id = -1;

public static final String NAME = "name";
private String name = null;
public String getName() {return name;}
public void setName(String x) {name = x;}

@OneToMany
public Set<Permission> getPermissions() {return permissions;}
public void setPermissions(Set<Permission> x) {permissions = x;}
public boolean hasPermission(Permission x) {return permissions.contains(x);}
private Set<Permission> permissions = new HashSet<Permission>();

@OneToMany
public Set<CommandName> getCommandNames() {return commandNames;}
public void setCommandNames(Set<CommandName> x) {commandNames = x;}
public boolean hasCommandName(CommandName x) {return commandNames.contains(x);}
private Set<CommandName> commandNames = new HashSet<CommandName>();
...
}


Log
...
[hibernatetool] 08:20:35,843 [DEBUG] EntityBinder - Import with entity name=Role
[hibernatetool] 08:20:35,843 [DEBUG] AnnotationBinder - Processing com.som.bk.server.data.Role per property access
[hibernatetool] 08:20:35,859 [DEBUG] AnnotationBinder - Processing annotations of com.som.bk.server.data.Role.id
[hibernatetool] 08:20:35,875 [DEBUG] Ejb3Column - Binding column id unique false
[hibernatetool] 08:20:35,875 [DEBUG] AnnotationBinder - id is an id
[hibernatetool] 08:20:35,875 [DEBUG] SimpleValueBinder - building SimpleValue for id
[hibernatetool] 08:20:35,875 [DEBUG] PropertyBinder - Building property id
[hibernatetool] 08:20:35,875 [DEBUG] PropertyBinder - Cascading id with null
[hibernatetool] 08:20:35,875 [DEBUG] AnnotationBinder - Bind @EmbeddedId on id
[hibernatetool] 08:20:35,875 [DEBUG] AnnotationBinder - Processing annotations of com.som.bk.server.data.Role.commandNames
[hibernatetool] 08:20:35,875 [DEBUG] Ejb3Column - Binding column null unique false
[hibernatetool] 08:20:35,890 [DEBUG] Ejb3Column - Binding column null unique false

BUILD FAILED
java.lang.NoSuchMethodError: javax.persistence.OneToMany.targetEntity()Ljava/lang/Class;

Total time: 3 seconds


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 2:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Look at http://opensource2.atlassian.com/projec ... se/HBX-295 and see if some of the workarounds there solves your issue when using alpha4

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 5:14 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Yes, I used that to solve the previous problem. This time it's bitching about a missing method, which is definitely not a classpath issue. Were it a problem in the classpath, it would throw a NoClassDefFoundError.


My build.xml defines the classpath and task like so:

<!-- hibernate tool classpath -->
<path id="classpath.htool">
<fileset dir="${dir.build.lib}" >
<include name="**/*.jar" />
</fileset>
<pathelement path="${dir.build.class}"/>
<fileset dir="${dir.lib}" >
<include name="**/*.jar" />
</fileset>
</path>

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
<classpath refid="classpath.htool"/>
<classpath path="${dir.work.class}"/>
</taskdef>

<target name="dbschema" depends="init,compile" description="Generate the database schema.">
<hibernatetool destdir="${dir.work.sql}">
<annotationconfiguration configurationfile="${dir.work.conf}/hibernate.cfg.xml"/>
<hbm2ddl drop="false" outputfilename="${ant.project.name}-schema.sql"/>
</hibernatetool>
</target>




It manages to build the simpler data objects, but it chokes when it tries to interpret the commandNames property from Role, which was compiled as:

@OneToMany(mappedBy="commandName")
public Set<CommandName> getCommandNames() {return commandNames;}
public void setCommandNames(Set<CommandName> x) {commandNames = x;}
public boolean hasCommandName(CommandName x) {return commandNames.contains(x);}
private Set<CommandName> commandNames = new HashSet<CommandName>();



The last part of the debug and stack trace:

[hibernatetool] 17:57:06,843 [DEBUG] AnnotationBinder - Processing annotations of com.som.bk.server.data.Role.commandNames
[hibernatetool] 17:57:06,843 [DEBUG] Ejb3Column - Binding column null unique false
Finding class org.hibernate.annotations.IndexColumn
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/annotations/IndexColumn.class
Class org.hibernate.annotations.IndexColumn loaded from ant loader (parentFirst)
Finding class javax.persistence.JoinTable
Loaded from D:\bk\bk\lib\ejb3-persistence.jar javax/persistence/JoinTable.class
Class javax.persistence.JoinTable loaded from ant loader (parentFirst)
Finding class org.hibernate.cfg.IndexColumn
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/IndexColumn.class
Class org.hibernate.cfg.IndexColumn loaded from ant loader (parentFirst)
[hibernatetool] 17:57:06,859 [DEBUG] Ejb3Column - Binding column null unique false
Finding class org.hibernate.cfg.annotations.CollectionBinder
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/CollectionBinder.class
Class org.hibernate.cfg.annotations.CollectionBinder loaded from ant loader (parentFirst)
Finding class org.hibernate.mapping.Backref
Loaded from D:\bk\bk\lib\hibernate3.jar org/hibernate/mapping/Backref.class
Class org.hibernate.mapping.Backref loaded from ant loader (parentFirst)
Finding class org.hibernate.cfg.annotations.CollectionBinder$1
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/CollectionBinder$1.class
Class org.hibernate.cfg.annotations.CollectionBinder$1 loaded from ant loader (parentFirst)
Finding class org.hibernate.cfg.annotations.CollectionBinder$2
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/CollectionBinder$2.class
Class org.hibernate.cfg.annotations.CollectionBinder$2 loaded from ant loader (parentFirst)
Finding class org.hibernate.cfg.annotations.ArrayBinder
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/ArrayBinder.class
Finding class org.hibernate.cfg.annotations.ListBinder
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/ListBinder.class
Class org.hibernate.cfg.annotations.ListBinder loaded from ant loader (parentFirst)
Class org.hibernate.cfg.annotations.ArrayBinder loaded from ant loader (parentFirst)
Finding class org.hibernate.cfg.annotations.SetBinder
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/SetBinder.class
Class org.hibernate.cfg.annotations.SetBinder loaded from ant loader (parentFirst)
Finding class org.hibernate.cfg.annotations.MapBinder
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/MapBinder.class
Class org.hibernate.cfg.annotations.MapBinder loaded from ant loader (parentFirst)
Finding class org.hibernate.cfg.annotations.BagBinder
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/cfg/annotations/BagBinder.class
Class org.hibernate.cfg.annotations.BagBinder loaded from ant loader (parentFirst)
Finding class org.hibernate.mapping.Collection
Loaded from D:\bk\bk\lib\hibernate3.jar org/hibernate/mapping/Collection.class
Class org.hibernate.mapping.Collection loaded from ant loader (parentFirst)
Finding class org.hibernate.mapping.Set
Loaded from D:\bk\bk\lib\hibernate3.jar org/hibernate/mapping/Set.class
Class org.hibernate.mapping.Set loaded from ant loader (parentFirst)
Finding class javax.persistence.MapKey
Loaded from D:\bk\bk\lib\ejb3-persistence.jar javax/persistence/MapKey.class
Class javax.persistence.MapKey loaded from ant loader (parentFirst)
Finding class javax.persistence.OrderBy
Loaded from D:\bk\bk\lib\ejb3-persistence.jar javax/persistence/OrderBy.class
Class javax.persistence.OrderBy loaded from ant loader (parentFirst)
Finding class org.hibernate.annotations.OrderBy
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/annotations/OrderBy.class
Class org.hibernate.annotations.OrderBy loaded from ant loader (parentFirst)
Finding class org.hibernate.annotations.Sort
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/annotations/Sort.class
Class org.hibernate.annotations.Sort loaded from ant loader (parentFirst)
Finding class org.hibernate.annotations.Cascade
Loaded from D:\bk\bk\lib\hibernate-annotations.jar org/hibernate/annotations/Cascade.class
Class org.hibernate.annotations.Cascade loaded from ant loader (parentFirst)

BUILD FAILED
java.lang.NoSuchMethodError: javax.persistence.OneToMany.targetEntity()Ljava/lang/Class;
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.targetEntity()Ljava/lang/Class;
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1009)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:575)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:194)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:849)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:51)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:38)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
... 7 more
--- Nested Exception ---
java.lang.NoSuchMethodError: javax.persistence.OneToMany.targetEntity()Ljava/lang/Class;
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1009)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:575)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:194)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:849)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:51)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:38)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 3 seconds


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 5:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm....could you try and use the cvs version of annotaitons ? just to see if it is a simple versioning issue..

btw. it can be a classloader issue if you have two different versions of the jars available in chained classloaders...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 7:21 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Argh.. having troubles getting it to compile...

I looked to http://www.hibernate.org/268.html for instructions on getting the source.
It says I don't have to get Hibernate3, but the build script in HibernateExt expects to find the ant jar in ../hibernate-3.0/lib so I checked out Hibernate3 as well.

Also, running build.bat jar copylib doesn't work:

D:\projects\HibernateExt>build.bat jar copylib

D:\projects\HibernateExt>set HIBERNATECORE=D:\projects\HibernateExt\..\Hibernate3

D:\projects\HibernateExt>java -cp "D:\projects\HibernateExt\..\Hibernate3\lib\ant-launcher-1.6.5.jar" org.apache.tools.ant.launch.Launcher -lib D:\projects\HibernateExt\..\Hibernate3/lib jar copylib
Buildfile: build.xml

init:
[echo] Build Hibernate Extensions-3.0 (2005-08-25 08:11:22)

BUILD FAILED
D:\projects\HibernateExt\common\common-build.xml:140: D:\projects\HibernateExt\src\java not found.

Total time: 1 second

And indeed, there is no src directory under HibernateExt =(


I got it to work partway by checking out Hibernate3 and renaming it to hibernate-3.0, and then just running build.bat and letting it build the default target, but then common/common-build.xml died because it expects hibernate to be in ../hibernate-3.1.

After hacking build.bat, and then running the build in hibernate-3.1, I got it to compile partway, but then another part of the build failed because it was looking for ../Hibernate3/.

So I renamed hibernate-3.1 back to Hibernate3, then hacked build.bat and common/common-build.xml to point to ../Hibernate3/ and it got pretty far.


Now it's failing like this:

init:
[echo] Build Hibernate Annotations-3.1beta5 (2005-08-25 07:59:41)
[mkdir] Created dir: D:\projects\HibernateExt\metadata\build\classes
[copy] Copying 2 files to D:\projects\HibernateExt\metadata\build

compile:
[javac] Compiling 118 source files to D:\projects\HibernateExt\metadata\build\classes
[javac] D:\projects\HibernateExt\metadata\src\java\org\hibernate\cfg\AnnotationConfiguration.java:126: cannot find symbol
[javac] symbol : constructor ExtendedMappings(java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.List,java.util.List,org.hibernate.cfg.NamingStrategy,java.util.Map,java.util.Map,java.util.Map,java.util.Map<java.lang.String,java.util.Map<java.lang.String,org.hibernate.mapping.Join>>,java.util.Map<java.lang.Class,org.hibernate.cfg.AnnotatedClassType>,java.util.Map,java.util.List,java.util.Map<java.lang.String,java.util.Properties>,java.util.Map<org.hibernate.mapping.Table,java.util.List<java.lang.String[]>>,java.util.Map<java.lang.String,java.lang.String>,java.util.Map<java.lang.String,java.lang.String>)
[javac] location: class org.hibernate.cfg.ExtendedMappings
[javac] return new ExtendedMappings(
[javac] ^
[javac] 1 error

BUILD FAILED
D:\projects\HibernateExt\build.xml:25: The following error occurred while executing this line:
D:\projects\HibernateExt\metadata\build.xml:40: Compile failed; see the compiler error output for details.

Total time: 1 minute 0 seconds


Is there something I didn't configure right? Should I be hacking the build files?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 7:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - the build.bat stuff should point to the right place...

but the compile error you get is different than what i got from current cvs - as in, I dont get a compile error when i do the build...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 8:02 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Where are you pulling from?

I grabbed the sources using:

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/hibernate checkout -P HibernateExt

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/hibernate checkout -P Hibernate3

Then went into the HibernateExt dir and ran build.bat

It fails pretty quickly at that point since it's looking for the wrong directory name (build.bat looks for ../hibernate-3.0/lib/ant-launcher-1.6.3.jar when in reality it should look for ../Hibernate3/lib/ant-launcher-1.6.5.jar).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 8:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - quick fix is to just go into metadata and run ..\build from there

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 8:45 am 
Regular
Regular

Joined: Tue Jun 08, 2004 8:24 am
Posts: 57
Same result =(

Basically, I do the following:

- check out HibernateExt

- check out Hibernate3

- create HibernateExt/ejb-api/build.properties, which contains: jdk15.home=D:\java\jdk-5.0.3

- create HibernateExt/metadata/build.properties, which contains: jdk15.home=D:\java\jdk-5.0.3

- run build.bat inside Hibernate3

- copy hibernate-3.1/hibernate3.jar into Hibernate3 (HibernateExt needs it inside the Hibernate3 dir)

- modify HibernateExt/build.bat, changing hibernate-3.0 to Hibernate3 and changing ant-launcher-1.6.3.jar to ant-launcher-1.6.5.jar

- modify HibernateExt/common/common-build.xml, changing hibernate-3.1 to Hibernate3 (line 39)

- go into HibernateExt/metadata

- run ..\build jar copylib
Actually even if I just run ../build I still get the same result.


When it runs the build script, it fails like so:


D:\projects\HibernateExt\metadata>..\build jar copylib

D:\projects\HibernateExt\metadata>set HIBERNATECORE=D:\projects\HibernateExt\..\Hibernate3

D:\projects\HibernateExt\metadata>java -cp "D:\projects\HibernateExt\..\Hibernate3\lib\ant-launcher-1.6.5.jar" org.apache.tools.ant.launch.Launcher -lib D:\projects\HibernateExt\..\Hibernate3/lib jar copylib
Buildfile: build.xml

init:
[echo] Build Hibernate Annotations-3.1beta5 (2005-08-25 09:32:48)

compile:
[javac] Compiling 62 source files to D:\projects\HibernateExt\metadata\build\classes
[javac] D:\projects\HibernateExt\metadata\src\java\org\hibernate\cfg\AnnotationConfiguration.java:126: cannot find symbol
[javac] symbol : constructor ExtendedMappings(java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.Map,java.util.List,java.util.List,org.hibernate.cfg.NamingStrategy,java.util.Map,java.util.Map,java.util.Map,java.util.Map<java.lang.String,java.util.Map<java.lang.String,org.hibernate.mapping.Join>>,java.util.Map<java.lang.Class,org.hibernate.cfg.AnnotatedClassType>,java.util.Map,java.util.List,java.util.Map<java.lang.String,java.util.Properties>,java.util.Map<org.hibernate.mapping.Table,java.util.List<java.lang.String[]>>,java.util.Map<java.lang.String,java.lang.String>,java.util.Map<java.lang.String,java.lang.String>)
[javac] location: class org.hibernate.cfg.ExtendedMappings
[javac] return new ExtendedMappings(
[javac] ^
[javac] 1 error

BUILD FAILED
D:\projects\HibernateExt\metadata\build.xml:40: Compile failed; see the compiler error output for details.

Total time: 3 seconds



Are you running it under linux? Maybe I'll try it on a linux machine to see if it makes a difference.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 31 posts ]  Go to page 1, 2, 3  Next

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.