Back Forum Reply New

Spring Batch 2.1.5 Samples Broken

I just downloaded the latest version of Spring Batch v2.1.5 and started to run through the Getting Started Guide.  While executing the steps in the quot;Maven on the Command-linequot; section using 'mvn test' and I got the error below.  Any ideas on what might be happening?
Downloading: maven2/org/ap...s/maven-surefi
re-plugin/2.4.3/maven-surefire-plugin-2.4.3.jar
Downloading: maven2/com/sp...r/com.springso
urce.bundlor.maven/1.0.0.RELEASE/com..bundlor.maven-1.0.0.RELEASE.po
m
[INFO] Unable to find resource 'com..bundlor:com..bundlo
r.mavenom:1.0.0.RELEASE' in repository central (maven2)
Downloading: m...rnal/com/sprin
gsource/bundlor/com..bundlor.maven/1.0.0.RELEASE/com..bu
ndlor.maven-1.0.0.RELEASE.pom
[INFO] Unable to find resource 'com..bundlor:com..bundlo
r.mavenom:1.0.0.RELEASE' in repository com..repository.bundles.ext
ernal (m...ndles/external)
Downloading: maven2/com/sp...r/com.springso
urce.bundlor.maven/1.0.0.RELEASE/com..bundlor.maven-1.0.0.RELEASE.po
m
[INFO] Unable to find resource 'com..bundlor:com..bundlo
r.mavenom:1.0.0.RELEASE' in repository central (maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: com..bundlor:com..bundlor.  maven
Reason: POM 'com..bundlor:com..bundlor  .maven' not found
in repository: Unable to download the artifact from any repository com..bundlor:com..bundlor.  mavenom:1.0.0.RELEASE
from the specified remote repositories: com..repository.bundles.external (maven/bundles/external), central (maven2)for project com..bundlor:com..bundlor.  maven

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26 seconds
[INFO] Finished at: Fri Dec 17 13:27:51 EST 2010
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------

.s3.amazonaws.comlt;/idgt;        lt;namegt;Fix repository for missing bundlorlt;/namegt;        lt;uclgt;maven/bundles/releaselt;/uclgt;    lt;/pluginRepositorygt;lt;/pluginRepositoriesgt;lt;repositoriesgt;    lt;repositorygt;        lt;idgt;com..repository.bundles.releaselt;/idgt;        lt;namegt;SpringSource Enterprise Bundle Repository - SpringSource Bundle Releaseslt;/namegt;        lt;uclgt;maven/bundles/releaselt;/uclgt;    lt;/repositorygt;    lt;repositorygt;        lt;idgt;com..repository.bundles.externallt;/idgt;        lt;namegt;SpringSource Enterprise Bundle Repository - External Bundle Releaseslt;/namegt;        lt;uclgt;maven/bundles/externallt;/uclgt;    lt;/repositorygt;lt;/repositoriesgt;       lt;/profilegt;
Now you can run the:mvn test -Pspring

Now, on the 2.1.6 release I've got another problem which is that it fails with the following error:

Code:
[INFO] [antrun:run {execution: generate-sql}]
[INFO] Executing tasks [typedef] Could not load definitions from resource foundrylogic/vpp/typedef.properties. It could not be found. [taskdef] Could not load definitions from resource foundrylogic/vpp/taskdef.properties. It could not be found.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Problem: failed to create task or type vppcopy
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any lt;presetdefgt;/lt;macrodefgt; declarations have taken place.
Anyone know how to fix that? (I still need to google a bit about it, but at least the other problem is fixed )

Cheers,
/Benoit

There's actually already a profile in the Spring Batch POMs called quot;bootstrapquot;.  You should be able to use that as per the README to force a download of stuff that isn't in repo1.  I know the README isn't in the ZIP distro yet (there's a JIRA for that), but it is the first thing you should see on github.

Good to know, I've just checked out the readme from github and I'm now following it...

Thanks for the super quick reply

btw - still having the build error about

Code:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Problem: failed to create task or type vppcopy
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any lt;presetdefgt;/lt;macrodefgt; declarations have taken place.
Any idea what might be wrong here?

Looks like a problem with dependencies still, but it should only affect the command line build - if you go into an IDE it will probably work.  It works for me on the command line, but I definitely already have everything downloaded.  This is the samples project we are talking about, right?

Yes, this is the sample project and I'm building from the command line.

Here is my maven setup:

Code:
mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_22
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: quot;mac os xquot; version: quot;10.6.6quot; arch: quot;x86_64quot; Family: quot;macquot;
I tried downloading the vpp files from the vpp projects and using them there, but no luck

I then tried to disable the sql generating to at least get the tests to compile and see what I could do from here... but then now I'm getting the following errors:

Code:
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

error: error reading /Users/benoit/.m2/repository/org//batch/spring-batch-test/2.1.6.RELEASE/spring-batch-test-2.1.6.RELEASE.jar; cannot read zip file
/opt/src/spring-batch-2.1.6.RELEASE/samples/spring-batch-samples/src/main/java/org//batch/sample/domain/order/internal/OrderItemReader.java:[23,37] package org..batch.item does not exist
But the actual file exists and seems to be ok:

Code:
jar -tf /Users/benoit/.m2/repository/org//batch/spring-batch-core/2.1.6.RELEASE/spring-batch-core-2.1.6.RELEASE.jar
META-INF/
META-INF/MANIFEST.MF
org/
org//
org//batch/
etc...
I really don't know what to do from here

Cheers for the help, it's really appreciated
/Benoit

Hey, good news about the compilation failure I've had yesterday.

I think it's because it was getting late and I was tired

What happened is that when I ran the mvn test earlier in the day, for some reason I killed the process and it was currently downloading some of the dependencies.  It appears that maven is downloading the dependencies directly in the repository without putting the intermediate download to a tmp directory.  So if you kill it during the download, you'll get a partial download of the jar, and so it's not valid.  So then the only thing I've had to do next was to remove all the corrupted jars from the maven repo, and run the mvn test again (and download half of internet through dependencies at the same time )

I know it's off topic, but if people get the same problem as I've had, then I did  a little bash script that cleans up a maven repository, fell free to use it

Code:
#! /bin/bash
jars=`find ~/.m2/repository/ -name '*.jar'`
for jar in $jars; do
isValid=`jar tf $jar 2gt;/dev/null`
if [ quot;x$isValidquot; == quot;xquot; ]; then
echo quot;removing invalid jar: $jarquot;
rm -f $jar
else
echo quot;skip valid jar: $jarquot;
fi
done
Anyway, after cleaning up my repository, I did another:

Code:
mvn clean test -Pbootstrap,spring3
And now I'm getting the following errors:

Code:
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/opt/src/spring-batch-2.1.6.RELEASE/samples/spring-batch-samples/src/main/java/org//batch/sample/domain/order/internal/OrderItemReader.java:[23,37] package org..batch.item does not exist

/opt/src/spring-batch-2.1.6.RELEASE/samples/spring-batch-samples/src/main/java/org//batch/sample/domain/order/internal/OrderItemReader.java:[24,50] package org..batch.item.file.mapping does not exist

/opt/src/spring-batch-2.1.6.RELEASE/samples/spring-batch-samples/src/main/java/org//batch/sample/domain/order/internal/OrderItemReader.java:[25,52] package org..batch.item.file.transform does not exist

/opt/src/spring-batch-2.1.6.RELEASE/samples/spring-batch-samples/src/main/java/org//batch/sample/domain/order/internal/OrderItemReader.java:[37,40] cannot find symbol

etc... (lot of compilation errors)
I know, I must do something wrong, but really... I don't know what.
I've just got the distribution zip, followed the README from github and still no luck.

But I'm sure we're going to sort that out

Thanks for all the help.

/Benoit

You definitely have some Maven repository issues (probably caused by failed downloads) if you can't resolve classes from the framework.  If I were you I would clear out as much of the local repository as you can bear and start again.
¥
Back Forum Reply New