You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Bryan Noll (JIRA)" <ji...@apache.org> on 2006/08/16 19:45:14 UTC

[jira] Created: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-14
                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
             Project: OpenJPA
          Issue Type: Bug
          Components: lib
         Environment: Windows XP
            Reporter: Bryan Noll


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>(OpenJPAConfigurationImpl.java:510)
        at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
        at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
        at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
        at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
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>(ProductDerivations.java:53)
        ... 17 more


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] Created: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by Bryan Noll <bw...@gmail.com>.
Thanks

Patrick Linskey wrote:
> Assigned.
>
>   

RE: [jira] Created: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by Patrick Linskey <pl...@bea.com>.
Assigned.

-- 
Patrick Linskey
BEA Systems, Inc. 

> -----Original Message-----
> From: Bryan Noll [mailto:bwnoll@gmail.com] 
> Sent: Wednesday, August 16, 2006 10:50 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: [jira] Created: (OPENJPA-14) PCEnhancer ant task 
> requires openjpa jars to be on the system classpath or passed 
> into ant with '-lib'
> 
> To whom it may concern...
> 
> Can I request the necessary karma so that I can assign this issue to 
> myself... or could someone please assign it to me?
> 
> Thanks...
> 
> Bryan Noll (JIRA) wrote:
> > PCEnhancer ant task requires openjpa jars to be on the 
> system classpath or passed into ant with '-lib'
> > 
> --------------------------------------------------------------
> ----------------------------------------
> >
> >                  Key: OPENJPA-14
> >                  URL: 
> http://issues.apache.org/jira/browse/OPENJPA-14
> >              Project: OpenJPA
> >           Issue Type: Bug
> >           Components: lib
> >          Environment: Windows XP
> >             Reporter: Bryan Noll
> >
> >
> > 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>(OpenJP
> AConfigurationImpl.java:510)
> >         at 
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJP
> AConfigurationImpl.java:160)
> >         at 
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJP
> AConfigurationImpl.java:151)
> >         at 
> org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhan
> cerTask.java:77)
> >         at 
> org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
> >         at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> >         at org.apache.tools.ant.Task.perform(Task.java:364)
> >         at org.apache.tools.ant.Target.execute(Target.java:341)
> >         at org.apache.tools.ant.Target.performTasks(Target.java:369)
> >         at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
> >         at 
> org.apache.tools.ant.Project.executeTarget(Project.java:1185)
> >         at 
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Def
> aultExecutor.java:40)
> >         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1068)
> >         at org.apache.tools.ant.Main.runBuild(Main.java:668)
> >         at org.apache.tools.ant.Main.startAnt(Main.java:187)
> >         at 
> org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
> >         at 
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> > 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>(ProductDer
> ivations.java:53)
> >         ... 17 more
> >
> >
> >   
> 
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

Re: [jira] Created: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by Bryan Noll <bw...@gmail.com>.
To whom it may concern...

Can I request the necessary karma so that I can assign this issue to 
myself... or could someone please assign it to me?

Thanks...

Bryan Noll (JIRA) wrote:
> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                  Key: OPENJPA-14
>                  URL: http://issues.apache.org/jira/browse/OPENJPA-14
>              Project: OpenJPA
>           Issue Type: Bug
>           Components: lib
>          Environment: Windows XP
>             Reporter: Bryan Noll
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more
>
>
>   

[jira] Updated: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Bryan Noll (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=all ]

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: http://ant.apache.org/faq.html#delegating-classloader-1.6

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/localizer.properties' 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 task.

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: http://issues.apache.org/jira/browse/OPENJPA-14
>             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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Bryan Noll (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=all ]

Bryan Noll updated OPENJPA-14:
------------------------------

    Attachment: OPENJPA-14.patch4

Attaching patch: OPENJPA-14.patch4

This throws a MetaDataException now instead of an NPE.

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2, OPENJPA-14.patch3, OPENJPA-14.patch4
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Bryan Noll (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-14?page=comments#action_12428817 ] 
            
Bryan Noll commented on OPENJPA-14:
-----------------------------------

I thought about making it optional, but it just seemed odd to me that you'd have to have 'META-INF/persistence.xml' in one of the places I mentioned earlier...

1) system classpath
2)$ANT_HOME/lib
3) ant -lib dir_where_META_INF_is
4) I forgot about this before... but a 4th would be ${user.home}/.ant/lib

...in particular, the first two options seem like a round peg in a square hole.  Making it optional would be easy, but I just thought making it required would save users the problem of having to get that on their classpath.

Maybe I'm not seeing the use case?  Like I said though, changing it to optional is trivial.

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] Commented: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by Bryan Noll <bw...@gmail.com>.
Saw this after I responded... I'll play around with it...

Thanks...

Abe White (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=comments#action_12428815 ] 
>             
> Abe White commented on OPENJPA-14:
> ----------------------------------
>
> Note that we already have an available way to set the config file or resource location:
>
> <any-openjpa-task>
>     <config propertiesFile="..."/>
>     -- or --
>     <config properties="..."/>
> </any-openjpa-task>
>
> The <config> element also lets you specify any property directly, like:
> <config connectionURL="..."/>
>
> This works b/c our AbstractTask has a createConfig() method that returns the Configuration instance (in this case, an OpenJPAConfiguration or JDBCConfiguration subclass instance depending on the task), so all bean methods are settable. 
>
> The <config> element isn't required, but I agree with Patrick that it shouldn't be, given that we'll detect persistence.xml if it's available in the classpath.  IMO, it would be better to fix the NPE to have a good error message than to require an explicit config file declaration.
>
>   
>> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
>> ------------------------------------------------------------------------------------------------------
>>
>>                 Key: OPENJPA-14
>>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>>             Project: OpenJPA
>>          Issue Type: Bug
>>          Components: lib
>>         Environment: Windows XP
>>            Reporter: Bryan Noll
>>         Assigned To: Bryan Noll
>>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2
>>
>>
>> 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>(OpenJPAConfigurationImpl.java:510)
>>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>         at org.apache.tools.ant.Task.perform(Task.java:364)
>>         at org.apache.tools.ant.Target.execute(Target.java:341)
>>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
>> 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>(ProductDerivations.java:53)
>>         ... 17 more
>>     
>
>   

[jira] Commented: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Abe White (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-14?page=comments#action_12428815 ] 
            
Abe White commented on OPENJPA-14:
----------------------------------

Note that we already have an available way to set the config file or resource location:

<any-openjpa-task>
    <config propertiesFile="..."/>
    -- or --
    <config properties="..."/>
</any-openjpa-task>

The <config> element also lets you specify any property directly, like:
<config connectionURL="..."/>

This works b/c our AbstractTask has a createConfig() method that returns the Configuration instance (in this case, an OpenJPAConfiguration or JDBCConfiguration subclass instance depending on the task), so all bean methods are settable. 

The <config> element isn't required, but I agree with Patrick that it shouldn't be, given that we'll detect persistence.xml if it's available in the classpath.  IMO, it would be better to fix the NPE to have a good error message than to require an explicit config file declaration.

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=all ]

Patrick Linskey closed OPENJPA-14.
----------------------------------

    Assignee: Patrick Linskey  (was: Bryan Noll)

Use the class's classloader in environments when service lookups should be looking in the OpenJPA distribution. This imposes the restriction that OpenJPA will only find services in the same classloader as the OpenJPA jars themselves, which is a much better restriction than requiring that the classes be in the thread's context classloader.


> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Patrick Linskey
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2, OPENJPA-14.patch3, OPENJPA-14.patch4
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Abe White (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=all ]

Abe White resolved OPENJPA-14.
------------------------------

    Resolution: Fixed

Applied patch (with minor corrections). 

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2, OPENJPA-14.patch3, OPENJPA-14.patch4
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Bryan Noll (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=all ]

Bryan Noll updated OPENJPA-14:
------------------------------

    Attachment: OPENJPA-14.patch3

Attaching patch file: OPENJPA-14.patch3

Ignore patch1 and patch2....

Thanks for pointing out the 'properties' and 'propertiesFile' values... that's exactly what I thought was missing and what I needed.  The patch is a simple update to give someone a hint about where their jars need to go so they don't get the original MissingResourceException.

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2, OPENJPA-14.patch3
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Bryan Noll (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=all ]

Bryan Noll updated OPENJPA-14:
------------------------------

    Attachment: OPENJPA-14.patch2

Attaching patch named: OPENJPA-14.patch2

Ignore 'OPENJPA-14.patch1 ', I forgot to make the test class I added as part of it.  That's the only difference between this one and that.

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OPENJPA-14?page=comments#action_12428813 ] 
            
Patrick Linskey commented on OPENJPA-14:
----------------------------------------

Why is the new ant task attribute a required task setting (instead of optional)? It would seem that it's only necessary when the system does not have a persistence unit available, or to narrow the choice when there are multiple persistence units available whose settings conflict.

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>         Attachments: OPENJPA-14.patch1, OPENJPA-14.patch2
>
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (OPENJPA-14) PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OPENJPA-14?page=all ]

Patrick Linskey reassigned OPENJPA-14:
--------------------------------------

    Assignee: Bryan Noll

> PCEnhancer ant task requires openjpa jars to be on the system classpath or passed into ant with '-lib'
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-14
>                 URL: http://issues.apache.org/jira/browse/OPENJPA-14
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: lib
>         Environment: Windows XP
>            Reporter: Bryan Noll
>         Assigned To: Bryan Noll
>
> 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>(OpenJPAConfigurationImpl.java:510)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:160)
>         at org.apache.openjpa.conf.OpenJPAConfigurationImpl.<init>(OpenJPAConfigurationImpl.java:151)
>         at org.apache.openjpa.ant.PCEnhancerTask.newConfiguration(PCEnhancerTask.java:77)
>         at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:170)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.tools.ant.Target.performTasks(Target.java:369)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>         at org.apache.tools.ant.Main.runBuild(Main.java:668)
>         at org.apache.tools.ant.Main.startAnt(Main.java:187)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:251)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:72)
> 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>(ProductDerivations.java:53)
>         ... 17 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira