Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Conecction Ejb 3.0 Remote (http://www.velocityreviews.com/forums/t608231-conecction-ejb-3-0-remote.html)

legranadosb 04-29-2008 11:06 PM

Conecction Ejb 3.0 Remote
 
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 legranadosb@yahoo.com


All times are GMT. The time now is 02:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57