Can a Session Bean be defined without ejbCreate() method


Answer posted by Mohan on 2005-05-21 19:27:35: No

Showing Answers 1 - 11 of 11 Answers

Mohan

  • May 21st, 2005
 

No

  Was this answer useful?  Yes

prasad

  • Jun 29th, 2005
 

yes,u can develop a bean without create method

  Was this answer useful?  Yes

Denis Wang

  • Jun 30th, 2005
 

No. 
Container creates the bean instance in the following steps. 
1.newInstance(). 2.setSessionContext() 3.ejbCreate(). 
Hence ejbCreate() is required for the beans.

  Was this answer useful?  Yes

Priti

  • Sep 3rd, 2005
 

No. As per the EJB specs the ejbCreate method is required. Stateful session can have one or more overloaded create methods but stateless session beans should have only one create method with zero argument.

  Was this answer useful?  Yes

Raja Sekhar Reddy T

  • Sep 11th, 2005
 

The ejbCreate() methods is part of the bean's lifecycle, so, the compiler will not return an error because there is no ejbCreate() method.

However, the J2EE spec is explicit:

  • the home interface of a Stateless Session Bean must have a single create() method with no arguments, while the session bean class must contain exactly one ejbCreate() method, also without arguments.
  • Stateful Session Beans can have arguments (more than one create method)

  Was this answer useful?  Yes

Mannu Kumar Pandey

  • Nov 3rd, 2005
 

No. EBcreate method always needed since its executed for create method of a bean which is needed by client to get a remote instance of bean.

  Was this answer useful?  Yes

kripa

  • Nov 10th, 2005
 

It might not throw a compilation error. But during deployment,it would  throw an error. The bean would not get deployed.

  Was this answer useful?  Yes

Madhu Kumar

  • Nov 20th, 2005
 

SessionBean is a interface.So we can implement all abstract methods . other wise we can declare our class has abstract class.If do not immplement ejbCreate() u do not getBean instace ( remote instance) No way to call ur remote methods.Finally we must implement ejbCreate() method.

  Was this answer useful?  Yes

madhu

  • Dec 21st, 2005
 

we cant write session bean with out ejbcreate() it is mandatory session bean i can't agree with u r answer tell me any example regarding thisregards madhu

  Was this answer useful?  Yes

Abhinav Prakash

  • Feb 20th, 2006
 

We cannot have a session bean without ejbCreate().

  • the bean class must implement the session bean interface. ejbcreate is declared in the interface.
  • ejbCreate() is a container call back method which is invoked when the cleint calls create on the home stub class, hence if it is not called the life cycle of the bean is not complete, in which case there will be no session bean to use.
  • Wehn we call create on stateful session bean each time a new bean is created, and when we call this on the stateless bean the bean is pulled otu of the pool and assigned the ejbobject which  the client gets.

  Was this answer useful?  Yes

Vasanth

  • Apr 12th, 2006
 

We must have a  ejbCreate(); to create a Session bean .

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions