• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Classcast exception after deployment

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

I am new to Oracle AS. I am stuck with a few problems after successful deployment:

1. I have a session bean called 'BusinessDelegate' that exposes the remote interface and calls all other session beans through their respective local interfaces. This 'BusinessDelegate' is therefore the ONLY bean that is visible to the web project. I am calling it from ActionClass through this code:

1. BusinessDelegateHome businessDelegateHome = (BusinessDelegateHome)ServiceLocator.getInstance().getLocalHome("BusinessDelegateBean");

2. BusinessDelegate delegate = businessDelegateHome.create();

The log shows a ClassCast exception is thrown after statement 1. The code works perfectly in JDev.

Web.xml for the web module (relevant portions):

<ejb-ref>
<ejb-ref-name>BusinessDelegateBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>org.rbi.rpcd.util.BusinessDelegateHome</home>
<remote>org.rbi.rpcd.util.BusinessDelegate</remote>
<ejb-link>BusinessDelegate</ejb-link>
</ejb-ref>


The ejb-jar.xml of the bean project (relevant portions):

<session>
<description>Session Bean ( Stateless )</description>
<display-name>BusinessDelegate</display-name>
<ejb-name>BusinessDelegate</ejb-name>
<home>org.rbi.rpcd.util.BusinessDelegateHome</home>
<remote>org.rbi.rpcd.util.BusinessDelegate</remote>
<ejb-class>org.rbi.rpcd.util.BusinessDelegateBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>

.....
(contains other local ejb-refs).

The error message includes this:
"java.lang.ClassCastException: BusinessDelegateHome_StatelessSessionHomeWrapper531" on the line (1) above.

Please tell me why this is failing in AS when it executes fine in JDev. Any insight is appreciated. TIA.

[ July 07, 2006: Message edited by: Harish Verma ]
[ July 07, 2006: Message edited by: Harish Verma ]
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Harish,
If you use this:

Then you need to use this:

Looks like the difference between "home" and "localhome" is not clear to you.
Perhaps re-read material that explains the difference?

Good Luck,
Avi.
 
reply
    Bookmark Topic Watch Topic
  • New Topic