Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:52:03+00:00 2026-06-09T00:52:03+00:00

Somehow when I try a remote remote EJB3 call the ClassCastException is thrown. Server:

  • 0

Somehow when I try a remote remote EJB3 call the ClassCastException is thrown.

Server:

public interface CardManager extends Manager {
     public CardCheckResponse check(CardCheckRequest request);
}


@Remote
public interface RMICardManagerRemote extends CardManager {
     static String CARD_CHECK_RMI_REMOTE_JNDI = "CardCheckRMI/remote";
}


@Stateless
@RemoteBinding(jndiBinding = RMICardManagerRemote.CARD_CHECK_RMI_REMOTE_JNDI)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class RealRMICardManager implements RMICardManagerRemote {
    private CardManager cardManager = injector.getInstance(CardManager.class);

    @Override
    public CardCheckResponse check(CardCheckRequest request) {
    return cardManager.check(request);
    }

}

Client:

InitialContext remoteContext = new InitialContext(PropertiesUtil.getCardCheckProp());
RMICardManagerRemote rmiCardManagerRemote = (RMICardManagerRemote) remoteContext.lookup(RMICardManagerRemote.CARD_CHECK_RMI_REMOTE_JNDI);

//throws ClassCastException
CardCheckResponse cardCheckResponse = rmiCardManagerRemote.check(cardCheckRequest); 

Stacktrace:

java.lang.ClassCastException: com.cardcheck.dto.CardCheckResponse cannot be cast to com.cardcheck.dto.CardCheckResponse
    at $Proxy307.check(Unknown Source)
    at com.xxx.cardCheck(RechargeAdapter.java:267)

I’ve checked if it was duplicate jar, but is not the case. Does anyone have any idea to solve this problem?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:52:05+00:00Added an answer on June 9, 2026 at 12:52 am

    Solved!

    The problem is caused by JBoss’s unified class loader. I solved my problem creating a custom loader in jboss-app.xml:

    <loader-repository> com.cardcheck loader = cardCheck heard </ loader-repository>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have somehow managed to break my infopath form :( When I try to
somehow I get never any results when I call: select * from table_1 t1
When I try to create a new branch tracking a remote branch, I get
I try to remove the buttons in one of my view controllers, somehow this
I try to push changes from my local repo to a remote repo. When
is it possible to somehow tell windows that when I try to access ip
I am using a singleton class to fetch JSON from a remote server (via
Somehow, JavaScript makes sense of the bitwise operations NaN ^ 1 , Infinity ^
Somehow my code doesn't work any more (it did work before with the exact
Somehow this doesn't work... var paper = Raphael(test, 500, 500); var testpath = paper.path('M100

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.