• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
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
 
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 ]
 
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 ]
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic