howto session bean w/ XDoclet

  • Thread starter Willian Irving Zumwalt
  • Start date
W

Willian Irving Zumwalt

Hey all,

Does anyone see anything wrong w/ this session bean. I'm pretty new to
XDoclet and having various problems in compiling or loading. So now
I'm just trying a very basic example. I get the following compile
errors below it.

/**
*
* @ejb.bean
* name="comp/History"
* type="Stateless"
* view-type="remote"
* jndi-name="ejb/comp/History"
*
* @ejb.home
* extends="javax.ejb.EJBHome"
* remote-class="com.place.management.ejb.session.HistoryHome"
*
* @ejb.interface
* extends="javax.ejb.EJBObject"
* remote-class="com.place.management.ejb.session.History"
*/

public class HistoryBean implements SessionBean
{
private transient SessionContext context = null;

public void setSessionContext(SessionContext ctx) {
context = ctx;
}

public void unsetSessionContext() throws EJBException {
context = null;
}

/**
* @ejb.create-method
*/

public void ejbCreate() throws CreateException { }

/**
* @ejb.home-method
*/

public void ejbRemove() throws EJBException { }

/**
* @ejb.home-method
*/

public void ejbPassivate() { }

/**
* @ejb.home-method
*/

public void ejbActivate() { }

/**
* @ejb.home-method
*/

public void ejbRemove() { }
}

--- jboss server output ---

[javac] Compiling 42 source files to /home/myProject/build/classes
[javac] /home/myProject/src/com/place/management/ejb/session/HistoryBean.java:74:
ejbRemove() is already defined in
com.place.management.ejb.session.HistoryBean
[javac] public void ejbRemove() { }
[javac] ^
[javac] /home/myProject/build/gen/com/place/management/ejb/session/HistoryHome.java:29:
remove() is already defined in
com.place.management.ejb.session.HistoryHome
[javac] public void remove()
[javac] ^
[javac] 2 errors
 
S

Sudsy

Willian said:
Hey all,

Does anyone see anything wrong w/ this session bean. I'm pretty new to
XDoclet and having various problems in compiling or loading. So now
I'm just trying a very basic example. I get the following compile
errors below it.

/**
*
* @ejb.bean
* name="comp/History"
* type="Stateless"
* view-type="remote"
* jndi-name="ejb/comp/History"
*
* @ejb.home
* extends="javax.ejb.EJBHome"
* remote-class="com.place.management.ejb.session.HistoryHome"
*
* @ejb.interface
* extends="javax.ejb.EJBObject"
* remote-class="com.place.management.ejb.session.History"
*/

public class HistoryBean implements SessionBean
{
private transient SessionContext context = null;

public void setSessionContext(SessionContext ctx) {
context = ctx;
}

public void unsetSessionContext() throws EJBException {
context = null;
}

/**
* @ejb.create-method
*/

public void ejbCreate() throws CreateException { }

/**
* @ejb.home-method
*/

public void ejbRemove() throws EJBException { }

First definition.
/**
* @ejb.home-method
*/

public void ejbPassivate() { }

/**
* @ejb.home-method
*/

public void ejbActivate() { }

/**
* @ejb.home-method
*/

public void ejbRemove() { }

Second definition.

Remove one.
 
W

William Zumwalt

Apologies, just got really tired working on these probs. I've posted the
real error output below and removed that typo of multiple declarations
of remove().

Hey all,

Does anyone see anything wrong w/ this session bean. I'm pretty new to
XDoclet and having various problems in compiling or loading. So now
I'm just trying a very basic example. I get the following compile
errors below it.

/**
*
* @ejb.bean
* name="comp/History"
* type="Stateless"
* view-type="remote"
* jndi-name="ejb/comp/History"
*
* @ejb.home
* extends="javax.ejb.EJBHome"
* remote-class="com.place.management.ejb.session.HistoryHome"
*
* @ejb.interface
* extends="javax.ejb.EJBObject"
* remote-class="com.place.management.ejb.session.History"
*/

public class HistoryBean implements SessionBean
{
private transient SessionContext context = null;

public void setSessionContext(SessionContext ctx) {
context = ctx;
}

public void unsetSessionContext() throws EJBException {
context = null;
}

/**
* @ejb.create-method
*/

public void ejbCreate() throws CreateException { }

/**
* @ejb.home-method
*/

public void ejbRemove() throws EJBException { }

/**
* @ejb.home-method
*/

public void ejbPassivate() { }

/**
* @ejb.home-method
*/

public void ejbActivate() { }
}

--- jboss server output ---

Here is the error that I don't understand.

....
21:25:49,635 INFO [EjbModule] Deploying comp/History
21:25:49,821 ERROR [StatelessSessionContainer] Initialization failed
jboss.j2ee:jndiName=ejb/comp/History,service=EJB
java.lang.NoSuchMethodException:
org.jboss.ejb.StatelessSessionContainer.removeHome() at
java.lang.Class.getMethod(Class.java:978)
at
org.jboss.ejb.StatelessSessionContainer.setupHomeMapping(StatelessSession
Container.java:488)
at
org.jboss.ejb.StatelessSessionContainer.createService(StatelessSessionCon
tainer.java:142)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupp
ort.java:237)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanS
upport.java:219)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
mpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java
:60)
 

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

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top