1 Reply Latest reply on Jun 1, 2006 12:21 PM by peterj

    Problems with an application under jboss-4.0.3SP1

    knutschik

      Hello all,
      I have a normal J2EE-Application which uses struts. I can deploy and use the application under jboss-4.0.1 without errors.
      When I use jboss-4.0.3SP1 the deployment is fine, but there are exceptions by using the application in some struts actions.
      The exception is the following:
      java.lang.ClassCastException: $Proxy71
      actions.KundeErfassenAnzeigenAction.perform(KundeErfassenAnzeigenAction.java:34)
      org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)
      org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
      org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

      Here a snippet from the source of the action:

      if(obj == null) {
       try {
       InitialContext ic = new InitialContext();
       line:34 OnlineShopHome onlineShopHome = (OnlineShopHome) ic.lookup("OnlineShop");
       onlineShop = onlineShopHome.create();
       httpSession.setAttribute("OnlineShop", onlineShop);
       }

      Can somebody help me?
      thanks

        • 1. Re: Problems with an application under jboss-4.0.3SP1
          peterj

          Is OnlineShopHome a remote home? If so, line 34 should read:

          OnlineShopHome onlineShopHome = (OnlineShopHome)javax.rmi.PortableRemoteObject.narrow(ic.lookup("OnlineShop"), OnlineShopHome.class);


          At least, that is what works for me. (If I look up a local home I can cast that directly without problems, but the rmeote homes always return proxies, hence the need to use the PortableRemoteObject.)