- This topic has 4 replies, 2 voices, and was last updated 21 years, 5 months ago by
e111.
-
AuthorPosts
-
e111MemberHi
I’m trying to create a simple EJB
1. i’ve created EJB class
2. selected myeclipse – XDoclet standart EJBand after running myeclipse – XDoclet only ‘home’ interface has been generated
could anybody explain why ‘object’ interface hasn’t been generatedpackage 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 } }
Thanks a lot !
Scott AndersonParticipantWhat other doclet setting do you have selected? Did you select the remoteinterface task also?
–Scott
MyEclipse Support
e111MemberYes i’ve selected remoteinterface too
xdoclet-build.xml
<?xml version="1.0" encoding="UTF-8"?> <project default="_generation_" name="XDoclet Generator"> <path id="xdoclet.classpath"><pathelement location="C:/Minosiants/programm_files/java/eclipse/workspace/Hello/classes"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/rt.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/sunrsasign.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/jsse.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/jce.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/charsets.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/ext/dnsns.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/ext/ldapsec.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/ext/localedata.jar"/> <pathelement location="C:/Minosiants/programm_files/java/jdk_1.4.2/jre/lib/ext/sunjce_provider.jar"/> <pathelement location="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.6.4/data/libraryset/1.3/activation.jar"/> <pathelement location="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.6.4/data/libraryset/1.3/javax.servlet.jar"/> <pathelement location="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.6.4/data/libraryset/1.3/jboss-j2ee.jar"/> <pathelement location="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.6.4/data/libraryset/1.3/jboss-jaas.jar"/> <pathelement location="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.6.4/data/libraryset/1.3/jsse.jar"/> <pathelement location="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.6.4/data/libraryset/1.3/jts.jar"/> <pathelement location="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.6.4/data/libraryset/1.3/mail.jar"/> <fileset dir="C:/Minosiants/programm_files/java/MyEclipse/eclipse/plugins/org.jboss.ide.eclipse.xdoclet.core_3.6.4/"> <include name="*.jar"/> </fileset> </path> <target name="_generation_" depends="N10004"/> <target name="N10004" description="Standard EJB"> <taskdef classpathref="xdoclet.classpath" classname="xdoclet.modules.ejb.EjbDocletTask" name="ejbdoclet"/><ejbdoclet ejbSpec="2.0" excludedTags="@version,@author,@todo" destDir="src" verbose="true" addedTags="@xdoclet-generated at ${TODAY},@copyright The XDoclet Team,@author XDoclet,@version ${version}" > <fileset dir="src" includes="**/*.java" > </fileset> <packageSubstitution packages="ejb" substituteWith="interfaces" > </packageSubstitution> <remoteinterface> </remoteinterface> <localinterface> </localinterface> <homeinterface> </homeinterface> <localhomeinterface> </localhomeinterface> <dataobject> </dataobject> <valueobject> </valueobject> <entitypk> </entitypk> <entitycmp> </entitycmp> <entitybmp> </entitybmp> <dao> <PackageSubstitution packages="ejb" substituteWith="dao" > </PackageSubstitution> </dao> <deploymentdescriptor validateXML="true" destDir="src/META-INF" > </deploymentdescriptor> <remoteinterface> </remoteinterface> </ejbdoclet></target> </project>
console result
Buildfile: C:\Minosiants\programm_files\java\eclipse\workspace\Hello\xdoclet-build.xml N10004: [ejbdoclet] (XDocletMain.start 47 ) Running <remoteinterface/> [ejbdoclet] (XDocletMain.start 47 ) Running <localinterface/> [ejbdoclet] (XDocletMain.start 47 ) Running <homeinterface/> [ejbdoclet] Generating Home interface for 'p1.HelloWorld'. [ejbdoclet] (XDocletMain.start 47 ) Running <localhomeinterface/> [ejbdoclet] (XDocletMain.start 47 ) Running <dataobject/> [ejbdoclet] (XDocletMain.start 47 ) Running <valueobject/> [ejbdoclet] (XDocletMain.start 47 ) Running <entitypk/> [ejbdoclet] (XDocletMain.start 47 ) Running <entitycmp/> [ejbdoclet] (XDocletMain.start 47 ) Running <entitybmp/> [ejbdoclet] (XDocletMain.start 47 ) Running <dao/> [ejbdoclet] (XDocletMain.start 47 ) Running <deploymentdescriptor/> [ejbdoclet] Generating EJB deployment descriptor (ejb-jar.xml). [ejbdoclet] (XDocletMain.start 47 ) Running <remoteinterface/> _generation_: BUILD SUCCESSFUL Total time: 5 seconds
Scott AndersonParticipantThe problem is most likely the packagesubstitution setting.
<packageSubstitution packages="ejb" substituteWith="interfaces" >
How about moving your EJB into a package thatn ends with .ejb, such as hello.ejb, and rerunning.
But what I’d really suggest is that you walk through the EJB example in the
user guide under the “Creating an EJB” topic here:
http://myeclipseide.com/enterpriseworkbench/help/topic/com.genuitec.myeclipse.doc/html/tasks/EJB/creatingEJB.htm–Scott
MyEclipse Support
e111MemberThank you a lot !
-
AuthorPosts