Hmmm...  The information for your Ant task may be old...  I don't remember
that we highlighted the need for commons-lang-2.4 like that...  Here's a
blog post [1] that helps explain the various mechanisms for dynamic and
static enhancement processing.  Maybe that will help with diagnosing the
problem.

A similar problem was also found while using Maven 2.0.8 [2], but the call
stack isn't exactly the same as yours.  But, maybe the resolution would
still help.

Good luck,
Kevin


[1]
http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html
[2]  https://issues.apache.org/jira/browse/OPENJPA-685

On Sat, Sep 5, 2009 at 7:02 PM, jack.terranova <jack.terran...@gmail.com>wrote:

>
> Sounds like this poster had this issue too ...
>
>
> http://n2.nabble.com/Please-help-me-enhancing-my-classes-td209164.html#a209166
>
> http://n2.nabble.com/Please-help-me-enhancing-my-classes-td209164.html#a209166
>
> ... but their issue just went away.
>
> I am trying to enhance at build time using Ant...
>
> <target name="enhance">
>        <!-- define the openjpac task; this can be done at the top of the
>  -->
>        <!-- build.xml file, so it will be available for all targets     -->
>        <taskdef name="openjpac"
> classname="org.apache.openjpa.ant.PCEnhancerTask">
>                <classpath>
>
>                        <fileset dir="src/META-INF" >
>                        </fileset>
>                        <pathelement
> path="/home/jack/programs/commons-lang-2.4/commons-lang-2.4.jar" />
>                        <pathelement
> path="/home/jack/programs/apache-openjpa-1.2.1/openjpa-1.2.1.jar" />
>                </classpath>
>        </taskdef>
>
>        <!-- invoke enhancer on all .java files below the model directory
> -->
>        <openjpac>
>            <fileset dir="build/classes">
>                <include name="**/*.class"/>
>        </fileset>
>        </openjpac>
>        </target>
>
>
> commons-lang-2.4.jar seems to be the culprit.   Originally I was getting a
> ClassNotFound for a commons/lang class.  So I added the jar into the
> classpath and get this exception ...
>
>
> [openjpac] java.util.zip.ZipException: error in opening zip file
>  [openjpac]     at java.util.zip.ZipFile.open(Native Method)
>  [openjpac]     at java.util.zip.ZipFile.<init>(Unknown Source)
>  [openjpac]     at java.util.zip.ZipFile.<init>(Unknown Source)
>  [openjpac]     at
>
> org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028)
>  [openjpac]     at
>
> org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147)
>  [openjpac]     at
>
> org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:109)
>  [openjpac]     at
> org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:975)
>  [openjpac]     at java.lang.ClassLoader.getResources(Unknown Source)
>
>
> ...I've struggles with all sorts of workarounds including downloading
> different versions of common-lang thinking maybe the jar is corrupt.  But I
> think this is an openjpa issue.
>
> Enhancing at runtime works great with the agent - so that is my workaround
> for now.
>
> Thanks in advance.
> --
> View this message in context:
> http://n2.nabble.com/Cannot-enhance-at-build-time-strange-ZipException-tp3590538p3590538.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Reply via email to