Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-05 Thread Alvaro Sanchez-Mariscal
Quoting:

1. Create a folder named META-INF under the src folder.
2. Create a file named persistence.xml under the META-INF folder
and set its content to...

Content within src should be compiled into WEB-INF/classes.

Doing the maven way, this file should be in src/main/resources

Alvaro.


On Jan 5, 2008 4:03 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
 All the code is there :
 http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html

 But I had a problem to deploy the application on my tomcat server.

 Musachy and Laurie suggested to move the file persistence.xml from
 /META-INF (where indicated in the tutorial) to
 /WEB-INF/classes/META-INF.

 Enjoy.


 Pascal


 2008/1/4, Frans Thamura [EMAIL PROTECTED]:
  can we have the code also?
 
  F
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Alvaro Sanchez-Mariscal Arnaiz
Java EE Architect  Instructor
[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Pascal SEREMES-DAMAL
In fact in the tutorial
(http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
) they say that there no need to specify the JPA configuration in this
file because the datasource will be on spring configuration file.

2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
 Spring couldn't find META-INF/persistence.xml

 musachy

 On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
  Hello everyone!!!
 
  I hope you had fun during the end of year 2007 and I wish you a happy new 
  year.
 
  I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
  struts page and when I deployed it on my server I had the following
  exceptions.
 
  GRAVE: Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name
  'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
  defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
  Initialization of bean failed; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name
  'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
  Cannot create inner bean '(inner bean)' of type
  [org.springframework.transaction.interceptor.TransactionInterceptor]
  while setting bean property 'transactionInterceptor'; nested exception
  is org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name '(inner bean)': Cannot resolve reference to
  bean 'transactionManager' while setting bean property
  'transactionManager'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'transactionManager' defined in ServletContext
  resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
  to bean 'entityManagerFactory' while setting bean property
  'entityManagerFactory'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'entityManagerFactory' defined in
  ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
  of init method failed; nested exception is
  java.lang.IllegalStateException: No persistence units parsed from
  {classpath*:META-INF/persistence.xml}
  Caused by: org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name
  'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
  Cannot create inner bean '(inner bean)' of type
  [org.springframework.transaction.interceptor.TransactionInterceptor]
  while setting bean property 'transactionInterceptor'; nested exception
  is org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name '(inner bean)': Cannot resolve reference to
  bean 'transactionManager' while setting bean property
  'transactionManager'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'transactionManager' defined in ServletContext
  resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
  to bean 'entityManagerFactory' while setting bean property
  'entityManagerFactory'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'entityManagerFactory' defined in
  ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
  of init method failed; nested exception is
  java.lang.IllegalStateException: No persistence units parsed from
  {classpath*:META-INF/persistence.xml}
  Caused by: org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name '(inner bean)': Cannot resolve reference
  to bean 'transactionManager' while setting bean property
  'transactionManager'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'transactionManager' defined in ServletContext
  resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
  to bean 'entityManagerFactory' while setting bean property
  'entityManagerFactory'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'entityManagerFactory' defined in
  ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
  of init method failed; nested exception is
  java.lang.IllegalStateException: No persistence units parsed from
  {classpath*:META-INF/persistence.xml}
  Caused by: org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name 'transactionManager' defined in
  ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot
  resolve reference to bean 'entityManagerFactory' while setting bean
  property 'entityManagerFactory'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'entityManagerFactory' defined in
  ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation

Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Pascal SEREMES-DAMAL
Hello everyone!!!

I hope you had fun during the end of year 2007 and I wish you a happy new year.

I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
struts page and when I deployed it on my server I had the following
exceptions.

GRAVE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
Cannot create inner bean '(inner bean)' of type
[org.springframework.transaction.interceptor.TransactionInterceptor]
while setting bean property 'transactionInterceptor'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)': Cannot resolve reference to
bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
Cannot create inner bean '(inner bean)' of type
[org.springframework.transaction.interceptor.TransactionInterceptor]
while setting bean property 'transactionInterceptor'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)': Cannot resolve reference to
bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)': Cannot resolve reference
to bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'transactionManager' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot
resolve reference to bean 'entityManagerFactory' while setting bean
property 'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: java.lang.IllegalStateException: No persistence units

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Musachy Barroso
Indeed. But the file needs to be there, even if it is empty, which I
found quite annoying (at least I don't know how to avoid having the
file there), like:

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

musachy

On Jan 4, 2008 11:26 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
 In fact in the tutorial
 (http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
 ) they say that there no need to specify the JPA configuration in this
 file because the datasource will be on spring configuration file.

 2008/1/4, Musachy Barroso [EMAIL PROTECTED]:

  Spring couldn't find META-INF/persistence.xml
 
  musachy
 
  On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
   Hello everyone!!!
  
   I hope you had fun during the end of year 2007 and I wish you a happy new 
   year.
  
   I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
   struts page and when I deployed it on my server I had the following
   exceptions.
  
   GRAVE: Context initialization failed
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name
   'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
   defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
   Initialization of bean failed; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name
   'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
   Cannot create inner bean '(inner bean)' of type
   [org.springframework.transaction.interceptor.TransactionInterceptor]
   while setting bean property 'transactionInterceptor'; nested exception
   is org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name '(inner bean)': Cannot resolve reference to
   bean 'transactionManager' while setting bean property
   'transactionManager'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'transactionManager' defined in ServletContext
   resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
   to bean 'entityManagerFactory' while setting bean property
   'entityManagerFactory'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'entityManagerFactory' defined in
   ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
   of init method failed; nested exception is
   java.lang.IllegalStateException: No persistence units parsed from
   {classpath*:META-INF/persistence.xml}
   Caused by: org.springframework.beans.factory.BeanCreationException:
   Error creating bean with name
   'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
   Cannot create inner bean '(inner bean)' of type
   [org.springframework.transaction.interceptor.TransactionInterceptor]
   while setting bean property 'transactionInterceptor'; nested exception
   is org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name '(inner bean)': Cannot resolve reference to
   bean 'transactionManager' while setting bean property
   'transactionManager'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'transactionManager' defined in ServletContext
   resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
   to bean 'entityManagerFactory' while setting bean property
   'entityManagerFactory'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'entityManagerFactory' defined in
   ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
   of init method failed; nested exception is
   java.lang.IllegalStateException: No persistence units parsed from
   {classpath*:META-INF/persistence.xml}
   Caused by: org.springframework.beans.factory.BeanCreationException:
   Error creating bean with name '(inner bean)': Cannot resolve reference
   to bean 'transactionManager' while setting bean property
   'transactionManager'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'transactionManager' defined in ServletContext
   resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
   to bean 'entityManagerFactory' while setting bean property
   'entityManagerFactory'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'entityManagerFactory' defined in
   ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
   of init method failed; nested

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Pascal SEREMES-DAMAL
That's exactly what I have. I've followed all the instructions in the tuto.

