The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

danclemson (3) [Avatar] Offline
#1
Hi,

I tried to build the example code using maven 2.0.7. It failed at step3.
Please advise. Thanks

C:unzippedpojopia-1.0-SNAPSHOT>mvn install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] POJOs in Action
[INFO] POJOs In Action - Util
[INFO] POJOs in Action - Utils Spring
[INFO] POJOs in Action - shared spring hibernate
[INFO] POJOs in Action - Chapters 4 and 6, ORMUnit for Hibernate
[INFO] POJOs in Action - Chapter 1, Hibernate Banking Example
[INFO] POJOs in Action - Chapter 3, Domain model
[INFO] POJOs in Action - Chapter 9, ORMUnit for iBATIS
[INFO] POJOs in Action - Chapter 13, iBATIS Lock Manager
[INFO] POJOs in Action - Chapter 6, Hibernate domain model
[INFO] POJOs in Action - chapter 7, POJO facade
[INFO] POJOs in Action - Chapter 7, POJO facade, Hibernate
[INFO] POJOs in Action - Chapter 8, Exposed Hibernate Web Application
[INFO] POJOs in Action - shared spring ibatis
[INFO] POJOs in Action - Chapter 9, Transaction Script examples
[INFO] POJOs in Action - Chapter 11, Dynamic queries domain model
[INFO] POJOs in Action - Chapter 11, Hibernate Dynamic Paged Queries
[INFO] POJOs in Action - Chapter 11, Dynamic queries, iBATIS
[INFO] POJOs in Action - Chapter 12, Concurrency, domain model
[INFO] POJOs in Action - Chapter 12, Hibernate concurrency
[INFO] POJOs in Action - Chapter 12, Concurrency, transaction script
[INFO] POJOs in Action - Chapter 13, Offline locking, domain model
[INFO] POJOs in Action - Chapter 13, Hibernate Offline Locking
[INFO] -------------------------------------------------------------------------
---
[INFO] Building POJOs in Action
[INFO] task-segment: [install]
[INFO] -------------------------------------------------------------------------
---
[INFO] [site:attach-descriptor]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Invalid length 769 in LocalVariableTable in class file org/codehaus/plexu
s/util/StringUtils
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.ClassFormatError: Invalid length 769 in LocalVariableTable in class fi
le org/codehaus/plexus/util/StringUtils
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:18smilie
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassL
oader.java:195)
at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassReal
m.java:255)
at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.
java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.apache.maven.plugins.site.AbstractSiteMojo.getInterpolatedSiteDes
criptorContent(AbstractSiteMojo.java:827)
at org.apache.maven.plugins.site.SiteDescriptorAttachMojo.execute(SiteDe
scriptorAttachMojo.java:83)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:27smilie
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Jun 22 14:57:52 EDT 2007
[INFO] Final Memory: 6M/11M
[INFO] ------------------------------------------------------------------------
danclemson (3) [Avatar] Offline
#2
Re: build pojos in action failed
I tried with maven 2.0.1, and got similar error:
C:unzippedpojopia-1.0-SNAPSHOT>mvn install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] POJOs in Action
[INFO] POJOs In Action - Util
[INFO] POJOs in Action - Utils Spring
[INFO] POJOs in Action - shared spring hibernate
[INFO] POJOs in Action - Chapters 4 and 6, ORMUnit for Hibernate
[INFO] POJOs in Action - Chapter 1, Hibernate Banking Example
[INFO] POJOs in Action - Chapter 3, Domain model
[INFO] POJOs in Action - Chapter 9, ORMUnit for iBATIS
[INFO] POJOs in Action - Chapter 13, iBATIS Lock Manager
[INFO] POJOs in Action - Chapter 6, Hibernate domain model
[INFO] POJOs in Action - chapter 7, POJO facade
[INFO] POJOs in Action - Chapter 7, POJO facade, Hibernate
[INFO] POJOs in Action - Chapter 8, Exposed Hibernate Web Application
[INFO] POJOs in Action - shared spring ibatis
[INFO] POJOs in Action - Chapter 9, Transaction Script examples
[INFO] POJOs in Action - Chapter 11, Dynamic queries domain model
[INFO] POJOs in Action - Chapter 11, Hibernate Dynamic Paged Queries
[INFO] POJOs in Action - Chapter 11, Dynamic queries, iBATIS
[INFO] POJOs in Action - Chapter 12, Concurrency, domain model
[INFO] POJOs in Action - Chapter 12, Hibernate concurrency
[INFO] POJOs in Action - Chapter 12, Concurrency, transaction script
[INFO] POJOs in Action - Chapter 13, Offline locking, domain model
[INFO] POJOs in Action - Chapter 13, Hibernate Offline Locking
[INFO] -------------------------------------------------------------------------
---
[INFO] Building POJOs in Action
[INFO] task-segment: [install]
[INFO] -------------------------------------------------------------------------
---
[INFO] Ignoring available plugin update: 2.2-beta-1 as it requires Maven version
2.0.4
[INFO] Ignoring available plugin update: 2.1 as it requires Maven version 2.0.4
[INFO] [install:install]
[INFO] Installing C:unzippedpojopia-1.0-SNAPSHOTpom.xml to Csmilieocuments and
Settingsdliu.m2 epository
etchrisrichardsonpia1.0-SNAPSHOTpia-1.0-SNAPSH
OT.pom
[INFO] -------------------------------------------------------------------------
---
[INFO] Building POJOs In Action - Util
[INFO] task-segment: [install]
[INFO] -------------------------------------------------------------------------
---
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar: C:unzippedpojopia-1.0-SNAPSHOTpia-util argetpia-util-
1.0-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing C:unzippedpojopia-1.0-SNAPSHOTpia-util argetpia-util-1.0
-SNAPSHOT.jar to Csmilieocuments and Settingsdliu.m2 epository
etchrisrichards
onpia-util1.0-SNAPSHOTpia-util-1.0-SNAPSHOT.jar
[INFO] -------------------------------------------------------------------------
---
[INFO] Building POJOs in Action - Utils Spring
[INFO] task-segment: [install]
[INFO] -------------------------------------------------------------------------
---
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar: C:unzippedpojopia-1.0-SNAPSHOTpia-util-spring argetpi
a-util-spring-1.0-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing C:unzippedpojopia-1.0-SNAPSHOTpia-util-spring argetpia-u
til-spring-1.0-SNAPSHOT.jar to Csmilieocuments and Settingsdliu.m2 epository
et
chrisrichardsonpia-util-spring1.0-SNAPSHOTpia-util-spring-1.0-SNAPSHOT.jar
[INFO] -------------------------------------------------------------------------
---
[INFO] Building POJOs in Action - shared spring hibernate
[INFO] task-segment: [install]
[INFO] -------------------------------------------------------------------------
---
[INFO] [install:install]
[INFO] Installing C:unzippedpojopia-1.0-SNAPSHOTshared-spring-hibernatepom.
xml to Csmilieocuments and Settingsdliu.m2 epository
etchrisrichardsonshared-
spring-hibernate1.0-SNAPSHOTshared-spring-hibernate-1.0-SNAPSHOT.pom
[INFO] -------------------------------------------------------------------------
---
[INFO] Building POJOs in Action - Chapters 4 and 6, ORMUnit for Hibernate
[INFO] task-segment: [install]
[INFO] -------------------------------------------------------------------------
---
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[WARNING] While downloading xercessmilieerces:2.0.2
This artifact has been relocated to xercessmilieercesImpl:2.0.2.


