No clue on how to deploy a simple EJB
Dear experts,
I finished installing J2EE 1.5 with JDK ,compiled three classes.
Calculator.java
CalculatorHome.java
CalculatorEJB.java
Calculator.java
coding is as under:
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
publicinterface Calculatorextends EJBObject
{
publicdouble dollarToRs(double dollars)throws RemoteException;
}
CalculatorHome.java
[CODE]
import java.io.Serializable;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
public interface CalculatorHome extends EJBHome
{
Calculator create() throws RemoteException,CreateException;
}
[/CODE]
CalculatorEJB.java
import java.rmi.RemoteException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
publicclass CalculatorEJBimplements SessionBean
{
publicdouble dollarToRs(double dollars)
{
return dollars*47.20;
}
public CalculatorEJB()
{
}
publicvoid ejbCreate(){}
publicvoid ejbRemove(){}
publicvoid ejbActivate(){}
publicvoid ejbPassivate(){}
publicvoid setSessionContext(SessionContext ct){}
}
I compiled all to respective classes.Now i am stuck how to create .ear
file or how to deploy using asant or any means.Previously i used
J2EE 1.3.Plz guide.
[2938 byte] By [
Adi1000a] at [2007-11-27 11:06:14]

I clicked on link Packaging and deploying application and i get this
Before applications can be deployed, they must be packaged into Java ARchive (JAR), Web ARchive (WAR), or Enterprise ARchive (EAR) files. The packaged application includes deployment descriptors, which give the Application Server software the information it needs to load the application, map a URL to it, and connect it to the resources it uses. This section describes the following techniques for packaging and deploying applications
Now if i dont know the guidelines to generate jar.If i assume .war is with me then how ?,Same with .ear.What about deployment descriptor.
No mechanisms explained.
1. You have to have the appropriate configuration files to create an enterprise application for your application server. Information on this can be found in the documentation for your application server. It will most likely be mostly identical to every other application server.
You will likely need [ejb-jar.xml and (your application server)-ejb-jar.xml] at a minimum.
These and the code need to be built into an enterprise archive (ear)
The created ear file needs to be deployed to your application server.
My recommendation is to use ANT to do the build because it makes the process repeatable.
PS.