You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by remmons <re...@aurigen.com> on 2010/03/04 20:24:32 UTC

Error trying to enhance at build time

I am trying to enhance a class at build time, but I get an error message.

Here is my command line:

     [exec] C:\document\eclipse350\webJava\OpenJpaNys>java -cp
src\java;build;lib\openjpa-2.0.0-beta2.jar;lib\openjpa-all-2.0.0-beta2.jar
org.apache.openjpa.enhance.PCEnhancer com.aurigen.openjpanys.Message.java 

Here is the error I am getting:

     [exec] Exception in thread "main"
org.apache.commons.lang.exception.NestableRuntimeException: Error extracting
class information from "com.aurigen.openjpanys.Message.java".
     [exec] 	at
org.apache.openjpa.lib.meta.ClassArgParser.parseTypeNames(ClassArgParser.java:226)
     [exec] 	at
org.apache.openjpa.lib.meta.ClassArgParser.parseTypes(ClassArgParser.java:161)
     [exec] 	at
org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4638)
     [exec] 	at
org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4601)
     [exec] 	at
org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4571)
     [exec] 	at
org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:725)
     [exec] 	at
org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:715)
     [exec] 	at
org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4566)
     [exec] 	at
org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:4557)
     [exec] Caused by: java.io.FileNotFoundException:
com.aurigen.openjpanys.Message.java (The system cannot find the file
specified)
     [exec] 	at java.io.FileInputStream.open(Native Method)
     [exec] 	at java.io.FileInputStream.<init>(Unknown Source)
     [exec] 	at java.io.FileReader.<init>(Unknown Source)
     [exec] 	at
org.apache.openjpa.lib.meta.ClassArgParser.getFromJavaFile(ClassArgParser.java:339)
     [exec] 	at
org.apache.openjpa.lib.meta.ClassArgParser.parseTypeNames(ClassArgParser.java:219)
     [exec] 	... 8 more

Can anyone tell me what is wrong?

-- 
View this message in context: http://n2.nabble.com/Error-trying-to-enhance-at-build-time-tp4676588p4676588.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Error trying to enhance at build time

Posted by remmons <re...@aurigen.com>.
Thanks for the info.  It enabled me to get the build time enhancement
running.

Message.java was in my classpath, but apparently
org.apache.openjpa.enhance.PCEnhancer needs:

com\aurigen\openjpanys\Message.java

not

com.aurigen.openjpanys.Message.java


-- 
View this message in context: http://n2.nabble.com/Error-trying-to-enhance-at-build-time-tp4676588p4681515.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Error trying to enhance at build time

Posted by Jeremy Bauer <te...@gmail.com>.
Hi remmons,

The PCEnhancer requires the path to the file instead of the package.  For
example:

To compile: javac -cp openjpa-all-2.0.0-beta2.jar;.
com\aurigen\openjpanys\Message.java

then...

To enhance: java -cp openjpa-all-2.0.0-beta2.jar;.
org.apache.openjpa.enhance.PCEnhancer
com\aurigen\openjpanys\Message[.java|.class]

hth,

-Jeremy
On Thu, Mar 4, 2010 at 4:06 PM, Kevin Sutter <kw...@gmail.com> wrote:

> Hi remmons,
> Where are your application's java class files?  The exception stack below
> says that it can't find your Message.java file.  Is it in your classpath?
>
>    [exec] Caused by: java.io.FileNotFoundException:
> com.aurigen.openjpanys.Message.java (The system cannot find the file
> specified)
>
> Kevin
>
> On Thu, Mar 4, 2010 at 1:24 PM, remmons <re...@aurigen.com> wrote:
>
> >
> > I am trying to enhance a class at build time, but I get an error message.
> >
> > Here is my command line:
> >
> >     [exec] C:\document\eclipse350\webJava\OpenJpaNys>java -cp
> >
> src\java;build;lib\openjpa-2.0.0-beta2.jar;lib\openjpa-all-2.0.0-beta2.jar
> > org.apache.openjpa.enhance.PCEnhancer com.aurigen.openjpanys.Message.java
> >
> > Here is the error I am getting:
> >
> >     [exec] Exception in thread "main"
> > org.apache.commons.lang.exception.NestableRuntimeException: Error
> > extracting
> > class information from "com.aurigen.openjpanys.Message.java".
> >     [exec]     at
> >
> >
> org.apache.openjpa.lib.meta.ClassArgParser.parseTypeNames(ClassArgParser.java:226)
> >     [exec]     at
> >
> >
> org.apache.openjpa.lib.meta.ClassArgParser.parseTypes(ClassArgParser.java:161)
> >     [exec]     at
> > org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4638)
> >     [exec]     at
> > org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4601)
> >     [exec]     at
> > org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4571)
> >     [exec]     at
> >
> >
> org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:725)
> >     [exec]     at
> >
> >
> org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:715)
> >     [exec]     at
> > org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4566)
> >     [exec]     at
> > org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:4557)
> >     [exec] Caused by: java.io.FileNotFoundException:
> > com.aurigen.openjpanys.Message.java (The system cannot find the file
> > specified)
> >     [exec]     at java.io.FileInputStream.open(Native Method)
> >     [exec]     at java.io.FileInputStream.<init>(Unknown Source)
> >     [exec]     at java.io.FileReader.<init>(Unknown Source)
> >     [exec]     at
> >
> >
> org.apache.openjpa.lib.meta.ClassArgParser.getFromJavaFile(ClassArgParser.java:339)
> >     [exec]     at
> >
> >
> org.apache.openjpa.lib.meta.ClassArgParser.parseTypeNames(ClassArgParser.java:219)
> >     [exec]     ... 8 more
> >
> > Can anyone tell me what is wrong?
> >
> > --
> > View this message in context:
> >
> http://n2.nabble.com/Error-trying-to-enhance-at-build-time-tp4676588p4676588.html
> > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >
>

Re: Error trying to enhance at build time

Posted by Kevin Sutter <kw...@gmail.com>.
Hi remmons,
Where are your application's java class files?  The exception stack below
says that it can't find your Message.java file.  Is it in your classpath?

    [exec] Caused by: java.io.FileNotFoundException:
com.aurigen.openjpanys.Message.java (The system cannot find the file
specified)

Kevin

On Thu, Mar 4, 2010 at 1:24 PM, remmons <re...@aurigen.com> wrote:

>
> I am trying to enhance a class at build time, but I get an error message.
>
> Here is my command line:
>
>     [exec] C:\document\eclipse350\webJava\OpenJpaNys>java -cp
> src\java;build;lib\openjpa-2.0.0-beta2.jar;lib\openjpa-all-2.0.0-beta2.jar
> org.apache.openjpa.enhance.PCEnhancer com.aurigen.openjpanys.Message.java
>
> Here is the error I am getting:
>
>     [exec] Exception in thread "main"
> org.apache.commons.lang.exception.NestableRuntimeException: Error
> extracting
> class information from "com.aurigen.openjpanys.Message.java".
>     [exec]     at
>
> org.apache.openjpa.lib.meta.ClassArgParser.parseTypeNames(ClassArgParser.java:226)
>     [exec]     at
>
> org.apache.openjpa.lib.meta.ClassArgParser.parseTypes(ClassArgParser.java:161)
>     [exec]     at
> org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4638)
>     [exec]     at
> org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4601)
>     [exec]     at
> org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4571)
>     [exec]     at
>
> org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:725)
>     [exec]     at
>
> org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:715)
>     [exec]     at
> org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4566)
>     [exec]     at
> org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:4557)
>     [exec] Caused by: java.io.FileNotFoundException:
> com.aurigen.openjpanys.Message.java (The system cannot find the file
> specified)
>     [exec]     at java.io.FileInputStream.open(Native Method)
>     [exec]     at java.io.FileInputStream.<init>(Unknown Source)
>     [exec]     at java.io.FileReader.<init>(Unknown Source)
>     [exec]     at
>
> org.apache.openjpa.lib.meta.ClassArgParser.getFromJavaFile(ClassArgParser.java:339)
>     [exec]     at
>
> org.apache.openjpa.lib.meta.ClassArgParser.parseTypeNames(ClassArgParser.java:219)
>     [exec]     ... 8 more
>
> Can anyone tell me what is wrong?
>
> --
> View this message in context:
> http://n2.nabble.com/Error-trying-to-enhance-at-build-time-tp4676588p4676588.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>