Note that there are some explanatory texts on larger screens.

plurals
  1. POstruts2-fullhibernatecore-plugin-2.2.2-GA not working
    primarykey
    data
    text
    <p>I am using struts2-fullhibernatecore-plugin-2.2.2-GA in a demo strut2 project with Hibernate. I tried my best but can not make it work. I am using all the latest jars. </p> <p><strong><em>Am I missing something?</em></strong></p> <p>Please help</p> <p><strong>ERROR LOG</strong></p> <pre><code>2012-09-14 02:06:50 - [ INFO - SessionTransactionInjectorInterceptor:41 ] --&gt; Full Hibernate Plugin Validation could not detect Hibernate Validator 3.x 2012-09-14 02:06:50 - [ INFO - SessionTransactionInjectorInterceptor:46 ] --&gt; Full Hibernate Plugin Validation using Hibernate Validator 4.x </code></pre> <p><strong>Library in my project</strong></p> <p><img src="https://i.stack.imgur.com/BUGUY.gif" alt="enter image description here"></p> <p><strong>When I access page than get error</strong></p> <pre><code>java.lang.NullPointerException com.myapp.dao.CustomerDAOImpl.listCustomer(CustomerDAOImpl.java:26) com.myapp.web.CustomerAction.listCustomer(CustomerAction.java:47) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)...... </code></pre> <p><strong>My CustomerDAOImpl.java</strong></p> <pre><code>package com.myapp.dao; import com.googlecode.s2hibernate.struts2.plugin.annotations.SessionTarget; import com.googlecode.s2hibernate.struts2.plugin.annotations.TransactionTarget; import com.myapp.model.Customer; import org.hibernate.Session; import org.hibernate.Transaction; import java.util.List; public class CustomerDAOImpl implements CustomerDAO { @SessionTarget Session session; @TransactionTarget Transaction transaction; //add the customer public void addCustomer(Customer customer) { session.save(customer); } //return all the customers in list public List&lt;Customer&gt; listCustomer() { return session.createQuery("from Customer").list(); } } </code></pre> <p>**EDITED *********************</p> <pre><code> @SessionTarget Session session; @TransactionTarget Transaction transaction; </code></pre> <p>Problem is in the above code when Session and Transaction is injected. I am wondering that this might be problem of struts2-fullhibernatecore-plugin-2.2.2-GA not supporting </p> <pre><code>hibernate-release-4.1.6.Final hibernate-validator-4.3.0.Final </code></pre> <p>because plugin site <a href="http://code.google.com/p/full-hibernate-plugin-for-struts2/" rel="nofollow noreferrer">http://code.google.com/p/full-hibernate-plugin-for-struts2/</a> mentioned that only supported versions are </p> <p><em>This plugin is compatible with Hibernate Validator 3.1.0 and 4.0.2 (since 2.2 version)</em>.</p> <p><strong>Is that the problem. Have anyone used this plugin with above mentioned versions?</strong></p> <p><strong>One more question: Can we use this plugin in the production environment?</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload