cancel
Showing results for 
Search instead for 
Did you mean: 

EJB project in Eclipse 3.2

Former Member
0 Kudos

Hi All,

i am trying to develop a demo EJB project in Eclipse 3.2 so after it i can use it in some other demo project.....i am not developing a adapter module.....i am developing a simple EJB project by implementing SessionBean only.

now i am facing a problem that i am not able to see EJB Candidate in my EJB-Project, so i am not able to add my class file to ejb-jar xml file........i am also not able to see ejb-j2ee-engine.xml............

So can anybody help me to rectify this situation.

Thanks,

Rajeev Gupta

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rajeev,

I met the same probelm with you several days ago, the following method solves my problem and hope it also works for you

After setting up the EJB environment, you receive the error message: Bean problem: No

interface classes found. The reason for this is that no Java source is available for the EJB

interface classes. Navigate to the developer studio’s Package Explorer view and perform

the following steps:

1. Select your project and choose Close Project in the context menu.

2. Choose Open Project.

3. Return to the J2EE Explorer view.

Former Member
0 Kudos

Hi Wang,

i am not developing a adapter module......i am developing just a demo ejb project in Eclipse 3.2 for using it in another java prj.....well my above problem is resolved now...........

now i am facing the below issue:

i created a jar file for my ejb project...........then i imported that jar file in a new java prj, then i am able to instantiate that ejb class in the main method of the new java prj.........

In the window i can also see all methods of the ejb class.........

My ejb-jar xml file is having the below content:

<ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">;

<description>Hello World EJB description</description>

<display-name>prjHelloWorldEJB</display-name>

<enterprise-beans>

<ejb-name>HelloWorldEJB</ejb-name>

<ejb-class>pkgHelloWorldEJB.HelloWorldEJB</ejb-class>

<session-type>Stateless</session-type>

<transaction-type>Container</transaction-type>

</enterprise-beans>

</ejb-jar>

Like i declared a function:

public String strReturn(){

return "Hello JAVA EJB World";

}

When i called this function by obj.strReturn() then no compilation error was there.

<b>But when i run this JAVA prj application, it gave error java.lang.NoClassDefFoundError: pkgEJB/ClassEJB

at pkg.class.main of JAVA prj application.</b>

Can anybody suggest me what should i do to rectify this situation.

Thanks,

Rajeev Gupta