Conecction Ejb 3.0 Remote

Joined
Apr 29, 2008
Messages
1
Reaction score
0
Hello:captain:
I need to connect a client with a apliccation that is deployed in WASCE i`m making a test but i have a problem... HELP ME

this is my code::::

*****Remote*****
package prueba;

import javax.ejb.Remote;

@Remote
public interface pruebaRemote {
public String metodo(String arg);
}
****Stateless*****

package prueba;

import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Remote
@Stateless
public class PruebaBean implements pruebaLocal, pruebaRemote {

@PersistenceContext
EntityManager em;
public static final String RemoteJNDIName = PruebaBean.class.getSimpleName() + "/remote";
public static final String LocalJNDIName = PruebaBean.class.getSimpleName() + "/local";

@TransactionAttribute()
public String metodo(String arg) {
// TODO Auto-generated method stub
return arg;
}

}


*******client******

import javax.ejb.EJB;

import prueba.pruebaRemote;


public class test {

/**
* @param args
*/

public static void main(String[] args) {
new metodo();



}


}
class metodo{
@EJB
pruebaRemote beanRemote;
public metodo(){


System.out.println(beanRemote.metodo("Esto es una prueba"));
}
}

*****and the error is****
Exception in thread "main" java.lang.NullPointerException
at metodo.<init>(test.java:51)
at test.main(test.java:19)
*******************************
my email is (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top