我按这个教程做的....
http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27801&pageNO=1
然后建立客户端测试程序时....提示...
Method getName() not found in class testses.TestSesTestClient at line 124
源程序跟上机网址里的一样,就调用一个方法而已....
http://developer.ccidnet.com/pub/disp/Article?columnID=295&articleID=27801&pageNO=1
然后建立客户端测试程序时....提示...
Method getName() not found in class testses.TestSesTestClient at line 124
源程序跟上机网址里的一样,就调用一个方法而已....
public static void main(String[] args) {
TestSesTestClient client = new TestSesTestClient();
try{
client.create();
String name=client.getName();
System.out.println ("Name form the Test client="+name);
}
catch (Exception ex){}
}
正因为我在客户端测试程序中写了你下面那一样才出现client.getName()那一行出现错误,提示Method getName()找不到......
我是按教程一步一步做的,布置都没有问题,对了我用的是jb8,在新建客户EJB test client时有三个EJB测试类型选项(application,junit test,cactus test),我选的是第一个.后面的都默认的..
应该没有错呀!!!!!!
///
都选应该没问题的。
如果只选第一个,要这样:
a=client.create;
System.out.println(a.getname)
我以前也犯过这样的错误
有三个EJB测试类型选项(application,junit test,cactus test),我选的是第一个.后面的都默认的..这三个选项只能选一个的呀!!!(是单先的哟!!!!)
public static void main(String[] args) {
CartTestClient client = new CartTestClient();
CartHome home = client.getHome(); String cardHolderName = "Suzy Programmer";
String creditCardNumber = "1234-5678-9012-3456";
Date expirationDate = new GregorianCalendar(2004, Calendar.JULY, 30).getTime(); Cart cart = null; try {
cart = home.create(cardHolderName, creditCardNumber, expirationDate);
} catch (Exception e) {
System.out.println("Could not create Cart session bean\n" + e);
} if (cart != null) { Item kassemBook = new Item("J2EE Blueprints", 39.99f, "Book"); try {
cart.addItem(kassemBook);
} catch (Exception e) {
System.out.println("Could not add the book to the cart\n" + e);
}