2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
 Indeed. But the file needs to be there, even if it is empty, which I
 found quite annoying (at least I don't know how to avoid having the
 file there), like:

 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

 musachy

 On Jan 4, 2008 11:26 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
  In fact in the tutorial
  (http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
  ) they say that there no need to specify the JPA configuration in this
  file because the datasource will be on spring configuration file.
 
  2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
 
   Spring couldn't find META-INF/persistence.xml
  
   musachy
  
   On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
Hello everyone!!!
   
I hope you had fun during the end of year 2007 and I wish you a happy 
new year.
   
I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
struts page and when I deployed it on my server I had the following
exceptions.
   
GRAVE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
Cannot create inner bean '(inner bean)' of type
[org.springframework.transaction.interceptor.TransactionInterceptor]
while setting bean property 'transactionInterceptor'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)': Cannot resolve reference to
bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
Cannot create inner bean '(inner bean)' of type
[org.springframework.transaction.interceptor.TransactionInterceptor]
while setting bean property 'transactionInterceptor'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)': Cannot resolve reference to
bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)': Cannot resolve reference
to bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Musachy Barroso
Spring couldn't find META-INF/persistence.xml

musachy

On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
 Hello everyone!!!

 I hope you had fun during the end of year 2007 and I wish you a happy new 
 year.

 I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
 struts page and when I deployed it on my server I had the following
 exceptions.

 GRAVE: Context initialization failed
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name
 'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
 defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
 Initialization of bean failed; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name
 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
 Cannot create inner bean '(inner bean)' of type
 [org.springframework.transaction.interceptor.TransactionInterceptor]
 while setting bean property 'transactionInterceptor'; nested exception
 is org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name '(inner bean)': Cannot resolve reference to
 bean 'transactionManager' while setting bean property
 'transactionManager'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'transactionManager' defined in ServletContext
 resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
 to bean 'entityManagerFactory' while setting bean property
 'entityManagerFactory'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'entityManagerFactory' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
 of init method failed; nested exception is
 java.lang.IllegalStateException: No persistence units parsed from
 {classpath*:META-INF/persistence.xml}
 Caused by: org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name
 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
 Cannot create inner bean '(inner bean)' of type
 [org.springframework.transaction.interceptor.TransactionInterceptor]
 while setting bean property 'transactionInterceptor'; nested exception
 is org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name '(inner bean)': Cannot resolve reference to
 bean 'transactionManager' while setting bean property
 'transactionManager'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'transactionManager' defined in ServletContext
 resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
 to bean 'entityManagerFactory' while setting bean property
 'entityManagerFactory'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'entityManagerFactory' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
 of init method failed; nested exception is
 java.lang.IllegalStateException: No persistence units parsed from
 {classpath*:META-INF/persistence.xml}
 Caused by: org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name '(inner bean)': Cannot resolve reference
 to bean 'transactionManager' while setting bean property
 'transactionManager'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'transactionManager' defined in ServletContext
 resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
 to bean 'entityManagerFactory' while setting bean property
 'entityManagerFactory'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'entityManagerFactory' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
 of init method failed; nested exception is
 java.lang.IllegalStateException: No persistence units parsed from
 {classpath*:META-INF/persistence.xml}
 Caused by: org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'transactionManager' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot
 resolve reference to bean 'entityManagerFactory' while setting bean
 property 'entityManagerFactory'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'entityManagerFactory' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
 of init method failed; nested exception is
 java.lang.IllegalStateException: No persistence units parsed from
 {classpath*:META-INF/persistence.xml}
 Caused by: org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'entityManagerFactory' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Musachy Barroso
well, somehow the file is not getting there at runtime I guess, this
is from your stacktrace:

java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}

musachy

On Jan 4, 2008 11:35 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
 That's exactly what I have. I've followed all the instructions in the tuto.


 2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
  Indeed. But the file needs to be there, even if it is empty, which I
  found quite annoying (at least I don't know how to avoid having the
  file there), like:
 
  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
 
  musachy
 
  On Jan 4, 2008 11:26 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
   In fact in the tutorial
   (http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
   ) they say that there no need to specify the JPA configuration in this
   file because the datasource will be on spring configuration file.
  
   2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
  
Spring couldn't find META-INF/persistence.xml
   
musachy
   
On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
 Hello everyone!!!

 I hope you had fun during the end of year 2007 and I wish you a happy 
 new year.

 I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
 struts page and when I deployed it on my server I had the following
 exceptions.

 GRAVE: Context initialization failed
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name
 'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
 defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
 Initialization of bean failed; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name
 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
 Cannot create inner bean '(inner bean)' of type
 [org.springframework.transaction.interceptor.TransactionInterceptor]
 while setting bean property 'transactionInterceptor'; nested exception
 is org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name '(inner bean)': Cannot resolve reference to
 bean 'transactionManager' while setting bean property
 'transactionManager'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'transactionManager' defined in ServletContext
 resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
 to bean 'entityManagerFactory' while setting bean property
 'entityManagerFactory'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'entityManagerFactory' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
 of init method failed; nested exception is
 java.lang.IllegalStateException: No persistence units parsed from
 {classpath*:META-INF/persistence.xml}
 Caused by: org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name
 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
 Cannot create inner bean '(inner bean)' of type
 [org.springframework.transaction.interceptor.TransactionInterceptor]
 while setting bean property 'transactionInterceptor'; nested exception
 is org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name '(inner bean)': Cannot resolve reference to
 bean 'transactionManager' while setting bean property
 'transactionManager'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'transactionManager' defined in ServletContext
 resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
 to bean 'entityManagerFactory' while setting bean property
 'entityManagerFactory'; nested exception is
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'entityManagerFactory' defined in
 ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
 of init method failed; nested exception is
 java.lang.IllegalStateException: No persistence units parsed from
 {classpath*:META-INF/persistence.xml}
 Caused by: org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name '(inner bean)': Cannot resolve reference
 to bean 'transactionManager' while setting bean property
 'transactionManager

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Pascal SEREMES-DAMAL
Do you mean it can come from a bad classpath..? Or maybe should I
specify somewhere that the spring framework is used for the
persistence... But I don't know where.

I thought that the setting struts.objectFactory to spring in
struts.xml would be enough.

2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
 well, somehow the file is not getting there at runtime I guess, this
 is from your stacktrace:

 java.lang.IllegalStateException: No persistence units parsed from
 {classpath*:META-INF/persistence.xml}

 musachy

 On Jan 4, 2008 11:35 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
  That's exactly what I have. I've followed all the instructions in the tuto.
 
 
  2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
   Indeed. But the file needs to be there, even if it is empty, which I
   found quite annoying (at least I don't know how to avoid having the
   file there), like:
  
   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
  
   musachy
  
   On Jan 4, 2008 11:26 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
In fact in the tutorial
(http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
) they say that there no need to specify the JPA configuration in this
file because the datasource will be on spring configuration file.
   
2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
   
 Spring couldn't find META-INF/persistence.xml

 musachy

 On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] 
 wrote:
  Hello everyone!!!
 
  I hope you had fun during the end of year 2007 and I wish you a 
  happy new year.
 
  I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
  struts page and when I deployed it on my server I had the following
  exceptions.
 
  GRAVE: Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name
  'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
  defined in ServletContext resource 
  [/WEB-INF/applicationContext.xml]:
  Initialization of bean failed; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name
  'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
  Cannot create inner bean '(inner bean)' of type
  [org.springframework.transaction.interceptor.TransactionInterceptor]
  while setting bean property 'transactionInterceptor'; nested 
  exception
  is org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name '(inner bean)': Cannot resolve reference to
  bean 'transactionManager' while setting bean property
  'transactionManager'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'transactionManager' defined in 
  ServletContext
  resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
  to bean 'entityManagerFactory' while setting bean property
  'entityManagerFactory'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'entityManagerFactory' defined in
  ServletContext resource [/WEB-INF/applicationContext.xml]: 
  Invocation
  of init method failed; nested exception is
  java.lang.IllegalStateException: No persistence units parsed from
  {classpath*:META-INF/persistence.xml}
  Caused by: org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name
  'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
  Cannot create inner bean '(inner bean)' of type
  [org.springframework.transaction.interceptor.TransactionInterceptor]
  while setting bean property 'transactionInterceptor'; nested 
  exception
  is org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name '(inner bean)': Cannot resolve reference to
  bean 'transactionManager' while setting bean property
  'transactionManager'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'transactionManager' defined in 
  ServletContext
  resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
  to bean 'entityManagerFactory' while setting bean property
  'entityManagerFactory'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'entityManagerFactory' defined in
  ServletContext resource [/WEB

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Pascal SEREMES-DAMAL
Did some one else encountered the same problem as mine when following
the tutorial 
http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
?

2008/1/4, Pascal SEREMES-DAMAL [EMAIL PROTECTED]:
 Do you mean it can come from a bad classpath..? Or maybe should I
 specify somewhere that the spring framework is used for the
 persistence... But I don't know where.

 I thought that the setting struts.objectFactory to spring in
 struts.xml would be enough.

 2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
  well, somehow the file is not getting there at runtime I guess, this
  is from your stacktrace:
 
  java.lang.IllegalStateException: No persistence units parsed from
  {classpath*:META-INF/persistence.xml}
 
  musachy
 
  On Jan 4, 2008 11:35 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
   That's exactly what I have. I've followed all the instructions in the 
   tuto.
  
  
   2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
Indeed. But the file needs to be there, even if it is empty, which I
found quite annoying (at least I don't know how to avoid having the
file there), like:
   
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
   
musachy
   
On Jan 4, 2008 11:26 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
 In fact in the tutorial
 (http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
 ) they say that there no need to specify the JPA configuration in this
 file because the datasource will be on spring configuration file.

 2008/1/4, Musachy Barroso [EMAIL PROTECTED]:

  Spring couldn't find META-INF/persistence.xml
 
  musachy
 
  On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] 
  wrote:
   Hello everyone!!!
  
   I hope you had fun during the end of year 2007 and I wish you a 
   happy new year.
  
   I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on 
   the
   struts page and when I deployed it on my server I had the 
   following
   exceptions.
  
   GRAVE: Context initialization failed
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name
   'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
   defined in ServletContext resource 
   [/WEB-INF/applicationContext.xml]:
   Initialization of bean failed; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name
   'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
   Cannot create inner bean '(inner bean)' of type
   [org.springframework.transaction.interceptor.TransactionInterceptor]
   while setting bean property 'transactionInterceptor'; nested 
   exception
   is org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name '(inner bean)': Cannot resolve reference 
   to
   bean 'transactionManager' while setting bean property
   'transactionManager'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'transactionManager' defined in 
   ServletContext
   resource [/WEB-INF/applicationContext.xml]: Cannot resolve 
   reference
   to bean 'entityManagerFactory' while setting bean property
   'entityManagerFactory'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'entityManagerFactory' defined in
   ServletContext resource [/WEB-INF/applicationContext.xml]: 
   Invocation
   of init method failed; nested exception is
   java.lang.IllegalStateException: No persistence units parsed from
   {classpath*:META-INF/persistence.xml}
   Caused by: 
   org.springframework.beans.factory.BeanCreationException:
   Error creating bean with name
   'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
   Cannot create inner bean '(inner bean)' of type
   [org.springframework.transaction.interceptor.TransactionInterceptor]
   while setting bean property 'transactionInterceptor'; nested 
   exception
   is org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name '(inner bean)': Cannot resolve reference 
   to
   bean 'transactionManager' while setting bean property
   'transactionManager'; nested exception is
   org.springframework.beans.factory.BeanCreationException: Error
   creating bean with name 'transactionManager' defined

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Laurie Harper
Musachy is suggesting that the persistence.xml file is not in your 
classpath (or not in the right place). Make sure that the file is really 
being deployed and that it is in the correct directory 
(WEB-INF/classes/META-INF/persistence.xml).


L.

Pascal SEREMES-DAMAL wrote:

Do you mean it can come from a bad classpath..? Or maybe should I
specify somewhere that the spring framework is used for the
persistence... But I don't know where.

I thought that the setting struts.objectFactory to spring in
struts.xml would be enough.

2008/1/4, Musachy Barroso [EMAIL PROTECTED]:

well, somehow the file is not getting there at runtime I guess, this
is from your stacktrace:

java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}

musachy

On Jan 4, 2008 11:35 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:

That's exactly what I have. I've followed all the instructions in the tuto.


