christianPa / full-hibernate-plugin-for-struts2

Automatically exported from code.google.com/p/full-hibernate-plugin-for-struts2
0 stars 0 forks source link

Fail upon initialization #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Do clean install of struts 2.2.2. 
2. Install dependencies
3. Set hibernate.cfg.xml to connect to mysql database
4. Initialize

What is the expected output? What do you see instead?
Application fails on initialization. Stack trace:

2010-11-04 08:57:56,683 INFO  org.hibernate.cfg.Configuration.configure:1518 - 
configuring from resource: /hibernate.cfg.xml
2010-11-04 08:57:56,683 INFO  
org.hibernate.cfg.Configuration.getConfigurationInputStream:1495 - 
Configuration resource: /hibernate.cfg.xml
Could not build Full Hibernate Plugin's Session Factory
org.hibernate.MappingException: An AnnotationConfiguration instance is required 
to use <mapping class="com.vaannila.domain.User"/>
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1692)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1647)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1626)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1600)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1520)
    at com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory.createAndTestSessionFactory(HibernateSessionFactory.java:267)
    at com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:227)
    at com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory.getNewSession(HibernateSessionFactory.java:155)
    at com.googlecode.s2hibernate.struts2.plugin.util.HibernateSessionFactory.getSession(HibernateSessionFactory.java:100)
    at com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor.getHibernateSessionFromFactory(SessionTransactionInjectorInterceptor.java:374)
    at com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor.injectHibernateCoreSessionByAnnotation(SessionTransactionInjectorInterceptor.java:449)
    at com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor.injectHibernateCoreSessionByAnnotation(SessionTransactionInjectorInterceptor.java:465)
    at com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor.intercept(SessionTransactionInjectorInterceptor.java:165)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)

What version of the product are you using? On what operating system?
fullhibernatecore-plugin-2.2.1

Please provide any additional information below.
I'm trying to use annotations like SessionTarget and TransactionTarget, but it 
appears to trying to use a session factory appropriate to xml files.

Original issue reported on code.google.com by dalte...@gmail.com on 4 Nov 2010 at 1:03

GoogleCodeExporter commented 8 years ago
I got the same exeception too. someone please look into it. 
Here is my stacktrace.

3485 [http-8080-3] INFO org.hibernate.cfg.Configuration - configuring from 
resource: /hibernate.cfg.xml
3485 [http-8080-3] INFO org.hibernate.cfg.Configuration - Configuration 
resource: /hibernate.cfg.xml
Could not build Full Hibernate Plugin's Session Factory
org.hibernate.MappingException: An AnnotationConfiguration instance is required 
to use <mapping class="com.ci.domain.College"/>
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1692)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1647)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1626)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1600)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1520)

Original comment by ibharatsharma@gmail.com on 2 Dec 2010 at 11:07