Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: how to use struts2 + spring + JPA

Musachy Barroso

2007-01-29

Replies:

Good catch, I got confused between WEB-INF and META-INF :)

musachy

cilquirm wrote:
> your persistence.xml must be in META-INF directory in the classpath ( so
> basically, it needs to end up either in your jars in WEB-INF/lib or in your
> WEB-INF/classes directory )
>
>
>
>
> shahab wrote:
>  
>> Hi:
>>
>> I have persistence.xml under META-INF
>>
>> (both WEB-INF and META-INF are under tomcat_home/webapps/<app> level
>>
>> In fact, w/o this file, i get the same error also.
>>
>> Also, please note that, I couldnt find "struts2-Spring-plugin.jar"
>> anywhere.
>>
>>
>> thanx
>> Shahab
>>
>>
>> Musachy Barroso-2 wrote:
>>  
>>> Is "persistence.xml" under WEB-INF? I was getting the same error when I
>>> tried to avoid using the dummy persistence.xml (there is got to be a way
>>> of configuring the persistent unit from Spring, but I didn't look into
>>> it).
>>>
>>> musachy
>>>
>>> shahab wrote:
>>>    
>>>> Hi:
>>>>
>>>> I am trying to use Struts 2, Spring and JPA. I have developed a simple
>>>> application like the one mentioned in
>>>> http://cwiki.apache.org/S2WIKI/struts-2-spring-jpa-ajax.html.
>>>>
>>>> I am getting the following error -
>>>>
>>>> SEVERE: Exception sending context initialized event to listener instance
>>>> of
>>>> class org.springframework.web.context.ContextLoa
>>>> derListener
>>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>>> bean
>>>> with name 'entityManagerFactory' defined in Ser
>>>> vletContext resource [/WEB-INF/applicationContext.xml]: Invocation of
>>>> init
>>>> method failed; nested exception is java.lang.Ille
>>>> galStateException: No persistence units parsed from
>>>> {classpath*:META-INF/persistence.xml}
>>>> Caused by: java.lang.IllegalStateException: No persistence units parsed
>>>> from
>>>> {classpath*:META-INF/persistence.xml}
>>>>
>>>>
>>>> My applicationContext.xml and persistence.xml is similar to what is
>>>> there in
>>>> the example.
>>>>
>>>> My persistence.xml is the following -
>>>> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
>>>>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
>>>> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
>>>>   version="1.0">
>>>>   <persistence-unit name="punit">
>>>>   </persistence-unit>
>>>> </persistence>
>>>>
>>>>
>>>>
>>>> Any help will be greatly appreaciated.
>>>>
>>>> thanx
>>>> Shahab
>>>>  
>>>>      
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>>    
>>  
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.