2008/1/4, Musachy Barroso [EMAIL PROTECTED]:

Indeed. But the file needs to be there, even if it is empty, which I
found quite annoying (at least I don't know how to avoid having the
file there), like:

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

musachy

On Jan 4, 2008 11:26 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:

In fact in the tutorial
(http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
) they say that there no need to specify the JPA configuration in this
file because the datasource will be on spring configuration file.

2008/1/4, Musachy Barroso [EMAIL PROTECTED]:


Spring couldn't find META-INF/persistence.xml

musachy

On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:

Hello everyone!!!

I hope you had fun during the end of year 2007 and I wish you a happy new year.

I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
struts page and when I deployed it on my server I had the following
exceptions.

GRAVE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
defined in ServletContext resource [/WEB-INF/applicationContext..xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
Cannot create inner bean '(inner bean)' of type
[org.springframework.transaction.interceptor.TransactionInterceptor]
while setting bean property 'transactionInterceptor'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)': Cannot resolve reference to
bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml}
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
Cannot create inner bean '(inner bean)' of type
[org.springframework.transaction.interceptor.TransactionInterceptor]
while setting bean property 'transactionInterceptor'; nested exception
is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '(inner bean)': Cannot resolve reference to
bean 'transactionManager' while setting bean property
'transactionManager'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
to bean 'entityManagerFactory' while setting bean property
'entityManagerFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
of init method failed; nested exception is
java.lang.IllegalStateException: No persistence units parsed from
{classpath*:META-INF/persistence.xml

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Pascal SEREMES-DAMAL
How can I be sure that it is deployed?

The file was in /META-INF/persistence.xml as described in the tutorial.

I put it in WEB-INF/classes/META-INF/persistence.xml and it works.
Thank both of you very much!

Pascal

2008/1/4, Laurie Harper [EMAIL PROTECTED]:
 Musachy is suggesting that the persistence.xml file is not in your
 classpath (or not in the right place). Make sure that the file is really
 being deployed and that it is in the correct directory
 (WEB-INF/classes/META-INF/persistence.xml).

 L.

 Pascal SEREMES-DAMAL wrote:
  Do you mean it can come from a bad classpath..? Or maybe should I
  specify somewhere that the spring framework is used for the
  persistence... But I don't know where.
 
  I thought that the setting struts.objectFactory to spring in
  struts.xml would be enough.
 
  2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
  well, somehow the file is not getting there at runtime I guess, this
  is from your stacktrace:
 
  java.lang.IllegalStateException: No persistence units parsed from
  {classpath*:META-INF/persistence.xml}
 
  musachy
 
  On Jan 4, 2008 11:35 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
  That's exactly what I have. I've followed all the instructions in the 
  tuto.
 
 
  2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
  Indeed. But the file needs to be there, even if it is empty, which I
  found quite annoying (at least I don't know how to avoid having the
  file there), like:
 
  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
 
  musachy
 
  On Jan 4, 2008 11:26 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] wrote:
  In fact in the tutorial
  (http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html
  ) they say that there no need to specify the JPA configuration in this
  file because the datasource will be on spring configuration file.
 
  2008/1/4, Musachy Barroso [EMAIL PROTECTED]:
 
  Spring couldn't find META-INF/persistence.xml
 
  musachy
 
  On Jan 4, 2008 11:12 AM, Pascal SEREMES-DAMAL [EMAIL PROTECTED] 
  wrote:
  Hello everyone!!!
 
  I hope you had fun during the end of year 2007 and I wish you a happy 
  new year.
 
  I tried the Struts 2 + Spring 2 + JPA + AJAX tutorial that is on the
  struts page and when I deployed it on my server I had the following
  exceptions.
 
  GRAVE: Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name
  'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
  defined in ServletContext resource [/WEB-INF/applicationContext..xml]:
  Initialization of bean failed; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name
  'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
  Cannot create inner bean '(inner bean)' of type
  [org.springframework.transaction.interceptor.TransactionInterceptor]
  while setting bean property 'transactionInterceptor'; nested exception
  is org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name '(inner bean)': Cannot resolve reference to
  bean 'transactionManager' while setting bean property
  'transactionManager'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'transactionManager' defined in ServletContext
  resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference
  to bean 'entityManagerFactory' while setting bean property
  'entityManagerFactory'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'entityManagerFactory' defined in
  ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation
  of init method failed; nested exception is
  java.lang.IllegalStateException: No persistence units parsed from
  {classpath*:META-INF/persistence.xml}
  Caused by: org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name
  'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
  Cannot create inner bean '(inner bean)' of type
  [org.springframework.transaction.interceptor.TransactionInterceptor]
  while setting bean property 'transactionInterceptor'; nested exception
  is org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name '(inner bean)': Cannot resolve reference to
  bean 'transactionManager' while setting bean property
  'transactionManager'; nested exception is
  org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name 'transactionManager' defined in ServletContext
  resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference

Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Frans Thamura
can we have the code also?

F


Re: Struts 2 + Spring 2 + JPA + AJAX tutorial

2008-01-04 Thread Pascal SEREMES-DAMAL
All the code is there :
http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html

But I had a problem to deploy the application on my tomcat server.

Musachy and Laurie suggested to move the file persistence.xml from
/META-INF (where indicated in the tutorial) to
/WEB-INF/classes/META-INF.

Enjoy.


Pascal


2008/1/4, Frans Thamura [EMAIL PROTECTED]:
 can we have the code also?

 F


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in Struts 2 + Spring 2 + JPA + AJAX tutorial

2007-11-20 Thread Musachy Barroso
Do you have a quickstart schema in your db?

musachy

On Nov 20, 2007 12:43 AM, Lewis Li [EMAIL PROTECTED] wrote:
 Hi! I'm doing the tutorial Struts 2 + Spring 2 + JPA + AJAX located at
 http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html.
 I have installed and configured MySQL and created a database named
 quickstart. But I get a syntax error when running this script:
 CREATE TABLE 'quickstart'.'Person' (
   'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
   'firstName' VARCHAR(45) NOT NULL,
   'lastName' VARCHAR(45) NOT NULL,
   PRIMARY KEY('id')
 )
 ENGINE = InnoDB;This is exactly the same script from the tutorial. The error
 report reported by MySQL Query Browser is:
 You have an error in your SQL syntax; check the manual that corresponds to
 your MySQL server version for the right syntax to use near
 ''quickstart'.'Person' (
   'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
   'fi' at line 1

 I really can't figure out what's wrong with the script. I'm running this
 version of MySQL on a Windows XP computer:
 Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
 I'd really appreciate it if anyone could help me out. Thank you.

 Lewis LI
 E-mail: [EMAIL PROTECTED]
 Phone: +86-755-8619 3841


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in Struts 2 + Spring 2 + JPA + AJAX tutorial

