• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trying to understand EJB3 injection between layers :P

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello i am learning about EJB injection and faced a problem that i am not able to solve.
I hope you could get me any clue ... thanks in advance!!

The problem is that i am implementing a business layer with EJB3 and trying to inject them to use in a webservices layer using Jax-RS.
Configuration about JAX-RS its ok (i think) since i've tested it with dummy tests but when i try to inject EJB in order to use business stack i get into problems.

I have a IssueManagerEJB class:

@Local({ IssueManager.class })
@Stateless(name = "issueManager", mappedName = "issueManager")
public class IssueManagerEJB extends IssueManagerImp {
...
}

And i am trying to inject it in the webservices layer that is packaged into a war file within the same EAR file than the EJB classes ...

@EJB(mappedName = "issueManager")
private IssueManagerEJB issueManager;


On the deployment ... i use Jboss 6.1 and in the deployment i can see:

20:31:22,927 INFO [org.jboss.ejb3.session.SessionSpecContainer] Starting jboss.j2ee:ear=testEmALL.ear,jar=testEmAll_Services.jar,name=issueManager,service=EJB3
20:31:22,927 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: org.blacarApps.testEmAll.services.ejb.manager.IssueManagerEJB ejbName: issueManager
20:31:22,931 INFO [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

testEmALL/issueManager/local - EJB3.x Default Local Business Interface
testEmALL/issueManager/local-org.blacarApps.testEmAll.manager.IssueManager - EJB3.x Local Business Interface


When i try to access "issueManager.getAllIssues()" method i get a NullPointer exception ...

20:32:28,370 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/testEmAll_WebServices].[Resteasy]] Servlet.service() para servlet Resteasy lanzó excepción: org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException

I am not sure what to test now in order to identify the bug :P
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic