This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes why need no-arg constructor ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Reply Bookmark "why need no-arg constructor ?" Watch "why need no-arg constructor ?" New topic
Author

why need no-arg constructor ?

Win Yu
Ranch Hand

Joined: Oct 17, 2001
Posts: 224
Following is the sentence book ,can anyone explain?
"Session bean class must make a no-arg constructor avaiable?"
[ April 02, 2002: Message edited by: Win Yu ]

Win
Bagwan Mehrat
Ranch Hand

Joined: Jan 26, 2002
Posts: 119
According to Monson-Haefel, EJB containers create EJB's using Class.newInstance(). As you know, Class.newInstance() requires a no-argument constructor. Users of the Class class know that you can use the Class.getConstructors() calls to get the constructors if you happen to want to call them, but the container wouldn't know which one to use. EJB's are more abstract than classes anyway, and use the ejbCreate() mechanism for initialization and instantiation.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: why need no-arg constructor ?
 
Similar Threads
Simple EL code is not working
Problem with using jsp:useBean
"New to Hibernate" Question - How to fetch only a few fields
Why does OutputStream provide a constructor if its abstract?
Need answer to the questions!!