Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the corresponding method of createXyz method in the stateful bean?

 
Yorck Zhou
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
everybody,

i have a createXyz() method in the home interface,
what is the corresponding method of this createXyz method in the
stateful session bean?

if it is ejbCreateXyz,

why my home.createXyz() always return the following error:
TRANSACTION ROLLBACK EXCEPTION:
javax.transaction.TransactionRolledbackException: null; nested exception is:
java.lang.NullPointerException
 
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yorck,

In ejbCreateXyz() method you are trying to use an object reference, which is Null. So it is giving you NullPointerException. Just to figure out where is the error, put code in ejbCreateXyz() method as below:

public void ejbCreateXyz(){
try {
// Put your code here.
// Put your code here.
} catch (RuntimeException e){
e.printStackTrace();
throw e;
}
}

This will print stack trace on console and you can figure out line no where there is a problem.
 
Yorck Zhou
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Sand,
thank you for your reply, but i have only a

System.out.println("some string");

in the ejbCreateXyz method. this would never throw a NullPointerException.

i think there must be other thing to be set. when i deploy the application,
there is a line in the console says: the method createXyz in bean has not been mapped. what does this mean? i use JBoss-2.4.10 as the EJB container.
[ October 07, 2004: Message edited by: Yorck Zhou ]
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Yorck,
I havent used JBoss but thought this link might help.
Tutorial for Building J2EE Applicaiton using JBoss and Eclipse

Let us know when u solve it.
Good Luck
[ October 08, 2004: Message edited by: Nileesha Bojjawar ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic