You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Juliano Marques <ju...@gmail.com> on 2014/07/14 05:05:56 UTC

Null QueryInvocationContext in DS Data Module

Hi,

Somehow the QueryInvocationContext is null in EntityRepositoryHandler, in
DS DataModule.

I have a multi-module maven project with DS core and data module.
The project has:
- a EntityManagerProducer (like DS data module docs)
- beans.xml with BeanManagedUserTransactionStrategy
- AuditEntityListener (for auditing)
- DS core and DS data module (compile and runtime) dependencies

I am missing something?

Source at https://bitbucket.org/julianomqs/vidracaria

Thanks a lot.


Atenciosamente,

*Juliano M.*

Re: Null QueryInvocationContext in DS Data Module

Posted by Ian Darwin <dp...@gmail.com>.
On 2014-07-17, 10:12 AM, Thomas Hug wrote:
> Thanks for your feedback!
>
> Actually it's not silly, and I think it might even be working fine. We'd have to create the repository beans slightly different (using the type closure) to enable this kind of injection. Might be useful for e.g. a base class handling CRUD UI pages similar to the Seam 2 EntityHome
Hi Thomas!

+1 - I would really love this, as I have a Seam2 site to convert... Have 
done baby steps toward this, but if DS-D can handle it, that's even better.

Thanks

Ian Darwin

>
> -----Original Message-----
> From: Juliano Marques [mailto:juliano.marques@dsmail.com.br]
> Sent: Donnerstag, 17. Juli 2014 15:29
> To: users@deltaspike.apache.org
> Subject: RE: Null QueryInvocationContext in DS Data Module
>
> Hi Thomas,
>
> Your suggestion works perfectly.
> How silly of me, this is a pretty obvious thing... :-)
>
> Thanks a lot. Deltaspike is great, I'm really liking it. Keep up the good work!
>
> Regards,
> Juliano
>


RE: Null QueryInvocationContext in DS Data Module

Posted by Thomas Hug <Th...@ctp.com>.
Thanks for your feedback!

Actually it's not silly, and I think it might even be working fine. We'd have to create the repository beans slightly different (using the type closure) to enable this kind of injection. Might be useful for e.g. a base class handling CRUD UI pages similar to the Seam 2 EntityHome feature.

-----Original Message-----
From: Juliano Marques [mailto:juliano.marques@dsmail.com.br] 
Sent: Donnerstag, 17. Juli 2014 15:29
To: users@deltaspike.apache.org
Subject: RE: Null QueryInvocationContext in DS Data Module

Hi Thomas,

Your suggestion works perfectly.
How silly of me, this is a pretty obvious thing... :-)

Thanks a lot. Deltaspike is great, I'm really liking it. Keep up the good work!

Regards,
Juliano






De:     Thomas Hug <Th...@ctp.com>
Para:   "users@deltaspike.apache.org" <us...@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…
 
From: Thomas Hug [mailto:Thomas.Hug@ctp.com]
Sent: Donnerstag, 17. Juli 2014 14:33
To: users@deltaspike.apache.org
Subject: RE: Null QueryInvocationContext in DS Data Module
 
Hi Juliano
Sorry, missed your message. Will have a look at your sample.
 
From: Juliano Marques [mailto:juliano.marques@dsmail.com.br]
Sent: Donnerstag, 17. Juli 2014 14:17
To: users@deltaspike.apache.org
Subject: Re: Null QueryInvocationContext in DS Data Module
 
Sorry, but does anyone could look at this example [1]? 

Am I missing something? 

Apparently I configured the application with all the requirements needed to run the data module correctly, but I keep getting a NullPointerException with any operation with the persistence database. 

Somehow, the QueryInvocationContext is null in EntityRepositoryHandler class. 

Please help. 

Thank you very much. 

[1] https://github.com/julianomqs/ds-data-module.git 

Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 






De:        Juliano Marques <ju...@dsmail.com.br> 
Para:        users@deltaspike.apache.org, 
Data:        15/07/2014 11:28 
Assunto:        Re: Null QueryInvocationContext in DS Data Module 




A simpler example at https://github.com/julianomqs/ds-data-module.git 

Thanks a lot. 

Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 







De:        Juliano Marques <ju...@gmail.com> 
Para:        users@deltaspike.apache.org, 
Data:        14/07/2014 00:00 
Assunto:        Null QueryInvocationContext in DS Data Module 




Hi,

Somehow the QueryInvocationContext is null in EntityRepositoryHandler, in DS DataModule.

I have a multi-module maven project with DS core and data module.
The project has:
- a EntityManagerProducer (like DS data module docs)
- beans.xml with BeanManagedUserTransactionStrategy
- AuditEntityListener (for auditing)
- DS core and DS data module (compile and runtime) dependencies

I am missing something?

Source at https://bitbucket.org/julianomqs/vidracaria

Thanks a lot.


Atenciosamente,

*Juliano M.*


Re: Null QueryInvocationContext in DS Data Module

Posted by Juliano Marques <ju...@gmail.com>.
@Thomas

In this example, I had to change transaction-type to RESOURCE_LOCAL, in
persistence.xml.

When the transaction-type is JTA in persistence.xml, the following
exception is thrown:
Caused by: java.lang.IllegalStateException: A JTA EntityManager cannot use
getTransaction()

This is right?

Thanks a lot.



Atenciosamente,

*Juliano M.*



On Thu, Jul 17, 2014 at 2:44 PM, Juliano Marques <
juliano.marques@dsmail.com.br> wrote:

> Hi Ian,
>
> I changed the transaction type to "RESOURCE_LOCAL" in persistence.xml.
> The example works now.
> Atenciosamente,
>
> Juliano Marques
> Desenvolvimento Imobiliário
> Criciúma - SC
> Fone: (48) 3461-1000
>
>
>
>
>
> De:        Ian Darwin <dp...@gmail.com>
> Para:        users@deltaspike.apache.org,
> Data:        17/07/2014 14:27
> Assunto:        Re: Null QueryInvocationContext in DS Data Module
> ------------------------------
>
>
>
> On 2014-07-17, 9:29 AM, Juliano Marques wrote:
> >
> >
> > De:     Thomas Hug <Th...@ctp.com>
> > Para:   "users@deltaspike.apache.org" <us...@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
>
>
>

Re: Null QueryInvocationContext in DS Data Module

Posted by Juliano Marques <ju...@gmail.com>.
I changed the datasource to non-jta-datasource and resouce-local.
But, afaik the jta datasources in java ee applications is a recomendation...
I think it will be great put this issue with Wildfly in the ds docs.

Thanks a lot,

Juliano

Atenciosamente,

*Juliano M.*



On Sat, Jul 19, 2014 at 5:07 AM, Thomas Hug <th...@gmail.com> wrote:

> Hi Juliano
> Yes that's unfortunately still a JTA portability issue on Wildfly. If you
> want to use JTA, you can e.g. write a custom TransactionStrategy which
> basically only proceeds with the invoke, and have an EJB control the
> transaction.
>
>
> On Fri, Jul 18, 2014 at 3:44 AM, Juliano Marques <ju...@gmail.com>
> wrote:
>
> > @Thomas
> >
> > In this example, I had to change transaction-type to RESOURCE_LOCAL, in
> > persistence.xml.
> >
> > When the transaction-type is JTA in persistence.xml, the following
> > exception is thrown:
> > Caused by: java.lang.IllegalStateException: A JTA EntityManager cannot
> use
> > getTransaction()
> >
> > This is right?
> >
> > Thanks a lot.
> >
> >
> >
> > Atenciosamente,
> >
> > *Juliano M.*
> >
> >
> >
> > On Thu, Jul 17, 2014 at 2:44 PM, Juliano Marques <
> > juliano.marques@dsmail.com.br> wrote:
> >
> > > Hi Ian,
> > >
> > > I changed the transaction type to "RESOURCE_LOCAL" in persistence.xml.
> > > The example works now.
> > > Atenciosamente,
> > >
> > > Juliano Marques
> > > Desenvolvimento Imobiliário
> > > Criciúma - SC
> > > Fone: (48) 3461-1000
> > >
> > >
> > >
> > >
> > >
> > > De:        Ian Darwin <dp...@gmail.com>
> > > Para:        users@deltaspike.apache.org,
> > > Data:        17/07/2014 14:27
> > > Assunto:        Re: Null QueryInvocationContext in DS Data Module
> > > ------------------------------
> > >
> > >
> > >
> > > On 2014-07-17, 9:29 AM, Juliano Marques wrote:
> > > >
> > > >
> > > > De:     Thomas Hug <Th...@ctp.com>
> > > > Para:   "users@deltaspike.apache.org" <us...@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
> > >
> > >
> > >
> >
>

