deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Darwin <dp925...@gmail.com>
Subject Re: Null QueryInvocationContext in DS Data Module
Date Thu, 17 Jul 2014 17:03:54 GMT
On 2014-07-17, 9:29 AM, Juliano Marques wrote:
>
>
> De:     Thomas Hug <Thomas.Hug@ctp.com>
> Para:   "users@deltaspike.apache.org" <users@deltaspike.apache.org>,
> Data:   17/07/2014 09:51
> Assunto:        RE: Null QueryInvocationContext in DS Data Module
>
>
>
> Hi Juliano
>   
> Please inject a PersonRepository.
>   
> EntityRepository<Person, Long> ends up in a different bean and is not what
> you expect  - actually it’s an internal bean which is will be called
> underneath, but as it misses a bunch of initialization steps done by the
> Data extension you’ll get the NullPointerException.
>   
> Hope that helps…
>   
>
>
> [1] https://github.com/julianomqs/ds-data-module.git
>
>
Hola! When I tried your app, with the change Thomas suggested, I get this:

12:59:03,942 ERROR [io.undertow.request] (default task-5) UT005023: 
Exception handling request to 
/ds-data-module-test-1.0-SNAPSHOT/TestServlet: 
org.apache.deltaspike.data.api.QueryInvocationException: Failed calling 
Repository: 
[Repository=ds.data.module.repository.PersonRepository,entity=ds.data.module.entity.Person,method=saveAndFlush,exception=class

java.lang.IllegalStateException,message=A JTA EntityManager cannot use 
getTransaction()
     at 
org.apache.deltaspike.data.impl.handler.QueryHandler.invoke(QueryHandler.java:91) 
[deltaspike-data-module-impl-1.0.0.jar:1.0.0]
     at com.sun.proxy.$Proxy100.saveAndFlush(Unknown Source)
     at TestServlet.doGet(TestServlet.java:42)    at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:687) 
[jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 
[jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

Do you have any uncommitted/unpushed changes to that github, or is there 
something different in my environment?

Gracias!

Ian Darwin
ian@darwinsys.com

Mime
View raw message