3 Replies Latest reply on Apr 3, 2007 11:18 AM by William DeCoste

    Help! ClassCastException: $Proxy?? Issue

    Benjamin Seyinbour Expert

      I have spent a whole week trying to solve a problem without success. Frankly, I don't know what else to do except to turn for help here.

      For development:
      Window 2003 Server

      Entity bean(AddressEntity.java)
      Session bean(AddressFacade.java)
      Session bean interfaces(AddressFacadeRemote,java, AddressFacadeLocal.java )
      JSF page(create.jsp)
      JSF backing bean (Create.java)

      foopojo.jar contain POJO and persitence.xml
      fooejb.jar contains Session bean classes and jboss.xml
      odmweb.war contains: jsp files, backing beans, jboss.web, faces-config.xml, web.xml etc.
      odmapp.ear contains: foopojo.jar, fooejb.jar, fooweb.war, application,xml and jboss-app.xml

      application.xml contains

       <module> <ejb>fooejb.jar</ejb> </module>
       <module><ejb>foopojo.jar</ejb> </module>

      The application is deployed as EAR (fooapp.ear) to jboss-4.2.0.CR1

      I have in my backing bean (Create.java):

      public String addButton_action() {
       try {
       //NOTE: addressEntity is property in this class
       java.util.Date timestamp = new java.util.Date(System.currentTimeMillis());
       info("Address was successfully created.");
       } catch (Exception ex) {
       return "address_create";
       public AddressFacadeRemote getAddressFacadeRemote() {
       if(this.addressFacadeRemote == null){
       try {
       Context ctx = new InitialContext();
       //NOTE: RemoteJNDIName is "fooapp/AddressFacade/remote" in the session bean AddressFacade;
       //NOTE: Next is Line# 236 as reported in the exception thrown
       this.addressFacadeRemote = (AddressFacadeRemote) ctx.lookup(AddressFacade.RemoteJNDIName);
       catch (NamingException e){
       throw new RuntimeException(e);
       return addressFacadeRemote;

      Create.jsp is an input form
      1. I start the page
      2. Fill the form
      3. Click a button to process the data
      4. The system check for error but there is no error to display
      5. The system throws the following error:

      08:49:33,578 ERROR [STDERR] java.lang.ClassCastException: $Proxy117
      08:49:33,593 ERROR [STDERR] at com.xxx.vmo.foo.pojo.address.Create.getAddressFacadeRemote(Create.java:236)
      08:49:33,593 ERROR [STDERR] at com.xxx.vmo.foo.pojo.address.Create.addButton_action(Create.java:846)
      08:49:33,593 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      I can't go past this error no matter what I try. I would appreciate, very much, is anyone would help.

      Thanks in advance.