cancel
Showing results for 
Search instead for 
Did you mean: 

Adding reference of the EJB DC in java DC

ashish_shah
Contributor
0 Kudos

Hi Experts,

I want to add a refernce of my EJB DC or correcponding EAR DC to my Java DC.

I am getting a java.lang.NoClassDefFoundError for a EJBHome interface class in my Java DC.

Can you guys help me.

Regards,

Ashish Shah

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Ashish,

I'm not sure I got you right in which direction you want to set the reference, but your second sentence would imply that it's from the Java DC to the EAR DC, right? If that's the case, I have further doubts about how you run this Java DC?

Please have a look at this [thread|;. As Ken explained there, you need to create a deployable unit for your Java DC. The only difference is that in NW CE 7.1 you can only create an application (EAR DC) - Library DC is not supported.

HTH!

\-- Vladimir

ashish_shah
Contributor
0 Kudos

Hi Vladmir,

Let me explain my scenario.

1) I have a EJB DC.

2) To Deploy this EJB DC , i have created an EAR DC.

3) To access the methods in EJB DC, i have created a java DC, which acts as java command bean DC.

4) To deploy this Java DC i have created a Java library DC.

5) I am using this java DC from a WebDynpro DC application, in webDynpro application i have added the library reference to the java library DC.

Now i am getting the error "java.lang.NoClassDefFoundError for a EJBHome interface" while calling java command bean from WebDynpro DC.

Now this error seems to be due to the incorrect or missing reference in the java DC to the EJB or EAR DC.

Can you please guide me on what am i missing?

Regards,

Ashish Shah

Former Member
0 Kudos

Hi Ashish,

Have you got the problem solved? I'm running into the same problem that you had. Could you please share with me your solution for this?

Thanks,

Van

Vlado
Advisor
Advisor
0 Kudos

The solution is to declare the reference from the Library DC to the EAR DC (add to Used DCs with purpose runtime).

Former Member
0 Kudos

Hi Valdimir,

Thank you for your suggested solution. I have added reference to EAR DC as you suggested, and now I got "ClassCastException" after looking up the service.

If I look up the service locally, I got ClassCastExceptoin when I try to cast from MyServiceLocalHomeImpl0_0 to MyServiceLocalHome.

If I look up the service remotely, I got ClassCastException when I try to narrow the remote object from MyServiceHome_Stub to MyServiceHome.

Any help is very much appeciated.

Regards,

Van

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey Ashsih,

Unfortunately you can't call EJB methods from java class which is deployed along with J2EE library DC.

here is the solution for your problem.

1.create 2 public parts(api and sda) for your java classes(command Bean).

2.add both public parts to web Dynpro DC as used DC's.

3.remove the fererence to j2EE DC from your web dynpro DC.

4.add a reference to Ear in your Web Dynpro DC.

5.you no need to deploy the J2EE DC as it is not required.

when you add sda public part to web dynpro DC,web dynpro DC packs the jar file(command beans) in web dynpro ear file and deployes along with it.

hope this solves your problem

With Regards,

Balaram Naidu