2007-11-20 Thread Lewis Li
Yes, I created a database named quickstart before running the script. A 
database is the same as a schema.

Can you successfully run the script with your MySql?

Lewis
- Original Message - 
From: Musachy Barroso [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, November 20, 2007 9:59 PM
Subject: Re: Problem running the MySQL script in Struts 2 + Spring 2 + JPA 
+ AJAX tutorial




Do you have a quickstart schema in your db?

musachy

On Nov 20, 2007 12:43 AM, Lewis Li [EMAIL PROTECTED] wrote:

Hi! I'm doing the tutorial Struts 2 + Spring 2 + JPA + AJAX located at
http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html.
I have installed and configured MySQL and created a database named
quickstart. But I get a syntax error when running this script:
CREATE TABLE 'quickstart'.'Person' (
  'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  'firstName' VARCHAR(45) NOT NULL,
  'lastName' VARCHAR(45) NOT NULL,
  PRIMARY KEY('id')
)
ENGINE = InnoDB;This is exactly the same script from the tutorial. The 
error

report reported by MySQL Query Browser is:
You have an error in your SQL syntax; check the manual that corresponds 
to

your MySQL server version for the right syntax to use near
''quickstart'.'Person' (
  'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  'fi' at line 1

I really can't figure out what's wrong with the script. I'm running this
version of MySQL on a Windows XP computer:
Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
I'd really appreciate it if anyone could help me out. Thank you. 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in Struts 2 + Spring 2 + JPA + AJAX tutorial

2007-11-20 Thread Dave Newton
Remove all the single quotes and try; it works for me
fine that way.

MySQL documentation is available
http://dev.mysql.com/doc/#manual.

d.

--- Lewis Li [EMAIL PROTECTED] wrote:

 Yes, I created a database named quickstart before
 running the script. A 
 database is the same as a schema.
 Can you successfully run the script with your MySql?
 
 Lewis
 - Original Message - 
 From: Musachy Barroso [EMAIL PROTECTED]
 To: Struts Users Mailing List
 user@struts.apache.org
 Sent: Tuesday, November 20, 2007 9:59 PM
 Subject: Re: Problem running the MySQL script in
 Struts 2 + Spring 2 + JPA 
 + AJAX tutorial
 
 
  Do you have a quickstart schema in your db?
 
  musachy
 
  On Nov 20, 2007 12:43 AM, Lewis Li
 [EMAIL PROTECTED] wrote:
  Hi! I'm doing the tutorial Struts 2 + Spring 2 +
 JPA + AJAX located at
 

http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html.
  I have installed and configured MySQL and created
 a database named
  quickstart. But I get a syntax error when
 running this script:
  CREATE TABLE 'quickstart'.'Person' (
'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
'firstName' VARCHAR(45) NOT NULL,
'lastName' VARCHAR(45) NOT NULL,
PRIMARY KEY('id')
  )
  ENGINE = InnoDB;This is exactly the same script
 from the tutorial. The 
  error
  report reported by MySQL Query Browser is:
  You have an error in your SQL syntax; check the
 manual that corresponds 
  to
  your MySQL server version for the right syntax to
 use near
  ''quickstart'.'Person' (
'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
'fi' at line 1
 
  I really can't figure out what's wrong with the
 script. I'm running this
  version of MySQL on a Windows XP computer:
  Server version: 5.0.41-community-nt MySQL
 Community Edition (GPL)
  I'd really appreciate it if anyone could help me
 out. Thank you. 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in Struts 2 + Spring 2 + JPA + AJAX tutorial

2007-11-20 Thread Lewis Li

Thanks, Dave. It finally works now.
I can't believe the officical Struts 2 tutorial has such a silly error. Did 
the tutorial authors ever try running the script themselves?


Lewis
- Original Message - 
From: Dave Newton [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 21, 2007 11:12 AM
Subject: Re: Problem running the MySQL script in Struts 2 + Spring 2 + JPA 
+ AJAX tutorial




Remove all the single quotes and try; it works for me
fine that way.

MySQL documentation is available
http://dev.mysql.com/doc/#manual.

d. 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in Struts 2 + Spring 2 + JPA + AJAX tutorial

2007-11-20 Thread Dave Newton
--- Lewis Li [EMAIL PROTECTED] wrote:
 I can't believe the officical Struts 2 tutorial has
 such a silly error. Did the tutorial authors ever 
 try running the script themselves?

Everybody runs under different environments, different
settings, different toolchains, etc. The framework and
its documentation are the product of volunteers.

Errors in documentation may be brought up here, but
filing a JIRA [1] will increase the likelihood that
bugs and errors will be looked at (and possibly
fixed). You may also lend a hand either at the public
wiki [2] or on the official documentation wiki [3] 
after filing a CLA.

d.

[1] https://issues.apache.org/struts/browse/WW
[2] http://cwiki.apache.org/S2WIKI/home.html
[3] http://cwiki.apache.org/WW/home.html


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem running the MySQL script in Struts 2 + Spring 2 + JPA + AJAX tutorial

2007-11-19 Thread Lewis Li
Hi! I'm doing the tutorial Struts 2 + Spring 2 + JPA + AJAX located at 
http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html.
I have installed and configured MySQL and created a database named 
quickstart. But I get a syntax error when running this script:

CREATE TABLE 'quickstart'.'Person' (
 'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
 'firstName' VARCHAR(45) NOT NULL,
 'lastName' VARCHAR(45) NOT NULL,
 PRIMARY KEY('id')
)
ENGINE = InnoDB;This is exactly the same script from the tutorial. The error 
report reported by MySQL Query Browser is:
You have an error in your SQL syntax; check the manual that corresponds to 
your MySQL server version for the right syntax to use near 
''quickstart'.'Person' (

 'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
 'fi' at line 1

I really can't figure out what's wrong with the script. I'm running this 
version of MySQL on a Windows XP computer:

Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
I'd really appreciate it if anyone could help me out. Thank you.

Lewis LI
E-mail: [EMAIL PROTECTED]
Phone: +86-755-8619 3841 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2]struts-2-spring-2-jpa-ajax tutorial

2007-09-27 Thread Eugen Stoianovici
I've started learning struts based on this tutorial which (from my 
limited experience) is a good starting point.
There's on problem for me though. It gets frustrating implementing all 
my persistence related calls in a service class. Is there a way to 
instantiate my action classes with an EntityManager, so that i can 
perform simple persistence related jobs directly in my actions? ... Is 
this a violation of struts framework concepts?


Thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2]struts-2-spring-2-jpa-ajax tutorial

2007-09-27 Thread Musachy Barroso
You can just inject your entity manager in your actions and do all the
persistence stuff in there. JPA/Hibernate are not related or tied to
struts in anyway. Just be advised that doing that will make your
actions harder to test/maintain/extend and your code won't be
reusable.

regards
musachy

On 9/27/07, Eugen Stoianovici [EMAIL PROTECTED] wrote:
 I've started learning struts based on this tutorial which (from my
 limited experience) is a good starting point.
 There's on problem for me though. It gets frustrating implementing all
 my persistence related calls in a service class. Is there a way to
 instantiate my action classes with an EntityManager, so that i can
 perform simple persistence related jobs directly in my actions? ... Is
 this a violation of struts framework concepts?

 Thanks

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Hey you! Would you help me to carry the stone? Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-08-14 Thread Ajax

Hi!

I've been following this tutorial too, and think it serves as a great
starting point.
However, like some other users, I have encountered the problem with

code

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
Cannot create inner bean '(inner bean)' of type
[org.springframework.transaction.interceptor.TransactionInterceptor] while
setting bean property 'transactionInterceptor'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name '(inner bean)': Cannot resolve reference to bean
'transactionManager' while setting bean property 'transactionManager';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'transactionManager' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean
'entityManagerFactory' while setting bean property 'entityManagerFactory';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'entityManagerFactory' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of
init method failed; nested exception is java.lang.NoClassDefFoundError:
org/hibernate/annotations/common/reflection/ReflectionManager
/code

LucaLuca got it solved by adding hibernate-all.jar to the lib, but that
file was nowhere to be found in my distributions (struts, spring, hibernate
packs). I had to download 89 megs of jboss-seam stuff and grab it from
there. It helped matters for me as well.
For the time being, I am a mere follower of instructions in this matter, and
it would be great if someone could take the time to explain what was
happening, and what this fix was all about.

Thanks for a great roadmap, and for the contributions to the discussion so
far!

Kind regards
/A




LucaLuca wrote:
 
 Hi,
 
 It was in the right place, but didn't work. So, i've tried to put the
 hilbernate-all.jar in the build path, and it worked. I don't know the
 reason, but probably i was using the latest version of the requested 
 libraries and it need something older..
 
 Thank you everybody for the time you spent with me.
 
 LucaLuca
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-%2B-Spring-2-%2B-JPA-%2B-AJAX--Tutorial-tf3542150.html#a12142394
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-18 Thread LucaLuca

Hi,

It was in the right place, but didn't work. So, i've tried to put the
hilbernate-all.jar in the build path, and it worked. I don't know the
reason, but probably i was using the latest version of the requested 
libraries and it need something older..

Thank you everybody for the time you spent with me.

LucaLuca




cilquirm wrote:
 
 By the looks of it, your classpath is messed up.
 
 Is the hibernate3 jar in the right place?
 
 I can't think of any other reason it wouldn't be able to find
 org.hibernate.MappingNotFoundException
 
 
 
 LucaLuca wrote:
 
 Hi,
 
 I've tried to make some changes to make it work..But nothing!. These are
 my configuration files:
 
 ---ApplicationContext.xml:---
 
 ?xml version=1.0 encoding=UTF-8?
 beans default-autowire=autodetect
  xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xsi:schemaLocation=
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
 http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
 http://www.springframework.org/schema/aop
 http://www.springframework.org/schema/aop/spring-aop-2.0.xsd;
 
 
 bean
 class=org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
 /  
  bean
 class=org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor/
   
  
  bean id=personService class=quickstart.service.PersonServiceImpl /
 
  bean id=dataSource

 class=org.springframework.jdbc.datasource.DriverManagerDataSource
 property name=driverClassName value=com.mysql.jdbc.Driver /
 property name=url
 value=jdbc:mysql://localhost:3306/quickstart /
 property name=username value=root /
 property name=password value=password /
 /bean
 
 bean id=entityManagerFactory

 class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
 property name=dataSource ref=dataSource /  
  property name=jpaVendorAdapter
 bean
 class=org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
 
  property name=database value=MYSQL /
 property name=showSql value=true /
 /bean
 /property
 /bean
   
 bean id=transactionManager
 class=org.springframework.orm.jpa.JpaTransactionManager
 property name=entityManagerFactory ref=entityManagerFactory
 /
  property name=dataSource ref=dataSource/
 /bean
 
  tx:annotation-driven transaction-manager=transactionManager /
  
 bean id=personAction scope=prototype
 class=quickstart.action.PersonAction
 constructor-arg ref=personService /
 /bean
 /beans
 
 
 ---Web.xml---
 
 ?xml version=1.0 encoding=UTF-8?
 web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 display-namequickstart/display-name
 filter
 filter-namestruts2/filter-name
 filter-class
 org.apache.struts2.dispatcher.FilterDispatcher
 /filter-class
 /filter
 
 filter-mapping
 filter-namestruts2/filter-name
 url-pattern/*/url-pattern
 /filter-mapping
 
 listener
 listener-class
 org.springframework.web.context.ContextLoaderListener
 /listener-class
 /listener
 
  welcome-file-list
 welcome-fileindex.jsp/welcome-file
 /welcome-file-list
  
 /web-app
 
 
 --Struts.xml--
 
 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd;
 struts

 package name=quickstart.action extends=struts-default
 
 action name=list method=execute
 class=quickstart.action.PersonAction
 resultpages/list.jsp/result
 result name=inputpages/list.jsp/result
 /action
 
 action name=remove class=quickstart.action.PersonAction
 method=remove
 resultpages/list.jsp/result
 result name=inputpages/list.jsp/result
 /action
 
 action name=save class=quickstart.action.PersonAction
 method=save
 resultpages/list.jsp/result
 result name=inputpages/list.jsp/result
 /action
 /package
 
 /struts
 
 --Struts.properties--
 
 struts.objectFactory =
 org.apache.struts2.spring.StrutsSpringObjectFactory
 struts.devMode = true
 struts.enable.DynamicMethodInvocation = false
 struts.objectFactory.spring.autoWire = type
 
 
 ---This is my Stack error trace...:---
 
 
 
 GRAVE: Context 

Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-17 Thread LucaLuca

Hi,

I've tried to make some changes to make it work..But nothing!. These are my
configuration files:

---ApplicationContext.xml:---

?xml version=1.0 encoding=UTF-8?
beans default-autowire=autodetect
xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:aop=http://www.springframework.org/schema/aop;
xmlns:tx=http://www.springframework.org/schema/tx;
xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd;


bean
class=org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
/  
bean
class=org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor/
  

bean id=personService class=quickstart.service.PersonServiceImpl /
   
bean id=dataSource
class=org.springframework.jdbc.datasource.DriverManagerDataSource
property name=driverClassName value=com.mysql.jdbc.Driver /
property name=url value=jdbc:mysql://localhost:3306/quickstart
/
property name=username value=root /
property name=password value=password /
/bean

bean id=entityManagerFactory
   
class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
property name=dataSource ref=dataSource / 
property name=jpaVendorAdapter
bean
class=org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter   
 
property name=database value=MYSQL /
property name=showSql value=true /
/bean
/property
/bean
  
bean id=transactionManager
class=org.springframework.orm.jpa.JpaTransactionManager
property name=entityManagerFactory ref=entityManagerFactory /
property name=dataSource ref=dataSource/
/bean

tx:annotation-driven transaction-manager=transactionManager /

bean id=personAction scope=prototype
class=quickstart.action.PersonAction
constructor-arg ref=personService /
/bean
/beans


---Web.xml---

?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
display-namequickstart/display-name
filter
filter-namestruts2/filter-name
filter-class
org.apache.struts2.dispatcher.FilterDispatcher
/filter-class
/filter

filter-mapping
filter-namestruts2/filter-name
url-pattern/*/url-pattern
/filter-mapping

listener
listener-class
org.springframework.web.context.ContextLoaderListener
/listener-class
/listener

 welcome-file-list
welcome-fileindex.jsp/welcome-file
/welcome-file-list
 
/web-app


--Struts.xml--

?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;
struts
   
package name=quickstart.action extends=struts-default

action name=list method=execute
class=quickstart.action.PersonAction
resultpages/list.jsp/result
result name=inputpages/list.jsp/result
/action

action name=remove class=quickstart.action.PersonAction
method=remove
resultpages/list.jsp/result
result name=inputpages/list.jsp/result
/action

action name=save class=quickstart.action.PersonAction
method=save
resultpages/list.jsp/result
result name=inputpages/list.jsp/result
/action
/package

/struts

--Struts.properties--

struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory
struts.devMode = true
struts.enable.DynamicMethodInvocation = false
struts.objectFactory.spring.autoWire = type


---This is my Stack error trace...:---



GRAVE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'entityManagerFactory' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
exception is java.lang.NoClassDefFoundError:
org/hibernate/MappingNotFoundException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1178)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:407)
at

Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-17 Thread cilquirm

By the looks of it, your classpath is messed up.

Is the hibernate3 jar in the right place?

I can't think of any other reason it wouldn't be able to find
org.hibernate.MappingNotFoundException



LucaLuca wrote:
 
 Hi,
 
 I've tried to make some changes to make it work..But nothing!. These are
 my configuration files:
 
 ---ApplicationContext.xml:---
 
 ?xml version=1.0 encoding=UTF-8?
 beans default-autowire=autodetect
   xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xsi:schemaLocation=
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
 http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
 http://www.springframework.org/schema/aop
 http://www.springframework.org/schema/aop/spring-aop-2.0.xsd;
 
 
 bean
 class=org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
 /  
   bean
 class=org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor/
   
   
   bean id=personService class=quickstart.service.PersonServiceImpl /
  
   bean id=dataSource

 class=org.springframework.jdbc.datasource.DriverManagerDataSource
 property name=driverClassName value=com.mysql.jdbc.Driver /
 property name=url
 value=jdbc:mysql://localhost:3306/quickstart /
 property name=username value=root /
 property name=password value=password /
 /bean
 
 bean id=entityManagerFactory

 class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
 property name=dataSource ref=dataSource /   
   property name=jpaVendorAdapter
 bean
 class=org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter 

   property name=database value=MYSQL /
 property name=showSql value=true /
 /bean
 /property
 /bean
   
 bean id=transactionManager
 class=org.springframework.orm.jpa.JpaTransactionManager
 property name=entityManagerFactory ref=entityManagerFactory
 /
   property name=dataSource ref=dataSource/
 /bean
 
   tx:annotation-driven transaction-manager=transactionManager /
   
 bean id=personAction scope=prototype
 class=quickstart.action.PersonAction
 constructor-arg ref=personService /
 /bean
 /beans
 
 
 ---Web.xml---
 
 ?xml version=1.0 encoding=UTF-8?
 web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 display-namequickstart/display-name
 filter
 filter-namestruts2/filter-name
 filter-class
 org.apache.struts2.dispatcher.FilterDispatcher
 /filter-class
 /filter
 
 filter-mapping
 filter-namestruts2/filter-name
 url-pattern/*/url-pattern
 /filter-mapping
 
 listener
 listener-class
 org.springframework.web.context.ContextLoaderListener
 /listener-class
 /listener
 
  welcome-file-list
 welcome-fileindex.jsp/welcome-file
 /welcome-file-list
  
 /web-app
 
 
 --Struts.xml--
 
 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd;
 struts

 package name=quickstart.action extends=struts-default
 
 action name=list method=execute
 class=quickstart.action.PersonAction
 resultpages/list.jsp/result
 result name=inputpages/list.jsp/result
 /action
 
 action name=remove class=quickstart.action.PersonAction
 method=remove
 resultpages/list.jsp/result
 result name=inputpages/list.jsp/result
 /action
 
 action name=save class=quickstart.action.PersonAction
 method=save
 resultpages/list.jsp/result
 result name=inputpages/list.jsp/result
 /action
 /package
 
 /struts
 
 --Struts.properties--
 
 struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory
 struts.devMode = true
 struts.enable.DynamicMethodInvocation = false
 struts.objectFactory.spring.autoWire = type
 
 
 ---This is my Stack error trace...:---
 
 
 
 GRAVE: Context initialization failed
 org.springframework.beans.factory.BeanCreationException: Error creating
 bean with name 'entityManagerFactory' defined in ServletContext resource
 [/WEB-INF/applicationContext.xml]: Invocation of init method failed;
 nested exception is java.lang.NoClassDefFoundError:
 org/hibernate/MappingNotFoundException
 at
 

Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-16 Thread LucaLuca

Hi,

I think so too. But i've observed that the class called is correctly in the
Jar and his path in ApplicationContext.xml is right. I really don't know
what is the problem.. It's necessary to configure Tomcat 6 too ? Musachy
Barroso in his article doesn't say nothing about it..

Thank you
LucaLuca


Ted Husted wrote:
 
 The Struts2-api.jar is obsolete. The error seems to be related to
 hibernate. It looks like the class needed to instantiate
 entityManagerFactory is missing.
 
 Like as not, the only JARs you need for Struts are
 commons-logging-api, freemarker, ognl, struts2-core, and xwork, plus
 the stuts2-spring plugin.
 
 -Ted.
 
 On 7/13/07, LucaLuca [EMAIL PROTECTED] wrote:

 Hi,

 I read that tutorial too and i've follewed all the steps. My problem is
 that
 i don't know which are the Jar requested. I was not able to find the
 strtus2-api.jar. Where i can find it? I've tried to add all the Hibernate
 3.2, Spring 2.0.6, Struts 2.0.8 jar, but it did not work.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-%2B-Spring-2-%2B-JPA-%2B-AJAX--Tutorial-tf3542150.html#a11613583
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-13 Thread LucaLuca
)
 at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
 at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
 at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
 at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
 at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
 at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:733)
 at
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:511)
 at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:337)
 at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
 at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
 at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
 at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
 at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
 at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:448)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
13-lug-2007 12.06.58 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
13-lug-2007 12.06.58 org.apache.catalina.core.StandardContext start
GRAVE: Context [/Struts2_Spring_Hibernate] startup failed due to previous
errors
13-lug-2007 12.06.58 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
13-lug-2007 12.06.58 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
13-lug-2007 12.06.58 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
13-lug-2007 12.06.58 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5485 ms


Thank you.



Minerva CC wrote:
 
 Hi,
  
 I read thru Struts 2 + Spring 2 + JPA + AJAX tutorial and found it is a
 great example to start Struts 2. So, I setup a Eclipse and Tomcat
 environment to run the tutorial and everything works fine. However, when I
 tried to add something more, I encountered a problem:
  
 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Error listenerStart
 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Context [/person] startup failed due to previous errors
  
 I knew there is something wrong with my code. May be in the Actions or may
 be in the db services. But, how can I know where is the problem? I tried
 to setup a log4j properties file. But, I am new to Eclipse Web development
 environment, I couldn't fine a right place for the log4j.properties file
 and also what properties I should setup catch the problems.
  
 Thank you in advance for your help.
  
 Willa
 
 
  
 
 Now that's room service!  Choose from over 150,000 hotels
 in 45,000 destinations on Yahoo! Travel to find your fit.
 http://farechase.yahoo.com/promo-generic-14795097
 

-- 
View

Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-07-13 Thread Ted Husted

The Struts2-api.jar is obsolete. The error seems to be related to
hibernate. It looks like the class needed to instantiate
entityManagerFactory is missing.

Like as not, the only JARs you need for Struts are
commons-logging-api, freemarker, ognl, struts2-core, and xwork, plus
the stuts2-spring plugin.

-Ted.

On 7/13/07, LucaLuca [EMAIL PROTECTED] wrote:


Hi,

I read that tutorial too and i've follewed all the steps. My problem is that
i don't know which are the Jar requested. I was not able to find the
strtus2-api.jar. Where i can find it? I've tried to add all the Hibernate
3.2, Spring 2.0.6, Struts 2.0.8 jar, but it did not work.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-04-07 Thread Piero Sartini
 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Error listenerStart
 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Context [/person] startup failed due to previous errors

looks like there is a problem with a listener in your web.xml

 I tried to 
 setup a log4j properties file. But, I am new to Eclipse Web development
 environment, I couldn't fine a right place for the log4j.properties file
 and also what properties I should setup catch the problems.

The log4j.properties file should be in the root of your classpath.
btw if you are new to Eclipse, give NetBeans a try as well.

Piero

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial

2007-04-07 Thread Minerva CC
Hi Piero,

Thank you so much for your help. I setup log4j properties file and now I am 
able to debug the server startup. Actually the problem was caused by a missing 
Action class, which I deleted last night by a accident. Now, everything is 
working again.

Thank you again for you support-:)

Willa



- Original Message 
From: Piero Sartini [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Saturday, April 7, 2007 3:20:23 PM
Subject: Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial


 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Error listenerStart
 Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
 SEVERE: Context [/person] startup failed due to previous errors

looks like there is a problem with a listener in your web.xml

 I tried to 
 setup a log4j properties file. But, I am new to Eclipse Web development
 environment, I couldn't fine a right place for the log4j.properties file
 and also what properties I should setup catch the problems.

The log4j.properties file should be in the root of your classpath.
btw if you are new to Eclipse, give NetBeans a try as well.

Piero

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 

Looking for earth-friendly autos? 
Browse Top Cars by Green Rating at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial Issue

2007-04-05 Thread Peter Milne
On Wed, 2007-04-04 at 20:12 -0400, Musachy Barroso wrote:
 oopsI had to upload a new one, overwriting the old one doesn't fix it:
 
 http://cwiki.apache.org/confluence/download/attachments/33168/quickstart_maven2.zip
 
 musachy
 
 On 4/4/07, Peter Milne [EMAIL PROTECTED] wrote:
 
  I'm getting the following error when I try to unzip the maven zipped
  project from
 
 
  http://cwiki.apache.org/confluence/download/attachments/33168/quickstart_maven.zip
 
That's fixed the maven build and deployment to jetty. Thanks.

When I tried the Eclipse project from:

http://cwiki.apache.org/confluence/download/attachments/33168/quickstart.zip

this built but gave multiple warnings like:

Unknown tag(s:a).quickstart/WebContent..

The project deployed to Tomcat but failed with:

Error loading '/quickstart/list.action' (500 Internal Server Error)

I'm not an Eclipse user so maybe I have a configuration problem. Perhaps
someone could test this. I'm using Eclipse Version: 3.2.2 Build id:
M20070212-1330

It was however very straightforward to open the project in NetBeans
using the maven plug-in by adding the junit dependency to the pom:

dependency
groupIdjunit/groupId
artifactIdjunit/artifactId
version3.8.1/version
scopetest/scope
/dependency

The project built and deployed to Tomcat perfectly

Peter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]