-->
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: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Fri Sep 11, 2009 9:20 am 
Newbie

Joined: Fri Sep 11, 2009 9:12 am
Posts: 2
Hi,
I've just checked out the hibernate-3.3.2.GA source code from http://anonsvn.jboss.org/repos/hibernat ... e-3.3.2.GA and tried to build it with Maven using Sun JDK 1.5.0.20. I keep getting an error while building hibernate core. I'm new to maven so have no idea what might be wrong, any suggestions are appreciated.

developer@misdev ~/workspace/hibernate $ mvn -e install
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Hibernate Core Parent POM
[INFO] Hibernate Core
[INFO] Hibernate Testing
[INFO] Hibernate Ehcache Integration
[INFO] Hibernate JBossCache Integration
[INFO] Hibernate JBossCache2.x Integration
[INFO] Hibernate OSCache Integration
[INFO] Hibernate SwarmCache Integration
[INFO] Hibernate C3P0 ConnectionProvider
[INFO] Hibernate Proxool ConnectionProvider
[INFO] Hibernate JMX Module
[INFO] Hibernate Testsuite
[INFO] Hibernate Tutorials
[INFO] Hibernate Example
[INFO] Hibernate Web Tutorial
[INFO] Hibernate Maven Plugin
[INFO] Hibernate Manual
[INFO] Hibernate Core - Documentation
[INFO] Hibernate Distribution
[INFO] Hibernate Core Aggregator
WAGON_VERSION: 1.0-beta-2
[INFO] ------------------------------------------------------------------------
[INFO] Building Hibernate Core Parent POM
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /home/developer/workspace/hibernate/parent/pom.xml to /home/developer/.m2/repository/org/hibernate/hibernate-parent/3.3.2.GA/hibernate-parent-3.3.2.GA.pom
[INFO] ------------------------------------------------------------------------
[INFO] Building Hibernate Core
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [antlr:generate {execution: default}]
[INFO] Using Antlr grammar: /home/developer/workspace/hibernate/core/src/main/antlr/hql.g
[INFO] The grammar is already generated.
[INFO] Using Antlr grammar: /home/developer/workspace/hibernate/core/src/main/antlr/hql-sql.g
[INFO] The grammar is already generated.
[INFO] Using Antlr grammar: /home/developer/workspace/hibernate/core/src/main/antlr/sql-gen.g
[INFO] The grammar is already generated.
[INFO] [resources:resources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [injection:bytecode {execution: default}]
[INFO] Adding project compile classpath element : /home/developer/workspace/hibernate/core/target/classes
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/cglib/cglib/2.2/cglib-2.2.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/asm/asm/3.1/asm-3.1.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/javax/security/jaas/1.0.01/jaas-1.0.01.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/javax/security/jacc/1.0/jacc-1.0.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/ant/ant/1.6.5/ant-1.6.5.jar
[INFO] Adding project compile classpath element : /home/developer/.m2/repository/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to replace method body

Embedded error: [source error] javassist.NotFoundException: java.lang.String
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to replace method body
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:584)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:500)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:479)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to replace method body
at org.jboss.maven.plugins.injection.BytecodeInjectionMojo$MethodBodyReturnReplacementTarget.inject(BytecodeInjectionMojo.java:206)
at org.jboss.maven.plugins.injection.AbstractInjectionMojo.execute(AbstractInjectionMojo.java:48)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:453)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
... 16 more
Caused by: javassist.CannotCompileException: [source error] javassist.NotFoundException: java.lang.String
at javassist.CtBehavior.setBody(CtBehavior.java:368)
at javassist.CtBehavior.setBody(CtBehavior.java:334)
at org.jboss.maven.plugins.injection.BytecodeInjectionMojo$MethodBodyReturnReplacementTarget.inject(BytecodeInjectionMojo.java:203)
... 19 more
Caused by: compile error: javassist.NotFoundException: java.lang.String
at javassist.compiler.Javac.compileBody(Javac.java:228)
at javassist.CtBehavior.setBody(CtBehavior.java:360)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Fri Sep 11 15:04:16 CEST 2009
[INFO] Final Memory: 19M/35M
[INFO] ------------------------------------------------------------------------

Thank you,

Martin


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Sat Sep 12, 2009 10:30 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Is there any chance your source code repository and files are set to read-only. Sometimes when everything is in a read-only state, I see the message that core classes like java.lang.String cannot be found.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Sat Sep 12, 2009 5:48 pm 
Newbie

Joined: Fri Sep 11, 2009 9:12 am
Posts: 2
Thank you for your suggestion. The user running maven is the owner of the files and has rw permissions so thats not the problem I'm affraid :(


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Wed Sep 23, 2009 5:37 am 
Beginner
Beginner

Joined: Wed Jul 09, 2008 5:34 am
Posts: 41
Location: Brno, Czech Republic
Do you still face this issue? I'm interested in knowing your environment, so that I can reproduce it.


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Fri Nov 13, 2009 3:40 pm 
Newbie

Joined: Fri Nov 13, 2009 3:39 pm
Posts: 1
I had the same problem. I fixed it by raising the memory limit for Maven.

export MAVEN_OPTS=-Xmx256m

After setting this environment variable the build worked fine.


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Mon Nov 30, 2009 4:02 pm 
Newbie

Joined: Mon Dec 11, 2006 8:28 am
Posts: 13
Well, I'm afraid that didn't work for me -- that is to say, it did work, but then suddenly stopped working for the next builds. I tried bumping the heap up to 1GB, but still No.

Anyone with any other ideas (I've also made sure nothing is readonly).

_________________
Michael Berkowitz


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Mon Nov 30, 2009 10:20 pm 
Newbie

Joined: Mon Nov 30, 2009 10:13 pm
Posts: 5
try to enlarge ur virtual memory in ur computer management program.

_________________
links of london
ugg boots
wow gold


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Tue Dec 01, 2009 4:48 am 
Newbie

Joined: Mon Dec 11, 2006 8:28 am
Posts: 13
Thanks, yvangkwheng, but I'm already running with 3GB of physical and 4.5GB of virtual memory (this is under XP Pro SP3). I've since done some more work and gotten to roughly where I need to be, so I'll share the experience here:

First, I updated my code from SVN to hibernate/core/trunk's HEAD, which at the time was up to revision 18101.

That didn't help.

So, I tried upgrading my Maven from 2.1.0 to 2.2.1.

That made things worse, because now it couldn't find the repository for downloading stuff anymore (I had cleaned out the old repository/org/hibernate and jboss/maven so as to start fresh). Fortunately, when I Googled that problem I found somebody on the Hibernate JIRA who explained that one has to either update Maven's settings.xml (which I don't know how to do) or copy some lines that he included into the parent/pom.xml file.

My next problem was that, since the newer version no-longer required falling back to JDK 1.5 for the build, I used my regular JDK, which is 1.6.0_16. Uh Uh: The setting for the allowable Java version was set to "1.5,1.6", and since 1.6.0_16 is considered to be greater than 1.6, it failed. Again. Not knowing how to express the version with such delicacy in Maven, I just changed the setting to "1.5," and moved on.

I found that the build continued to die on the javassist error (stating either that it couldn't find String or that it couldn't find Version) -- but only occasionally, so that I could make some progress at last.

Next was the fact that some of the pom files refer to the compiler as ${java16_home}/bin/javac, which was no good for me since -- not being a Maven maven -- I didn't know how to set the value of java16_home. I did a global replace of that string with the absolute path on my machine to javac and was in business again.

I am now at the point where a compile is failing in the envers/reader, but I can live without that, so I'm good.

I have no complaints, mind you, this being open-source code, but if any of the Hibernate/JBoss folks have some time to spare I think it would be useful -- for them as well as us -- if he were to whip the build into shape.

_________________
Michael Berkowitz


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Tue Dec 01, 2009 6:55 am 
Beginner
Beginner

Joined: Wed Jul 09, 2008 5:34 am
Posts: 41
Location: Brno, Czech Republic
Quote:
That made things worse, because now it couldn't find the repository for downloading stuff anymore (I had cleaned out the old repository/org/hibernate and jboss/maven so as to start fresh). Fortunately, when I Googled that problem I found somebody on the Hibernate JIRA who explained that one has to either update Maven's settings.xml (which I don't know how to do) or copy some lines that he included into the parent/pom.xml file.

The only thing you need is the JBoss Repository information. More info here: https://www.hibernate.org/422.html

Quote:
My next problem was that, since the newer version no-longer required falling back to JDK 1.5 for the build, I used my regular JDK, which is 1.6.0_16. Uh Uh: The setting for the allowable Java version was set to "1.5,1.6", and since 1.6.0_16 is considered to be greater than 1.6, it failed. Again. Not knowing how to express the version with such delicacy in Maven, I just changed the setting to "1.5," and moved on.

Not sure I understood your problem. If you followed the instructions on the above link and it didn't succeed, you are more than welcome to open a JIRA (to fix either the documentation or the build)

Quote:
I found that the build continued to die on the javassist error (stating either that it couldn't find String or that it couldn't find Version) -- but only occasionally, so that I could make some progress at last.

Yes, this is one issue we are struggling to fix. It *seems* to be fixed based on a commit by Steve yesterday. If you still face this issue, feel free to comment on http://opensource.atlassian.com/project ... e/HHH-4625 .

Quote:
Next was the fact that some of the pom files refer to the compiler as ${java16_home}/bin/javac, which was no good for me since -- not being a Maven maven -- I didn't know how to set the value of java16_home. I did a global replace of that string with the absolute path on my machine to javac and was in business again.

I know a build should "work out of the box", but it's a bit complicated to do that in Hibernate, due to the different JDBC versions. That's why you need to set this property on your settings.xml or pass it via -Djava16_home , as specified in the first URL of this reply.

Quote:
I am now at the point where a compile is failing in the envers/reader, but I can live without that, so I'm good.

There should be no compilation failures in the build. Period. :-) If you face it, JIRA please.

Quote:
I have no complaints, mind you, this being open-source code, but if any of the Hibernate/JBoss folks have some time to spare I think it would be useful -- for them as well as us -- if he were to whip the build into shape.

We are here :-) There are actually two problems: first, a "special" maven property is needed to build Hibernate (jdk6_home). This is documented in the website, but nobody really reads the manual (you have to agree with me on this one). Second, you got caught by a bug which we've been fighting for some time (the javassist). So, *usually*, there should be no problems in the build, specially in trunk. Occasionally, yes, as trunk is the place where things can break from time to time, but *usually* it should just work.


Top
 Profile  
 
 Post subject: Re: Unable to build hibernate-3.3.2.GA with maven
PostPosted: Tue Dec 01, 2009 7:12 am 
Newbie

Joined: Mon Dec 11, 2006 8:28 am
Posts: 13
Thanks, jpkrohling. What I'm writing right now will add nothing to anyone's understanding of the issues brought up in this thread -- I include this preface as an aid to the reader.

I just felt compelled to comment on the patience, lucidity and obvious eagerness to help exhibited by your reply.

Should I need to rebuild in the future I will examine the various links you provide and hopefully avoid the pitfalls I mentioned, but I wholly agree with you that the probability of someone reading the manual before embarking on a task like this is low, and can testify that I for one did not. I'm frankly not likely to in the future either, because rebuilding Hibernate is a small corner of what I do, and I do it rarely, so it's hard for me to justify the time. Still, that's not your fault and it shouldn't become your problem.

If I can find a spare half-hour I'll try to recreate the envers problem and post it -- though if I follow your instructions it may just go away. The Java-version issue is, I think, real, but again if I find the time I'll expand on that.

Once again, my thanks.

_________________
Michael Berkowitz


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.