on 01-28-2008 6:33 PM
Hi Experts,
I got a ClassCastException when accessing EJB using JNDI in WebDynpro application. Here is the scenario:
1) Create an EJB DC.
2) Create an EAR DC to deploy the EJB DC.
3) Create a Java DC to provide access to the methods in EJB DC.
4) Create a Java library DC to deploy the Java DC.
5) Create WebDynpro DC application that uses the Java DC.
In Java DC, I have added reference to EAR via Used DCs.
In WebDynpro, I have added the library reference to the java library DC and share reference to the EAR DC.
When I deploy the WebDynpro DC, 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.
Note that I can successfully access the EJB from a standalone java application using JNDI.
Could anyone outthere have solution for this problem? Your help is very much appeciated!
Regards,
Van
Hello Van,
Use Java DC directly in ur Web dynpro application instead of adding it to J2EE library component.
Here are the steps:
1.create 2 public parts(api and sda) for ur java classes.
2.define both public parts as Used DC for your web Dynpro DC.
3.remove the reference to ur J2EE libary component as it not required.
hope this helps
With Regards
Balaram Naidu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.