Re: Null QueryInvocationContext in DS Data Module

Posted by Thomas Hug <th...@gmail.com>.
Hi Juliano
Yes that's unfortunately still a JTA portability issue on Wildfly. If you
want to use JTA, you can e.g. write a custom TransactionStrategy which
basically only proceeds with the invoke, and have an EJB control the
transaction.


On Fri, Jul 18, 2014 at 3:44 AM, Juliano Marques <ju...@gmail.com>
wrote:

> @Thomas
>
> In this example, I had to change transaction-type to RESOURCE_LOCAL, in
> persistence.xml.
>
> When the transaction-type is JTA in persistence.xml, the following
> exception is thrown:
> Caused by: java.lang.IllegalStateException: A JTA EntityManager cannot use
> getTransaction()
>
> This is right?
>
> Thanks a lot.
>
>
>
> Atenciosamente,
>
> *Juliano M.*
>
>
>
> On Thu, Jul 17, 2014 at 2:44 PM, Juliano Marques <
> juliano.marques@dsmail.com.br> wrote:
>
> > Hi Ian,
> >
> > I changed the transaction type to "RESOURCE_LOCAL" in persistence.xml.
> > The example works now.
> > Atenciosamente,
> >
> > Juliano Marques
> > Desenvolvimento Imobiliário
> > Criciúma - SC
> > Fone: (48) 3461-1000
> >
> >
> >
> >
> >
> > De:        Ian Darwin <dp...@gmail.com>
> > Para:        users@deltaspike.apache.org,
> > Data:        17/07/2014 14:27
> > Assunto:        Re: Null QueryInvocationContext in DS Data Module
> > ------------------------------
> >
> >
> >
> > On 2014-07-17, 9:29 AM, Juliano Marques wrote:
> > >
> > >
> > > De:     Thomas Hug <Th...@ctp.com>
> > > Para:   "users@deltaspike.apache.org" <us...@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
> >
> >
> >
>

Re: Null QueryInvocationContext in DS Data Module

Posted by Juliano Marques <ju...@dsmail.com.br>.
Hi Ian,

I changed the transaction type to "RESOURCE_LOCAL" in persistence.xml.
The example works now.
Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 





De:     Ian Darwin <dp...@gmail.com>
Para:   users@deltaspike.apache.org, 
Data:   17/07/2014 14:27
Assunto:        Re: Null QueryInvocationContext in DS Data Module



On 2014-07-17, 9:29 AM, Juliano Marques wrote:
>
>
> De:     Thomas Hug <Th...@ctp.com>
> Para:   "users@deltaspike.apache.org" <us...@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




Re: Null QueryInvocationContext in DS Data Module

Posted by Ian Darwin <dp...@gmail.com>.
On 2014-07-17, 9:29 AM, Juliano Marques wrote:
>
>
> De:     Thomas Hug <Th...@ctp.com>
> Para:   "users@deltaspike.apache.org" <us...@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

RE: Null QueryInvocationContext in DS Data Module

Posted by Juliano Marques <ju...@dsmail.com.br>.
Hi Thomas,

Your suggestion works perfectly.
How silly of me, this is a pretty obvious thing... :-)

Thanks a lot. Deltaspike is great, I'm really liking it. Keep up the good 
work!

Regards,
Juliano






De:     Thomas Hug <Th...@ctp.com>
Para:   "users@deltaspike.apache.org" <us...@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…
 
From: Thomas Hug [mailto:Thomas.Hug@ctp.com] 
Sent: Donnerstag, 17. Juli 2014 14:33
To: users@deltaspike.apache.org
Subject: RE: Null QueryInvocationContext in DS Data Module
 
Hi Juliano
Sorry, missed your message. Will have a look at your sample.
 
From: Juliano Marques [mailto:juliano.marques@dsmail.com.br] 
Sent: Donnerstag, 17. Juli 2014 14:17
To: users@deltaspike.apache.org
Subject: Re: Null QueryInvocationContext in DS Data Module
 
Sorry, but does anyone could look at this example [1]? 

Am I missing something? 

