java - How to debug a call to an EJB from a Netbeans platform module -
using glassfish 3.1.2, try call session bean netbeans platform module, , null pointer exception. problem have no trace explaining how / npe generated.
the code in module simply:
import ejb.mysessionremote; import javax.ejb.ejb; public class testserver { @ejb private static mysessionremote mysession; public boolean execute() { system.out.println("result = " + mysession.getstring()); //npe here: mysession null return true; } }
the session bean "my session", remote interface , application deployed on server side ones tutorial: https://netbeans.org/kb/docs/javaee/entappclient.html
any appreciated.
note: i've checked this tutorial, without solving issue.
if mysession
null, not injected. can inject managed beans (ejbs example), because these instances managed (created/removed) container, , container injection you.
you can possibly inject pojo, if use cdi.
if testserver
part of stand-alone application example, try lookup ejb using jndi. tutorial well. involves setting properties initialcontext
, , lookup of ejb using jndi.
Comments
Post a Comment