Hi Pinaki,

Thanks for the help.


Pinaki Poddar wrote:
> 
> Also append a hash tag of the unit name to persistence.xml.
> i.e for a persistence unit named 'xyz'
> 
> $ java  org.apache.openjpa.enhance.PCEnhancer -p persistence.xml#xyz
> 

when running like you suggested, I get the same error:

java -classpath
/home/luzer/zpd/zpd-ws/jpa_demo/JpaDemo/bin/resourceMgr/model:/home/luzer/zpd/zpd-ws/jpa_demo/JpaDemo/src/META-INF:/home/luzer/tools/apache-openjpa-2.1.0/openjpa-all-2.1.0.jar
org.apache.openjpa.enhance.PCEnhancer -p
/home/luzer/zpd/zpd-ws/jpa_demo/JpaDemo/src/META-INF/persistence.xml#Accounts

29  Accounts  INFO   [main] openjpa.Tool - No targets were given.  Running
on all classes in your persistent classes list, or all metadata files in
classpath directories if you have not listed your persistent classes.  Use
-help to display tool usage information.
Exception in thread "main" java.lang.IllegalArgumentException:
java.lang.ClassNotFoundException: resourceMgr.model.Client
        at serp.util.Strings.toClass(Strings.java:164)
        at serp.util.Strings.toClass(Strings.java:108)
        at serp.bytecode.BCClass.getType(BCClass.java:566)
        at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:283)
        at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4675)
        at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4622)
        at org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4592)
        at
org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:741)
        at
org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:731)
        at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4587)
        at org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:4578)


Pinaki Poddar wrote:
> 
> Ensure the following
>  a) persistence.xml declares all the classes to be enhanced in <class>
> clause
> 
    <class>resourceMgr.model.Client</class>
    <class>resourceMgr.model.Resource</class>
    <class>resourceMgr.model.ResourceGroup</class>

I tend to believe the persistence.xml is correct, because I have a
functional Java SE unit test, running the same persistence.xml and classes
I'm trying to enhance now, using runtime enhancement.

Pinaki Poddar wrote:
> 
>  b) the classpath contains all the classes to be enhanced
> 
directory /home/luzer/zpd/zpd-ws/jpa_demo/JpaDemo/bin/resourceMgr/model
contains the classes and is defined in the above command's classpath

Pinaki Poddar wrote:
> 
>  c) the classpath contains the directory where persistence.xml resides
> 
directory /home/luzer/zpd/zpd-ws/jpa_demo/JpaDemo/src/META-INF contains
persistence.xml  and is defined in the above command's classpath

Thanks,
abu

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/PCEnhancer-and-java-lang-ClassNotFoundException-tp6597934p6602103.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to