1 Reply Latest reply on Apr 17, 2007 2:49 AM by Ales Justin

    Problem using Spring + JPA + Struts

    Suneet Shah Newbie

      Hello,

      I am trying to integrate spring into my struts application and am getting the exception below. The service classes, which are calling the jpa objects were tested with Junit and they worked fine so I am not sure what the cause of the problem is.

      Any assistance would be appreciated.

      00:26:54,453 INFO [XmlWebApplicationContext] Refreshing org.springframework.web.context.support.XmlWebApplicationContext@acc399: display name [WebApplicationContext for namespace 'action-servlet']; startup date [Tue Apr 17 00:26:54 EDT 2007]; root of context hierarchy
      00:26:54,765 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/webappContext.xml]
      00:26:55,046 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [META-INF/commonContext.xml]
      00:26:55,234 INFO [XmlWebApplicationContext] Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@acc399]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1a23566
      00:26:55,593 INFO [XmlWebApplicationContext] Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      00:26:55,718 INFO [DriverManagerDataSource] Loaded JDBC driver: com.mysql.jdbc.Driver
      00:26:55,718 INFO [XmlWebApplicationContext] Bean 'dataSource' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      00:26:55,750 INFO [XmlWebApplicationContext] Bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#13be416' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      00:26:56,718 INFO [Version] Hibernate Annotations 3.3.0.GA
      00:26:56,750 INFO [Environment] Hibernate 3.2.0.ga
      00:26:56,765 INFO [Environment] hibernate.properties not found
      00:26:56,781 INFO [Environment] Bytecode provider name : cglib
      00:26:56,781 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      00:26:57,046 INFO [Version] Hibernate EntityManager 3.3.1.GA
      00:26:57,093 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a23566: defining beans [/authenticate,serviceManager,serviceDAO,userManager,userDAO,entityManagerFactory,dataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor]; root of factory hierarchy
      00:26:57,109 ERROR [ContextLoaderPlugIn] Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/commonContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
      Caused by:
      java.lang.IllegalAccessError: tried to access method org.hibernate.engine.CascadeStyle.<init>()V from class org.hibernate.engine.EJB3CascadeStyle$1
       at org.hibernate.engine.EJB3CascadeStyle$1.<init>(EJB3CascadeStyle.java:24)
       at org.hibernate.engine.EJB3CascadeStyle.<clinit>(EJB3CascadeStyle.java:19)
       at org.hibernate.ejb.event.EJB3PersistEventListener.<clinit>(EJB3PersistEventListener.java:19)
       at org.hibernate.ejb.EventListenerConfigurator.<init>(EventListenerConfigurator.java:80)
       at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:132)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:125)
       at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:214)
       at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1143)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1110)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
       at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:104)