Apparently I configured the application with all the requirements needed 
to run the data module correctly, but I keep getting a 
NullPointerException with any operation with the persistence database. 

Somehow, the QueryInvocationContext is null in EntityRepositoryHandler 
class. 

Please help. 

Thank you very much. 

[1] https://github.com/julianomqs/ds-data-module.git 

Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 






De:        Juliano Marques <ju...@dsmail.com.br> 
Para:        users@deltaspike.apache.org, 
Data:        15/07/2014 11:28 
Assunto:        Re: Null QueryInvocationContext in DS Data Module 




A simpler example at https://github.com/julianomqs/ds-data-module.git 

Thanks a lot. 

Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 







De:        Juliano Marques <ju...@gmail.com> 
Para:        users@deltaspike.apache.org, 
Data:        14/07/2014 00:00 
Assunto:        Null QueryInvocationContext in DS Data Module 




Hi,

Somehow the QueryInvocationContext is null in EntityRepositoryHandler, in
DS DataModule.

I have a multi-module maven project with DS core and data module.
The project has:
- a EntityManagerProducer (like DS data module docs)
- beans.xml with BeanManagedUserTransactionStrategy
- AuditEntityListener (for auditing)
- DS core and DS data module (compile and runtime) dependencies

I am missing something?

Source at https://bitbucket.org/julianomqs/vidracaria

Thanks a lot.


Atenciosamente,

*Juliano M.*


RE: Null QueryInvocationContext in DS Data Module

Posted by Thomas Hug <Th...@ctp.com>.
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...

From: Thomas Hug [mailto:Thomas.Hug@ctp.com]
Sent: Donnerstag, 17. Juli 2014 14:33
To: users@deltaspike.apache.org
Subject: RE: Null QueryInvocationContext in DS Data Module

Hi Juliano
Sorry, missed your message. Will have a look at your sample.

From: Juliano Marques [mailto:juliano.marques@dsmail.com.br]
Sent: Donnerstag, 17. Juli 2014 14:17
To: users@deltaspike.apache.org<ma...@deltaspike.apache.org>
Subject: Re: Null QueryInvocationContext in DS Data Module

Sorry, but does anyone could look at this example [1]?

Am I missing something?

Apparently I configured the application with all the requirements needed to run the data module correctly, but I keep getting a NullPointerException with any operation with the persistence database.

Somehow, the QueryInvocationContext is null in EntityRepositoryHandler class.

Please help.

Thank you very much.

[1] https://github.com/julianomqs/ds-data-module.git
Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000

[cid:image001.png@01CFA1CE.7B9F5C10][cid:_2_085F12C4085F108400435F0283257D18]






De:        Juliano Marques <ju...@dsmail.com.br>>
Para:        users@deltaspike.apache.org<ma...@deltaspike.apache.org>,
Data:        15/07/2014 11:28
Assunto:        Re: Null QueryInvocationContext in DS Data Module
________________________________



A simpler example at https://github.com/julianomqs/ds-data-module.git

Thanks a lot.
Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000







De:        Juliano Marques <ju...@gmail.com>>
Para:        users@deltaspike.apache.org<ma...@deltaspike.apache.org>,
Data:        14/07/2014 00:00
Assunto:        Null QueryInvocationContext in DS Data Module
________________________________



Hi,

Somehow the QueryInvocationContext is null in EntityRepositoryHandler, in
DS DataModule.

I have a multi-module maven project with DS core and data module.
The project has:
- a EntityManagerProducer (like DS data module docs)
- beans.xml with BeanManagedUserTransactionStrategy
- AuditEntityListener (for auditing)
- DS core and DS data module (compile and runtime) dependencies

I am missing something?

Source at https://bitbucket.org/julianomqs/vidracaria

Thanks a lot.


Atenciosamente,

*Juliano M.*

RE: Null QueryInvocationContext in DS Data Module

Posted by Thomas Hug <Th...@ctp.com>.
Hi Juliano
Sorry, missed your message. Will have a look at your sample.

From: Juliano Marques [mailto:juliano.marques@dsmail.com.br]
Sent: Donnerstag, 17. Juli 2014 14:17
To: users@deltaspike.apache.org
Subject: Re: Null QueryInvocationContext in DS Data Module

Sorry, but does anyone could look at this example [1]?

