You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pablo Caballero <pa...@yahoo.com> on 2008/11/04 21:27:57 UTC

@PersistenceUnit injection not working

Hi everyone.

I have an @PersistenceUnit(unitName="blah") injection but the value of the related variable in the method where I'm using it is null.

Using Persistence.createEntityManagerFactory("blah") instead of injection in the method's body works fine!

I'm using Tomcat 6.0.16. The server log not show any abnormal (I see it from Netbeans that is my IDE)

Can you explain me if this behaviour is normal or if it's an error (in some place)?

I'm a newbie in Java (and related technologies)

I apologize for my bad english.

Thank you very much

Regards




      

Re: @PersistenceUnit injection not working

Posted by Youssef Mohammed <yo...@gmail.com>.
This has nothing to do with tomcat, you will need to figure out how to
configure Persistence Manager in your web application.


Regards, Youssef


On Tue, Nov 4, 2008 at 10:27 PM, Pablo Caballero
<pa...@yahoo.com>wrote:

> Hi everyone.
>
> I have an @PersistenceUnit(unitName="blah") injection but the value of the
> related variable in the method where I'm using it is null.
>
> Using Persistence.createEntityManagerFactory("blah") instead of injection
> in the method's body works fine!
>
> I'm using Tomcat 6.0.16. The server log not show any abnormal (I see it
> from Netbeans that is my IDE)
>
> Can you explain me if this behaviour is normal or if it's an error (in some
> place)?
>
> I'm a newbie in Java (and related technologies)
>
> I apologize for my bad english.
>
> Thank you very much
>
> Regards
>
>
>
>
>