MyEclipse - XDoclet problem

  • Thread starter Kaspar Minosiants
  • Start date
K

Kaspar Minosiants

Hi
I'm trying to create a simple EJB by the help of myeclipse
1. i've created EJB class
2. selected myeclipse - XDoclet standart EJB
and after running myeclipse - XDoclet only 'home' interface has been
generated
could anybody explain why 'object' interface hasn't been generated
I use
Eclipce Version: 3.0.0 Build id: 200310101454
MyEclipse Version: 3.6.4


code:
----------------------------------------------------------------------------
--

package hello;import java.rmi.RemoteException;import
javax.ejb.CreateException;import javax.ejb.EJBException;import
javax.ejb.SessionBean;import javax.ejb.SessionContext;/** * XDoclet-based
stateless session bean. The class must be declared * public, according to
the EJB specification. * * To generate code: * * * a.. Add Standard EJB
module to XDoclet project properties * b.. Customize XDoclet configuration
* c.. Run XDoclet * * * Please see the included XDoclet Overview * and
the XDoclet Reference in the help system for details * * @ejb.bean name =
"HelloWorld" * type = "Stateless" * display-name =
"HelloWorld" * description = "HelloWorld EJB" *
view-type = "remote" * jndi-name = "ejb/HelloWorldHome" */public
class HelloWorld implements SessionBean { /** The SessionContext */ private
SessionContext context; /** * An ejbCreate method as required by the EJB
specification. * * The container calls the instance's ejbCreate method
whose * signature matches the signature of the create method invoked *
by the client. The input parameters sent from the client are passed to *
the ejbCreate method. Each session bean class must have at * least one
ejbCreate method. The number and signatures * of a session bean's create
methods are specific to each * session bean class. * * @throws
CreateException Thrown if the instance could not perform * the function
requested by the container because of an system-level error. * *
@ejb.create-method */ public void ejbCreate() throws CreateException { }
/** * The ejbActivate() method as required by the EJB specification. * *
The activate method is called when the instance is activated from its *
passive" state. The instance should acquire any resource that it has *
released earlier in the ejbPassivate() method. * * This method is called
with no transaction context. * * @throws EJBException Thrown if the
instance could not perform * the function requested by the container
because of an system-level error. */ public void ejbActivate() throws
EJBException { } /** * The ejbPassivate() method as required by the EJB
specification. * * The activate method is called when the instance is
activated from * its "passive" state. The instance should acquire any
resource that * it has released earlier in the ejbActivate() method. *
* This method is called with no transaction context. * * @throws
EJBException Thrown if the instance could not perform * the function
requested by the container because of an system-level error. */ public void
ejbPassivate() throws EJBException { } /** * The ejbRemove() method as
required by the EJB specification. * * A container invokes this method
before it ends the life of the * session object. This happens as a result
of a client's invoking * a remove operation, or when a container decides
to terminate the * session object after a timeout. * * This method
is called with no transaction context. * * @throws EJBException Thrown
if the instance could not perform * the function requested by the
container because of an system-level error. */ public void ejbRemove()
throws EJBException { } /** * Set the associated session context. The
container calls this method * after the instance creation. * * The
enterprise bean instance should store the reference to the context *
object in an instance variable. * * This method is called with no
transaction context. * * @throws EJBException Thrown if the instance
could not perform * the function requested by the container because of an
system-level error. */ public void setSessionContext(SessionContext
newContext) throws EJBException { context = newContext; } /** * An
example business method * * @ejb.interface-method view-type = "remote" *
* @throws EJBException Thrown if the instance could not perform * the
function requested by the container because of an system-level error. */
public void m1() throws EJBException { // rename and start putting your
business logic here } /** * An example business method * *
@ejb.interface-method view-type = "remote" * * @throws EJBException
Thrown if the instance could not perform * the function requested by the
container because of an system-level error. */ public void m2() throws
EJBException { // rename and start putting your business logic here }}
 
K

Kaspar Minosiants

package hello;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;

/**
* XDoclet-based stateless session bean. The class must be declared
* public, according to the EJB specification.

*
* To generate code:
*

*

* * Add Standard EJB module to XDoclet project properties
*
* Customize XDoclet configuration
*
* Run XDoclet
*


*

* Please see the included XDoclet Overview
* and the XDoclet Reference in the help system for details
*
* @ejb.bean name = "HelloWorld"
* type = "Stateless"
* display-name = "HelloWorld"
* description = "HelloWorld EJB"
* view-type = "remote"
* jndi-name = "ejb/HelloWorldHome"
*/
public class HelloWorld implements SessionBean {

/** The SessionContext */
private SessionContext context;

/**
* An ejbCreate method as required by the EJB specification.

*
* The container calls the instance's ejbCreate method whose
* signature matches the signature of the create method invoked
* by the client. The input parameters sent from the client are passed to
* the ejbCreate method. Each session bean class must have at
* least one ejbCreate method. The number and signatures
* of a session bean's create methods are specific to each
* session bean class.
*
* @throws CreateException Thrown if the instance could not perform
* the function requested by the container because of an system-level error.
*
* @ejb.create-method
*/
public void ejbCreate() throws CreateException {
}

/**
* The ejbActivate() method as required by the EJB specification.

*
* The activate method is called when the instance is activated from its
* passive" state. The instance should acquire any resource that it has
* released earlier in the ejbPassivate() method.

*
* This method is called with no transaction context.
*
* @throws EJBException Thrown if the instance could not perform
* the function requested by the container because of an system-level error.
*/
public void ejbActivate() throws EJBException {
}

/**
* The ejbPassivate() method as required by the EJB specification.

*
* The activate method is called when the instance is activated from
* its "passive" state. The instance should acquire any resource that
* it has released earlier in the ejbActivate() method.

*
* This method is called with no transaction context.
*
* @throws EJBException Thrown if the instance could not perform
* the function requested by the container because of an system-level error.
*/
public void ejbPassivate() throws EJBException {
}

/**
* The ejbRemove() method as required by the EJB specification.

*
* A container invokes this method before it ends the life of the
* session object. This happens as a result of a client's invoking
* a remove operation, or when a container decides to terminate the
* session object after a timeout.

*
* This method is called with no transaction context.
*
* @throws EJBException Thrown if the instance could not perform
* the function requested by the container because of an system-level error.
*/
public void ejbRemove() throws EJBException {
}

/**
* Set the associated session context. The container calls this method
* after the instance creation.

*
* The enterprise bean instance should store the reference to the context
* object in an instance variable.

*
* This method is called with no transaction context.
*
* @throws EJBException Thrown if the instance could not perform
* the function requested by the container because of an system-level error.
*/
public void setSessionContext(SessionContext newContext)
throws EJBException {
context = newContext;
}

/**
* An example business method
*
* @ejb.interface-method view-type = "remote"
*
* @throws EJBException Thrown if the instance could not perform
* the function requested by the container because of an system-level error.
*/
public void m1() throws EJBException {
// rename and start putting your business logic here
}
/**
* An example business method
*
* @ejb.interface-method view-type = "remote"
*
* @throws EJBException Thrown if the instance could not perform
* the function requested by the container because of an system-level error.
*/
public void m2() throws EJBException {
// rename and start putting your business logic here
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top