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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -