You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by idan <id...@gmail.com> on 2010/12/02 10:33:58 UTC

Build time enhancer custom PersistenceProvider

Hey,

I implemented a custom PersistenceProvider (i need it for injecting
instances through spring).
When trying to enhance at build time i'm getting a ClassNotFoundException
saying my provider is not found.

How can I include additional class path locations for the enhancement task?

Thanks,
Idan


-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Build-time-enhancer-custom-PersistenceProvider-tp5795311p5795311.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Re: Build time enhancer custom PersistenceProvider

Posted by idan <id...@gmail.com>.
Thanks but it doesn't work...
I tried what you suggested but i'm still getting a ClassNotFoundException.

Any suggestions?
i tried specifying a jar containing my class or the actual class path with
no success.




-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Build-time-enhancer-custom-PersistenceProvider-tp5795311p5804783.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Re: Build time enhancer custom PersistenceProvider

Posted by Michael Dick <mi...@gmail.com>.
I've never tried this particular scenario, but you can set a classpath when
you define the OpenJPA PCEnhancer task and one when you run the task. I'd
guess that you need your provider when the task runs, not when you define it
though.

Something vaguely like this should work :

        <path id="cp">
             <!-- put your classpath entries here -->
        </path>

        <taskdef name="openjpac"
                 classname="org.apache.openjpa.ant.PCEnhancerTask">
            <classpath refid="cp" />
        </taskdef>

        <!-- snip -- >

       <openjpac>
            <classpath refid="cp" />
            <fileset refid="enhance.path.ref" />
            <config log="${openjpa.Log}" />
        </openjpac>

It's probably more correct to have separate classpaths for execution and
task definition but this should help you get started.

-mike

On Thu, Dec 2, 2010 at 3:33 AM, idan <id...@gmail.com> wrote:

>
> Hey,
>
> I implemented a custom PersistenceProvider (i need it for injecting
> instances through spring).
> When trying to enhance at build time i'm getting a ClassNotFoundException
> saying my provider is not found.
>
> How can I include additional class path locations for the enhancement task?
>
> Thanks,
> Idan
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Build-time-enhancer-custom-PersistenceProvider-tp5795311p5795311.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>