[WARNING] While downloading xml-apissmilieml-apis:2.0.2
This artifact has been relocated to xml-apissmilieml-apis:1.0.b2.


[WARNING] While downloading xercessmilieerces:2.0.2
This artifact has been relocated to xercessmilieercesImpl:2.0.2.


[WARNING] While downloading xml-apissmilieml-apis:2.0.2
This artifact has been relocated to xml-apissmilieml-apis:1.0.b2.


[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[WARNING] While downloading xercessmilieerces:2.0.2
This artifact has been relocated to xercessmilieercesImpl:2.0.2.


[WARNING] While downloading xml-apissmilieml-apis:2.0.2
This artifact has been relocated to xml-apissmilieml-apis:1.0.b2.


[WARNING] While downloading xercessmilieerces:2.0.2
This artifact has been relocated to xercessmilieercesImpl:2.0.2.


[WARNING] While downloading xml-apissmilieml-apis:2.0.2
This artifact has been relocated to xml-apissmilieml-apis:1.0.b2.


[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[WARNING] While downloading xercessmilieerces:2.0.2
This artifact has been relocated to xercessmilieercesImpl:2.0.2.


[WARNING] While downloading xml-apissmilieml-apis:2.0.2
This artifact has been relocated to xml-apissmilieml-apis:1.0.b2.


[WARNING] While downloading xercessmilieerces:2.0.2
This artifact has been relocated to xercessmilieercesImpl:2.0.2.


[WARNING] While downloading xml-apissmilieml-apis:2.0.2
This artifact has been relocated to xml-apissmilieml-apis:1.0.b2.


[INFO] [surefire:test]
[INFO] Surefire report directory: C:unzippedpojopia-1.0-SNAPSHOTormunit-hibe
rnate argetsurefire-reports
java.lang.ClassFormatError: Invalid length 769 in LocalVariableTable in class fi
le org/codehaus/plexus/util/StringUtils
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:18smilie
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:26smilie
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.apache.maven.surefire.booter.SurefireBooter.constructParamObjects
(SurefireBooter.java:69smilie
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
ava:776)
[INFO] -------------------------------------------------------------------------
---
[ERROR] BUILD FAILURE
[INFO] -------------------------------------------------------------------------
---
[INFO] There are test failures.
[INFO] -------------------------------------------------------------------------
---
[INFO] For more information, run Maven with the -e switch
[INFO] -------------------------------------------------------------------------
---
[INFO] Total time: 5 seconds
[INFO] Finished at: Fri Jun 22 15:43:13 EDT 2007
[INFO] Final Memory: 8M/14M
[INFO] -------------------------------------------------------------------------
---
ceracm (113) [Avatar] Offline
#3
Re: build pojos in action failed
The javadocs say this about java.lang.ClassFormatError

* Thrown when the Java Virtual Machine attempts to read a class
* file and determines that the file is malformed or otherwise cannot
* be interpreted as a class file.

Looks like some has got corrupted in your local repository, i.e. ~/.m2/repository.
I would delete the plexus related related files/directories and try again.

Chris
danclemson (3) [Avatar] Offline
#4
Re: build pojos in action failed
Tried as suggested.
It worked.

Thanks for the prompt reply.