File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't reach NamedQuery

 
Michal Glowacki
Ranch Hand
Posts: 114
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eye,


I am trying to use dependency injection from my Seam (web) application. Class:



CustomerAccount bean is created as separate project in Netbeans but deployed to the same JBoss instance. When I try to invoke function getLastNameDI() I get:

Named query not known: CustomerAccount.findByCustomerId

And my CustomerAccount bean is:



So there is a named query like this! Both persistence units (from web application and CustomerAccount) use the same datasource, just persistence units name vary.

What could be the problem?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Query names are scoped to the persistence unit. So it will not be visible to the other persistence unit.
 
Michal Glowacki
Ranch Hand
Posts: 114
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so how can I use dependency injection in my WAR to get EJB from JAR? I need to put EJB into JARs instead of creating EAR, because many applications share them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic