- This topic has 3 replies, 2 voices, and was last updated 19 years, 11 months ago by
Riyad Kalla.
-
AuthorPosts
-
ram_kurra@yahoo.co.inMemberHello techies,
Iam trying create a session bean using myeclipse ide.Iam using myeclipse 3.8.4,ecipse3.1M7,weblogic 7.0,
I try to create a session bean as per u r documentation in the following url
http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/firstejb/index.htmlI created firstEjb project. Here is my folder structure.
(1) firstEJb
–(2)src
—(3)demo.ejb(Package)
—-(4)Hello.java(interface)
—-(4)HelloHome.java(interface)
—-(4)kkBean.java(Bean java file)
—(3)META-INF
—-(4)MANIFEST.MF
–(2)JRESystem Library
— (2)J2EE 1.3 Library ContainerHere is my code:
kkBean.java
package demo.ejb;
import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.*;/**
* XDoclet-based session bean. The class must be declared
* public according to the EJB specification.
*
* To generate the EJB related files to this EJB:
* – Add Standard EJB module to XDoclet project properties
* – Customize XDoclet configuration for your appserver
* – Run XDoclet
*
* Below are the xdoclet-related tags needed for this EJB.
*
* @ejb.bean name=”kk”
* display-name=”Name for kk”
* description=”Description for kk”
* jndi-name=”ejb/kk”
* type=”Stateless”
* view-type=”remote”
*/
public class kkBean implements SessionBean {/** The session context */
private SessionContext context;public kkBean() {
super();// TODO Auto-generated constructor stub
}public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println(“inside ejbActivate”);}
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println(“inside ejbPassivate”);}
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub
System.out.println(“inside ejbRemove”);}
/**
* 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 method fails due to system-level error.
*/
public void setSessionContext(SessionContext newContext)
throws EJBException {
context = newContext;
System.out.println(“Hello Bean: Session Context”);
}/**
* An example business method
*
* @ejb.interface-method view-type = “remote”
*
* @throws EJBException Thrown if method fails due to system-level error.
*/
public String sayHello(String name) throws EJBException {
// rename and start putting your business logic here
System.out.println(“HelloBean:sayHello”);
return”Hello”+name;
}
public void ejbCreate() throws CreateException
{
System.out.println(“HelloBean:ejbCreate”);
}}
Hello.java
package demo.ejb;
import java.rmi.*;
import javax.ejb.*;
public interface Hello extends EJBObject {
String sayHello(String name) throws RemoteException;}
HelloHome.java
package demo.ejb;
import java.rmi.*;
import javax.ejb.*;public interface HelloHome extends EJBHome{
public abstract Hello create() throws RemoteException,CreateException;}
Now i right-clicked on firstEjb project n went to properties>MyEclipse-XDOCLET> AND pressed >ADD Standard
Iam not getting anything such as u mentioned in ur tutorial select “stanadardEjb” n other things.
why iam not getting these options??????? ❓
Does my pacakage structure is correct ????????????? ❗
If not where to put these HelloHome.java n Hello.java in the package??
If not can any body tell what is the correct folder structure?
Iam very thankfull if any body replies me
thanks(in advance)
ramuJuly 11, 2005 at 9:13 am #232690
Riyad KallaMemberRamu,
This is a known bug with our Eclipse M7 compatible release, the dialog doesn’t popup. We encourage you to do a fresh install of Eclipse 3.1 GA and MyEclipse 4.0 Milestone 2 for Eclipse 3.1 (from our 3.1 Releases section in Downloads).July 17, 2005 at 10:03 am #233126
ram_kurra@yahoo.co.inMemberHi riyad,
thanks for u r reply.
As i said previously i am using eclipse 3.1M7 and EnterpriseWorkbenchInstaller_030804_3.1M7Beta(myeclipse)
I had downloaded myeclipse4.0M2.
Does eclipse 3.1M7 supports myeclips4.0M2 or i need to install any other version of eclipse??
can u tell which version of myeclipse is not having error regarding web developement n ejb n struts.regards,
ramuJuly 17, 2005 at 10:40 am #233128
Riyad KallaMemberRamu,
We encourage you to install Eclipse 3.1 GA and MyEclipse 4.0 Milestone 2 for Eclipse 3.1, this is a solid release to work with. We will be making a release of Milestone 3 soon. -
AuthorPosts