- 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)
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)