Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Please help me to create jar for ejb  RSS feed

 
Dash Abhisek
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all I have written one small program in EJB but I am unable to deploy it using weblogic 7.0 . As I am unable to create jar file properly .Every time I am deploying the jar created it says no diployment descriptor found.

I am giving the code and related directory structure

directory structure
EJBTest
src
com.EJB.bean
com.EJB.component
com.EJB.Home
META-INF

code is

package com.EJB.bean;
import javax.ejb.*;

public class SBean implements SessionBean {


public String getFirstMessage()
{
return "welcome to world of ejb from , This message is from inside session bean";
}

public void ejbActivate()
{
System.out.println("inside activate of session bean");
}
public void ejbPassivate()
{
System.out.println("inside Passivate of session bean");
}
public void ejbRemove()
{
System.out.println("inside Remove");
}
public void setSessionContext(SessionContext sc)

{

System.out.println("inside session context of session bean");
}




}

------------------------

package com.EJB.component;
import javax.ejb.*;
import java.rmi.RemoteException;

public interface ComponentInterface extends EJBObject{
public String getFirstMessage() throws RemoteException;
}

------------------------

package com.EJB.Home;
import javax.ejb.*;
import java.rmi.RemoteException;
import com.EJB.component.*;

public interface HomeInterface extends EJBHome {

public ComponentInterface create() throws RemoteException,CreateException;

}

-------------------------------

ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
<display-name>EJB1</display-name>
<enterprise-beans>

<session>
<display-name>FirstBean</display-name>
<home>com.EJB.Home.HomeInterface</home>
<remote>com.EJB.component.ComponentInterface</remote>
<ejb-class>com.EJB.bean.SBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<security-identity>
<description></description>
<use-caller-identity></use-caller-identity>
</security-identity>
</session>
</enterprise-beans>

</ejb-jar>


I have Eclipse but it doesn't detect weblogic 7.0
so I need to create jar file from the command prompt
 
Shikhar Madhok
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This link should help. Gives you the steps to create and deploy an ejb on weblogic 7.0.
Try to follow these steps and let us know where you get held up.
Additionally, weblogic server installs generally ship with examples. You may want to have a look at them as well.

HTH
Shikhar
 
Dash Abhisek
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to deploy EJB in weblogic 7.0 but I am unable to create jar

I am using this command .

steps
1. I go t0 src folder through command prompt
2. then jar -cf myEJB.jar TestEJB

in the work space one jar file is created with the name myEJB

but when I am deploying in weblogic 7.0

exception is thrown saying cannot find deployment descriptor

but I have a folder named META-INF and in that folder I have ejb-jar.xml file .
so I couldn't understand why the server is not detecting the deployment descriptor?
 
Shikhar Madhok
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't the documentation mention that you need a weblogic-ejb-jar.xml as well?

HTH
Shikhar

PS: I hope before you run jar your source code is compiled into class files. Also make sure you have generated the stub and sekleton classes. I think you need to use ejbc to generated them.
 
Dash Abhisek
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shikar

Well I have compiled the src code into class file but I didn't knew about weblogic-ejb-jar.xml
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!