Re: [Formatting data] - Format a number as currency

2008-01-22 Thread Pascal SEREMES-DAMAL
Thanks to Martin for his answer.

I had the idea of JSTL too Alberto. Thank you very much.


2008/1/22, Alberto A. Flores [EMAIL PROTECTED]:

 I'll recommend using using JSTL instead.


 On Jan 21, 2008 8:11 PM, Pascal SEREMES-DAMAL [EMAIL PROTECTED]
 wrote:

  Hi everyone!!!
 
  I'd like to know if it is possible to format a number into a currency
 with
  the struts taglib.
 
  Thanks.
 



 --
 Alberto
 http://www.linkedin.com/in/aflores



Re: [Formatting data] - Format a number as currency

2008-01-22 Thread Pascal SEREMES-DAMAL
Thank you John. But How can I manage with the proprty file?

2008/1/22, John Koutros [EMAIL PROTECTED]:

 You can use the s:text struts tag.

 s:text name=format.moneys:param value=amount//s:text

 Where

 format.money = {0,number,#,##0.00} in a property file


 -Original Message-
 From: Pascal SEREMES-DAMAL [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 22, 2008 3:12 AM
 To: Struts Users Mailing List
 Subject: [Formatting data] - Format a number as currency

 Hi everyone!!!

 I'd like to know if it is possible to format a number into a currency
 with
 the struts taglib.

 Thanks.


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




[Formatting data] - Format a number as currency

2008-01-21 Thread Pascal SEREMES-DAMAL
Hi everyone!!!

I'd like to know if it is possible to format a number into a currency with
the struts taglib.

Thanks.


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 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 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 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 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]