openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Noll (JIRA)" <>
Subject [jira] Updated: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
Date Thu, 17 Aug 2006 22:15:15 GMT
     [ ]

Bryan Noll updated OPENJPA-14:

    Attachment: OPENJPA-14.patch1

Attaching patch named: OPENJPA-14.patch1

So, the issue reported originally was not a problem with the code, but a known problem with
ant, as can be seen here:

The real fix for this is better documentation, which I will throw together.  I updated the
'no-product-derivations' in the 'openjpa-kernel/src/main/resources/org/apache/openjpa/conf/'
file to provide a hint to people who would've run into the same issue I did.

The rest of the patch is to deal with another issue in the same realm as this one, ant that
is the fact that the PCEnhancerTask would throw a NPE if you didn't have 'META-INF/persistence.xml'
on your system classpath, in $ANT_HOME/lib or supply the dir it was in via the 'ant -lib'
argument.  To resolve this, I created a new required attribute for the PCEnhancerTask, named
'configFile'... that allows the location of the config file to be declared when running the

Please provide feedback on the patch if you think I didn't grasp the context of what was going
on at a higher level and potentially screwed something else up.

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into
ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>                 Key: OPENJPA-14
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1
> Ideally, one should be able to run 'ant openjpac'  (openjpac would be a target defined
in the build script that would use the PCEnhancer task) without having to put the openjpa
jars on the system classpath or having to pass them into ant vie the '-lib' argument.  Currently
this is not possible.  The root of the issue can be seen from by looking at the public static
String[] getImplementors(String serviceName, ClassLoader loader) method of the Services class.
Basically, the call to 
> loader = Thread.currentThread().getContextClassLoader();
> returns a ClassLoader with the $ANT_HOME\lib\*.jar and $JAVA_HOME\lib\tools.jar in it...
which obviously doesn't contain 'META-INF/services/org.apache.openjpa.conf.ProductDerivation'
> The exception seen when encountering this issue:
> java.lang.ExceptionInInitializerError
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
>         at
> Caused by: java.util.MissingResourceException: Your system is missing product derivations.
 Product derivations provide configuration options for supported data stores and specifications.
 You must have a META-INF/services/org.apache.openjpa.conf.ProductDerivation file in your
classpath listing the available derivation classes, and some listed class must be instantiable.
 Typically this file is bundled as part of the distribution.  Have you unbundled it, or unbundled
its listed classes?
>         at org.apache.openjpa.conf.ProductDerivations.<clinit>(
>         ... 17 more

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message