java.lang.ClassCastException: $Proxy99 cannot be cast

Posted by svaret on Stack Overflow See other posts from Stack Overflow or by svaret
Published on 2010-04-05T01:17:25Z Indexed on 2010/04/05 1:23 UTC
Read the original article Hit count: 546

Filed under:
|
|
|
|

Hi,

I am using JBoss4.2.2 and java6.

The deployed ear's name is apa.ear

In a servlet I have the following code line:

placeBid = (PlaceBid) context.lookup("apa/"
  + PlaceBid.class.getSimpleName() + "/remote");

I have a generated jboss-app.xml like this:

<jboss-app>
  <loader-repository>apa:app=ejb3</loader-repository>
</jboss-app>

When trying to get the PlaceBid via the context I get this exception

java.lang.ClassCastException: $Proxy99 cannot be cast to se.nextit.actionbazaar.buslogic.PlaceBid

The PlaceBid interface looks like this:

@Remote
public interface PlaceBid {
 Long addBid(String userId, Long itemId, Double bidPrice);
}

When I run the example coming with EJB3 in action it works. EJB3 in action sample code comes with ant building. I want to use Maven so I have rearranged the code some.

However, I don't understan what I am doing wrong here. I have some thoughts about the jboss-app.xml file. I am not sure of how its content should look like.

Grateful for any help.

Best wishes Lasse

© Stack Overflow or respective owner

Related posts about java

Related posts about jboss