File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes how to devlop and deploy EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to devlop and deploy EJB" Watch "how to devlop and deploy EJB" New topic

how to devlop and deploy EJB

anubha goel

Joined: Jul 06, 2007
Posts: 22
I am new to EJB,i wrote beans(home,remote and bean)
and created its deployment descriptors using weblogic8.1
then I followed few steps such as:-

create the jar file by the following command;

f:\ejbdemo>jar cf sqlejbpack.jar
demo1\*.class META-INF\*.xml

deploy the jar using the following command
f:\ejbdemo>java weblogic.ejbc sqlejbpack.jar sqlejbpack1.jar

the deploy command didn't worked in my case it displayed the following error:-

ERROR: Error from ejbc: Compiler class: '', not found
ERROR: ejbc couldn't invoke compiler

please help me out.
I also wanted to know the purpose of creating jar files.

Thanks & Regards,
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159

Is that possible to send the code snippets.

and DD files too. Seems the problem with the same.

If weblogic.ejbc doesn't work for you use weblogic.appc even it do the same work as our ejbc.

Creating stub checking for the xml and all.



SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
anubha goel

Joined: Jul 06, 2007
Posts: 22
The DD files are as under:
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN' ''>

<!-- Generated XML! -->






<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' ''>

<!-- Generated XML! -->




package demo1;
import javax.ejb.*;
import java.rmi.*;
import java.util.*;
public interface sqlRemote extends EJBObject{
public String getresult(String s)throws RemoteException;


package demo1;
import javax.ejb.*;
import java.rmi.*;

public interface sqlHome extends EJBHome
public sqlRemote create()throws RemoteException,CreateException;


package demo1;
import javax.ejb.*;
import java.util.*;
import java.sql.*;
public class sqlBean implements SessionBean

public String getresult(String sql)
//usual code to be written
return sql;
public void ejbCreate(){}
public void ejbRemove(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void setSessionContext(SessionContext sc){}

------------------------------------------------------------------ (client)

package ourpack;
import java.util.*;
import javax.rmi.*;
import javax.ejb.*;
import javax.naming.*;

import demo1.sqlHome;
import demo1.sqlRemote;

import java.rmi.*;
public class ejbCaller {
public String callejb(String s)
String r;
System.out.println("Please Wait");
Properties prop=new Properties();
Context ctx=new InitialContext(prop);
System.out.println("CONTEXT READY");
demo1.sqlHome home=(demo1.sqlHome)ctx.lookup("ejbpackjndi");
System.out.println("HOME LOCATED");
sqlRemote remote=home.create();
System.out.println("REMOTE READY");
catch(Exception e1){


return r;
this is the code and deployment descriptors...

Thanks & Regards,
I agree. Here's the link:
subject: how to devlop and deploy EJB
It's not a secret anymore!