Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to understand EJB3 injection between layers :P

 
Pedro blacap
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic