Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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 ]
 
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic