Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-09 Thread Nikolaos Giannopoulos
...@plektos.com To: stripes-users@lists.sourceforge.net Subject: Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException apologies: i forgot to attach my persistence.xml file to the previous email. please find it attached. thanks! On Thu, Jul 8, 2010 at 1:57 AM, Lev d...@plektos.com

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Lev
hi, i am trying to test code from stripes... and java web development is fun again. specifically, i have imported the email_36 into a netbeans maven project. i have written a simple JUnit test for the project file: com.dao.impl.stripersist.UserDaoImpl. i have attached the test file. further, i

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Lev
apologies: i forgot to attach my persistence.xml file to the previous email. please find it attached. thanks! On Thu, Jul 8, 2010 at 1:57 AM, Lev d...@plektos.com wrote: hi, i am trying to test code from stripes... and java web development is fun again. specifically, i have imported the

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Nikolaos Giannopoulos
Lev, OK. Well first of all as long as you have your persistence.xml in a location on the classpath under /META-INF/persistence.xml then Stripersist will find it. The second thing is that as Aaron pointed out you should use the static methods: Stripersist.requestInit(); ... test code ...

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Nikolaos Giannopoulos
Lev, So in case I wasn't totally clear... in looking at your attached code... if you remove the lines: protected static Stripersist stripersist; public static final String persistenceFile = /home/lev/projects/stripes/code/MavenEmail36WebApp/ +

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Lev
hi nikolaos, thank you for your help. i removed the lines that you suggested. however, i am now receiving a NullPointerException on a call to: Stripersist.getEntityManager(); i have attached the class BaseDaoImpl.java -- where the offending line of code resides. the stack trace is as follows:

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Jocke Eriksson
The path should be for junit tests target/test-classes/META-INF/persistence.xml Date: Thu, 8 Jul 2010 01:58:28 -0500 From: d...@plektos.com To: stripes-users@lists.sourceforge.net Subject: Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException apologies: i

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Lev
Eriksson jockeeriks...@msn.com wrote: The path should be for junit tests target/test-classes/META-INF/persistence.xml Date: Thu, 8 Jul 2010 01:58:28 -0500 From: d...@plektos.com To: stripes-users@lists.sourceforge.net Subject: Re: [Stripes-users] Stripersist.getEntityManager

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Nikolaos Giannopoulos
...@plektos.com To: stripes-users@lists.sourceforge.net Subject: Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException apologies: i forgot to attach my persistence.xml file to the previous email. please find it attached. thanks! On Thu, Jul 8, 2010 at 1:57 AM, Lev d

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-08 Thread Lev
Eriksson jockeeriks...@msn.com wrote: The path should be for junit tests target/test-classes/META-INF/persistence.xml Date: Thu, 8 Jul 2010 01:58:28 -0500 From: d...@plektos.com To: stripes-users@lists.sourceforge.net Subject: Re: [Stripes-users] Stripersist.getEntityManager

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-07 Thread Jocke Eriksson
I use maven and it ends up in target/test-classes/META-INF when I junit test. Date: Wed, 7 Jul 2010 01:42:04 -0500 From: d...@plektos.com To: stripes-users@lists.sourceforge.net Subject: Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException hi aaron, thank

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-07 Thread Aaron Porter
Lev, Sounds like you're getting closer! Now it looks like you need to check your JPA configuration - make sure your persistence.xml is correct and you've got all the jars to support it. I use Hibernate as the JPA provider and PostgreSQL as the database. Aaron On 07/06/2010 11:42 PM, Lev

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-07 Thread Nikolaos Giannopoulos
Lev, Aaron is right. You are getting closer. At this point I think it would help you most if you post the code snippet you are using to test and your persistence.xml. I use TestNG and have Stripersist, Stripes, Spring, etc... running in a test without issues. It takes quite a bit of work

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-07 Thread Freddy Daoud
I use TestNG and have Stripersist, Stripes, Spring, etc... running in a test without issues. It takes quite a bit of work to model the key parts of your web.xml to get Stripersist to work. Once its done it works great. FWIW, with Rayures[1], you can subclass TestWithMockContainer and

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-07 Thread Nikolaos Giannopoulos
Freddy, It would be really nice if there was a way to have say MockServletContext initialize itself from a web.xml file. That would be extremely useful when attempting to test things like Stripersist w/ Spring, etc... So when are you going to submit a patch to Stripes? ;-) :-) :-)

[Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-06 Thread Lev
hi, i'm new to stripes and attempting to use stripersist for persistence. i have added stripersist to Extension.packages in web.xml. also, i added a persistence.xml file in META-INF. however, when i try junit testing the DAO layer that i have created, i receive the following:

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-06 Thread Aaron Porter
Hi Lev, Is your persistence.xml in /WEB-INF/classes/META-INF/ or /META-INF/? It should be in /WEB-INF/classes/META-INF/. That is a huge source of confusion in JPA. :-( If you're using Eclipse I recommend creating a source directory named resources and then creating a subdirectory named WEB-INF

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-06 Thread M.C.S.
Hi, Aaron Porter wrote: If you're using Eclipse I recommend creating a source directory named resources and then creating a subdirectory named WEB-INF and placing persistence.xml in there. Surely just a typo, but it surely should be named META-INF. I really hate these standard folder

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-06 Thread Aaron Porter
Oops! Thanks for catching that Marcus! Aaron On 07/06/2010 09:09 AM, M.C.S. wrote: Hi, Aaron Porter wrote: If you're using Eclipse I recommend creating a source directory named resources and then creating a subdirectory named WEB-INF and placing persistence.xml in there.

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-06 Thread Lev
hi, i moved persistence.xml to src/resources/META-INF. however, the original problem persists -- i receive a NullPointerException on the call: Stripersist.getEntityManager(); further information: i'm getting this exception when executing a Junit test of a DAO class -- i'm not executing web

Re: [Stripes-users] Stripersist.getEntityManager() -- NullPointerException

2010-07-06 Thread Aaron Porter
Lev, The META-INF directory that contains persistence.xml needs to end up at /WEB-INF/classes/META-INF. It looks like the way you've set it up it would be at /WEB-INF/classes/resources/META-INF. What I was proposing was to create a new source folder called resources. In Eclipse you do that by