Announcement Announcement Module
Collapse
No announcement yet.
Struts 2 + Spring 2 + JPA + AJAX Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Struts 2 + Spring 2 + JPA + AJAX

    I tried to do this example http://struts.apache.org/2.x/docs/st...-jpa-ajax.html

    But some error occurs:


    Jan 16, 2008 11:01:31 AM org.springframework.web.context.ContextLoader initWebApplicationContext
    SEVERE: Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'personService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.transaction.config.internalTr ansactionAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.Transa ctionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: 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.BeanCreationExce ption: 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.BeanCreationExce ption: 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/proxy/EntityNotFoundDelegate
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:547)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:485)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:455)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 51)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:169)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:248)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:170)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:413)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:735)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:369)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:251)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:190)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 45)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3830)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4337)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:516)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:413)



    Please help me i can not go ahead for this error. Thanks.

  • #2
    Originally posted by lifo.asdev View Post
    Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/proxy/EntityNotFoundDelegate
    It seems you dont have the Hibernate JARs on your classpath. Or maybe a wrong version ...

    Comment


    • #3
      Hi,
      I followed the same tutorial link.. http://struts.apache.org/2.3.8/docs/...-jpa-ajax.html

      I am a newbie to struts/spring framework, and encountered following error while running sample application. Any help in this regard is appreciated. I am giving some of the info here..

      I have included the following jar files in \WebContent\WEB-INF\lib directory in my project
      antlr-2.7.7.jar
      aopalliance-1.0.jar
      asm-3.3.jar
      asm-attrs-1.5.2.jar
      asm-commons-3.3.jar
      cglib-2.1.jar
      commons-collections-3.1.jar
      commons-logging-api-1.1.jar
      dom4j-1.6.1.jar
      ehcache-1.1.jar
      ejb3-persistence-1.0.2.GA.jar
      freemarker-2.3.19.jar
      hibernate-annotations-3.5.6-Final.jar
      hibernate-commons-annotations-4.0.1.Final.jar
      hibernate-core-4.1.9.Final.jar
      hibernate-entitymanager-4.1.9.Final.jar
      javassist-3.17.1-GA.jar
      jboss-archive-browsing-5.0.0alpha-200607201-119.jar
      jdbc2_0-stdext.jar
      jta-1.1.jar
      mysql-connector-java-5.1.19-bin.jar
      ognl-3.0.6.jar
      spring-aop-3.0.5.RELEASE.jar
      spring-asm-3.0.5.RELEASE.jar
      spring-beans-3.0.5.RELEASE.jar
      spring-context-3.0.5.RELEASE.jar
      spring-core-3.0.5.RELEASE.jar
      spring-expression-3.0.5.RELEASE.jar
      spring-jdbc-3.2.1.RELEASE.jar
      spring-orm-3.2.0.RELEASE.jar
      spring-tx-3.2.0.RELEASE.jar
      spring-web-3.0.5.RELEASE.jar
      struts2-config-browser-plugin-2.3.8.jar
      struts2-core-2.3.8.jar
      struts2-spring-plugin-2.3.8.jar
      xml-apis-1.3.02.jar
      xwork-core-2.3.8.jar

      I have also included persistence.xml in \WebContent\META-INF folder, its contents are
      <?xml version="1.0" encoding="UTF-8"?>
      <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">
      <!-- Empty JPA configuration -->
      </persistence-unit>
      </persistence>

      When I tried to run the project in eclipse, I encountered following errors

      SEVERE: Context initialization failed
      org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authorService': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtil s.getAnnotation(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/ClassLjava/lang/annotation/Annotation;
      at org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor.postProcessPropertyValues (PersistenceAnnotationBeanPostProcessor.java:343)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1074)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:517)
      ...

      Comment

      Working...
      X