Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Conecction Ejb 3.0 Remote

Reply
Thread Tools

Conecction Ejb 3.0 Remote

 
 
legranadosb legranadosb is offline
Junior Member
Join Date: Apr 2008
Posts: 1
 
      04-29-2008
Hello
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 http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to generate "ejb-jar.xml" from EJB class (source)? "ejb-jar.xml" appserver independent? Raymond Schanks Java 0 08-03-2010 08:21 AM
[newbie-ejb...helppppppppppp]Remote ejb Connection Massimiliano Java 5 01-04-2004 11:41 AM
To EJB or not to EJB Jeremy Haile Java 5 09-10-2003 03:52 AM
EJB on Weblogic7 : accessing Ejb thru *Local interface* fails due to JNDI lookup Mumbai Joe Java 0 07-29-2003 04:16 PM
Dynamically Access & Call An EJB From Another EJB? Steve Java 1 07-15-2003 06:47 PM



Advertisments