[jboss-user] [EJB/JBoss] - Trouble building simple EJB

tamscot do-not-reply at jboss.com
Wed Nov 21 13:48:04 EST 2007


Hi, just going through an example ejb and then adapting the method used to create my own bean. Trouble is when I edit the main Bean class, in this case JujitsuFacadeBean, it comes up with some parse error and starts to create an interface in the ejbModule package.

IDE is Eclipse 3.2. 
JDK is 5.
xdoclet is 1.2.3
Jboss is 4.0.5.

i followed the example as per the book. Where am I going wrong?

Here is the errors reported in the console...

  | Buildfile: /home/tam/workspace/JuJitent/.metadata/.plugins/org.eclipse.jst.j2ee.ejb.annotations.xdoclet/tempAnt.xml
  | init:
  | ejbdoclet:
  | [ejbdoclet] (XDocletMain.start                   47  ) Running <deploymentdescriptor/>
  | [ejbdoclet] Generating EJB deployment descriptor (ejb-jar.xml).
  | [ejbdoclet] Error parsing File /home/tam/workspace/JuJitent/JujitsuEJB/ejbModule/com/jujitsu/ejb/JujitsuFacadeBean.java:Encountered "<"[" ...
  | [ejbdoclet] "." ...
  | [ejbdoclet] "(" ...
  | [ejbdoclet] (XDocletMain.start                   47  ) Running <remoteinterface/>
  | [ejbdoclet] Generating Remote interface for 'com.jujitsu.ejb.JujitsuFacadeBean'.
  | [ejbdoclet] (TemplateEngine.invokeMethod         547 ) Invoking method failed: xdoclet.modules.ejb.intf.InterfaceTagsHandler.extendsFrom, line=10 of template file: jar:file:/home/tam/opt/xdoclet-1.2.3/lib/xdoclet-ejb-module-1.2.3.jar!/xdoclet/modules/ejb/intf/resources/remote.xdt
  | [ejbdoclet] java.lang.reflect.InvocationTargetException
  | [ejbdoclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | [ejbdoclet] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | [ejbdoclet] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | [ejbdoclet] at java.lang.reflect.Method.invoke(Method.java:585)
  |  plus more errors...
  | 

This is the code for JujitsuFacadeBean, this implements the interface JujitsuFacade whose jar file has been included in the project.

  | /**
  |  * 
  |  */
  | package com.jujitsu.ejb;
  |  
  | import java.rmi.RemoteException;
  | import java.util.Set;
  |  
  | import javax.ejb.EJBException;
  | import javax.ejb.SessionContext;
  |  
  | import com.jujit.model.Club;
  | import com.jujit.model.Instructor;
  | import com.jujit.model.Student;
  | import com.jujit.services.ClubFacade;
  | import com.jujit.services.JujitsuFacade;
  |  
  |  
  | /**
  |  *
  |  * <!-- begin-user-doc -->
  |  * A generated session bean
  |  * <!-- end-user-doc -->
  |  * *
  |  * <!-- begin-xdoclet-definition --> 
  |  * @ejb.bean name="JujitsuFacade"	
  |  *           description="An EJB named JujitsuFacade"
  |  *           display-name="JujitsuFacade"
  |  *           jndi-name="JujitsuFacade"
  |  *           type="Stateless" 
  |  *           transaction-type="Container"
  |  * @ejb.transaction
  |  *   type="Supports"
  |  * <!-- end-xdoclet-definition --> 
  |  * @generated
  |  */
  |  
  | public abstract class JujitsuFacadeBean implements JujitsuFacade, javax.ejb.SessionBean {
  | 	private JujitsuFacade jujitsuFacade;
  | 	
  | 	/** 
  | 	 * @ejb.interface-method view-type="both"
  | 	 */
  | 	public boolean doesClubExist(String clubId){
  | 		return jujitsuFacade.doesClubExist(clubId);
  | 	}
  | 	
  | 	/**
  | 	 *@ejb.interface-method view-type="both"
  | 	 */
  | 	public boolean createClub(Club newClub){
  | 		return jujitsuFacade.createClub(newClub);
  | 	}
  | 	
  | 	/**
  | 	 * @ejb.interface-method view-type="both"
  | 	 */
  | 	public Instructor findInstructor(String id){
  | 		return jujitsuFacade.findInstructor(id);
  | 	}
  | 	
  | 	/**
  | 	 * @ejb.interface-method view-type="both"
  | 	 */
  | 	public Student findStudent(String id){
  | 		return jujitsuFacade.findStudent(id);
  | 	}
  | 	
  | 	
  | 	/**
  | 	 * @ejb.interface-method view-type="both"
  | 	 */
  | 	public Club findClub(String id){
  | 		return jujitsuFacade.findClub(id);
  | 	}
  | 	
  | 	/**
  | 	 * @ejb.interface-method view-type="both"
  | 	 */
  | 	public Set<Student> getStudentsForClub(String clubId){
  | 		return jujitsuFacade.getStudentsForClub(clubId);
  | 	}
  | 	/** 
  | 	 *
  | 	 * <!-- begin-xdoclet-definition --> 
  | 	 * @ejb.create-method view-type="remote"
  | 	 * <!-- end-xdoclet-definition --> 
  | 	 * @generated
  | 	 *
  | 	 * //
  | 	 */
  | 	public void ejbCreate() {
  | 		jujitsuFacade = ClubFacade.getJujitsuFacade();
  | 	}
  |  
  | 	/** 
  | 	 *
  | 	 * <!-- begin-xdoclet-definition --> 
  | 	 * @ejb.interface-method view-type="remote"
  | 	 * <!-- end-xdoclet-definition --> 
  | 	 * @generated
  | 	 *
  | 	 * //TODO: Must provide implementation for bean method stub
  | 	 */
  | 	public String foo(String param) {
  | 		return null;
  | 	}
  |  
  | 	/* (non-Javadoc)
  | 	 * @see javax.ejb.SessionBean#ejbActivate()
  | 	 */
  | 	public void ejbActivate() throws EJBException, RemoteException {
  | 		// TODO Auto-generated method stub
  |  
  | 	}
  |  
  | 	/* (non-Javadoc)
  | 	 * @see javax.ejb.SessionBean#ejbPassivate()
  | 	 */
  | 	public void ejbPassivate() throws EJBException, RemoteException {
  | 		// TODO Auto-generated method stub
  |  
  | 	}
  |  
  | 	/* (non-Javadoc)
  | 	 * @see javax.ejb.SessionBean#ejbRemove()
  | 	 */
  | 	public void ejbRemove() throws EJBException, RemoteException {
  | 		// TODO Auto-generated method stub
  |  
  | 	}
  |  
  | 	/* (non-Javadoc)
  | 	 * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
  | 	 */
  | 	public void setSessionContext(SessionContext arg0) throws EJBException,
  | 			RemoteException {
  | 		// TODO Auto-generated method stub
  |  
  | 	}
  |  
  | 	/**
  | 	 * 
  | 	 */
  | 	public JujitsuFacadeBean() {
  | 		// TODO Auto-generated constructor stub
  | 	}
  | }
  | 
Suprisingly the build after editing starts to assemble an interface JujitsuFacade...terribly.
 
  | /*
  |  * Generated by XDoclet - Do not edit!
  |  */
  | package com.jujitsu.ejb;
  |  
  | /**
  |  * Remote interface for JujitsuFacade.
  |  * @generated 
  |  * @wtp generated
  |  */
  | public interface JujitsuFacade
  |    extends
  | 
Thats as far as it got.

Any help appreciated.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106857#4106857

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106857



More information about the jboss-user mailing list