Am I missing something?

Apparently I configured the application with all the requirements needed to run the data module correctly, but I keep getting a NullPointerException with any operation with the persistence database.

Somehow, the QueryInvocationContext is null in EntityRepositoryHandler class.

Please help.

Thank you very much.

[1] https://github.com/julianomqs/ds-data-module.git
Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000

[cid:image002.png@01CFA1CC.044F7430][cid:_2_085F12C4085F108400435F0283257D18]






De:        Juliano Marques <ju...@dsmail.com.br>>
Para:        users@deltaspike.apache.org<ma...@deltaspike.apache.org>,
Data:        15/07/2014 11:28
Assunto:        Re: Null QueryInvocationContext in DS Data Module
________________________________



A simpler example at https://github.com/julianomqs/ds-data-module.git

Thanks a lot.
Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000







De:        Juliano Marques <ju...@gmail.com>>
Para:        users@deltaspike.apache.org<ma...@deltaspike.apache.org>,
Data:        14/07/2014 00:00
Assunto:        Null QueryInvocationContext in DS Data Module
________________________________



Hi,

Somehow the QueryInvocationContext is null in EntityRepositoryHandler, in
DS DataModule.

I have a multi-module maven project with DS core and data module.
The project has:
- a EntityManagerProducer (like DS data module docs)
- beans.xml with BeanManagedUserTransactionStrategy
- AuditEntityListener (for auditing)
- DS core and DS data module (compile and runtime) dependencies

I am missing something?

Source at https://bitbucket.org/julianomqs/vidracaria

Thanks a lot.


Atenciosamente,

*Juliano M.*

Re: Null QueryInvocationContext in DS Data Module

Posted by Juliano Marques <ju...@dsmail.com.br>.
Sorry, but does anyone could look at this example [1]? 

Am I missing something? 

Apparently I configured the application with all the requirements needed 
to run the data module correctly, but I keep getting a 
NullPointerException with any operation with the persistence database. 

Somehow, the QueryInvocationContext is null in EntityRepositoryHandler 
class. 

Please help. 

Thank you very much. 

[1] https://github.com/julianomqs/ds-data-module.git

Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 





De:     Juliano Marques <ju...@dsmail.com.br>
Para:   users@deltaspike.apache.org, 
Data:   15/07/2014 11:28
Assunto:        Re: Null QueryInvocationContext in DS Data Module



A simpler example at https://github.com/julianomqs/ds-data-module.git 

Thanks a lot. 
Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 






De:        Juliano Marques <ju...@gmail.com> 
Para:        users@deltaspike.apache.org, 
Data:        14/07/2014 00:00 
Assunto:        Null QueryInvocationContext in DS Data Module 



Hi,

Somehow the QueryInvocationContext is null in EntityRepositoryHandler, in
DS DataModule.

I have a multi-module maven project with DS core and data module.
The project has:
- a EntityManagerProducer (like DS data module docs)
- beans.xml with BeanManagedUserTransactionStrategy
- AuditEntityListener (for auditing)
- DS core and DS data module (compile and runtime) dependencies

I am missing something?

Source at https://bitbucket.org/julianomqs/vidracaria

Thanks a lot.


Atenciosamente,

*Juliano M.*


Re: Null QueryInvocationContext in DS Data Module

Posted by Juliano Marques <ju...@dsmail.com.br>.
A simpler example at https://github.com/julianomqs/ds-data-module.git

Thanks a lot.
Atenciosamente,

Juliano Marques
Desenvolvimento Imobiliário
Criciúma - SC
Fone: (48) 3461-1000 





De:     Juliano Marques <ju...@gmail.com>
Para:   users@deltaspike.apache.org, 
Data:   14/07/2014 00:00
Assunto:        Null QueryInvocationContext in DS Data Module



Hi,

Somehow the QueryInvocationContext is null in EntityRepositoryHandler, in
DS DataModule.

I have a multi-module maven project with DS core and data module.
The project has:
- a EntityManagerProducer (like DS data module docs)
- beans.xml with BeanManagedUserTransactionStrategy
- AuditEntityListener (for auditing)
- DS core and DS data module (compile and runtime) dependencies

I am missing something?

Source at https://bitbucket.org/julianomqs/vidracaria

Thanks a lot.


Atenciosamente,

*Juliano M.*