Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@CodeMed, it took me a while, but I was able to reproduce the issue. It might be a configuration issue : <code>@PersistenceContext</code> might be scanned twice, it might be scanned by your root-context and your web-context. This cause the <code>@PersistenceContext</code> to be shared, therefore it is not saving your data (Spring doesn't allow that). I found it weird that no messages or logs where displayed . if you tried this snippet below on you Save(Document document) you will see the actual error :</p> <pre><code>Session session = this.em.unwrap(Session.class); session.persist(document); </code></pre> <p>To solve the problem, you can do the following (avoid the <code>@PersistenceContext</code> to be scanned twice) :</p> <p>1- Make sure that all your controller are in a separate package like <code>com.mycompany.myapp.controller</code>, and in your web-context use the component-scan as <code>&lt;context:component-scan annotation-config="true" base-package="com.mycompany.myapp.controller" /&gt;</code> </p> <p>2- Make sure that others component are in differents package other than the controller package , for example : <code>com.mycompany.myapp.dao</code>, <code>com.mycompany.myapp.service</code> .... and then in your root-context use the component-scan as <code>&lt;context:component-scan annotation-config="true" base-package="com.mycompany.myapp.service, com.mycompany.myapp.dao" /&gt;</code> </p> <p>Or show me yours spring xml configurations and your web.xml, I will point you to the right direction</p>
 

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