s/META-INF/persistence.xml
this yields:
target/test-classes/META-INF/persistence.xml
however, the same NullPointerException persists on
the call to:
Stripersist.getEntityManager()
On Thu, Jul 8, 2010 at 4:39 PM, Jocke Eriksson wrote:
The path should be for junit
tests target/test-classes/META-INF/persi
ce.xml
>>
>> this yields:
>>
>> target/test-classes/META-INF/persistence.xml
>>
>> however, the same NullPointerException persists on
>> the call to:
>>
>> Stripersist.getEntityManager()
>>
>>
>>
>> On Thu, Jul 8
d 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
Jocke Eriksson 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.getEntit
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() -->
> Nu
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:
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/"
+ "target/classes/META
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();
...
...
Stripersi
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 wrote:
> 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
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
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? ;-) :-) :-)
--Niko
> 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
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 t
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 wrote:
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() -->
> NullPointerExcep
hi aaron,
thank you for your help.
1) my persistence.xml ends up in the project root at:
target/classes/META-INF/persistence.xml
this appears to be correct to me. please correct me if
i am wrong.
2) i implemented the calls that you suggested in the
junit setUpClass() and tearDownClass() method
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 c
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 code
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.
>>
>
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
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
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:
java.lang.NullPoin
22 matches
Mail list logo