7 Replies Latest reply on Oct 5, 2006 5:06 PM by wingkwok

    problem in looking up EJB 2.0 in JBoss4.0.4.GA

    mmarcom

      hi all,
      i have deployed an .ear application that contains EJB 2.0 ejbs on jboss4.0.4.GA..
      while my bUSINessDelegate looks up EJB, i always receive a ClassCastException as a result of the ejb lookup.
      when i went to see what was the actual object being returned, i got that its class was $Proxy88 (which tells nothing to me.)

      here' ssummaryof exception
      java.lang.ClassCastException: $Proxy88

      i read some notes bout jboss4.0 not being compliant with J2EE 1.4 and some modifications needed to be done....

      can anyone tell me why jboss is returning a proxy and why i cannot cast it to my bean local home?

      thanks in advance and regards
      marco

        • 1. Re: problem in looking up EJB 2.0 in JBoss4.0.4.GA
          jaikiran

          Is your bean's interfaces (remote/local or localhome/remotehome) packaged in more than one places(may be in the war and then in some jar). If yes, then remove it from the war and maintain it in only one single jar file.
          Also, have a look at:

          http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassCastExceptions

          Specifically, have a look at the method of using JMX console mentioned in the above url.

          • 2. Re: problem in looking up EJB 2.0 in JBoss4.0.4.GA
            wingkwok

            I got similar problem but my exception is "java.security.AccessControlException: access denied (java.util.PropertyPermission SERIALIZATION read)."
            I don't use Java Security Manager.

            What does this "SERIALIZATION read" mean? Why do I get the AccessControlException even I don't use java.security.manager commandline option?

            Thanks in advance!

            Wing

            • 3. Re: problem in looking up EJB 2.0 in JBoss4.0.4.GA
              darretta

              In reference to the initial question, I have the same problem with the object returned in Jboss 4.0.x being a org.jboss.ejb.plugins.local.LocalHomeProxy, not the expected javax.ejb.EJBLocalHome. I cannot upgrade to 4.0.x if I am required to use org.jboss classes in my code. Has there been a dramatic change in EJB usage, or am I doing something wrong, possibly in my config files?

              Thank you for your help.

              • 4. Re: problem in looking up EJB 2.0 in JBoss4.0.4.GA
                mmarcom

                hiya..
                i found and solved problem... didnt post cos i had no time
                somehow, it has to do with naming system in jboss ..
                check followign files
                conf\jboss-service.xml
                deploy\ejb-deployer.xml
                deploy\ear-deployer.xml
                deploy\naming**something**.xml

                you'll see an entry CallByValue.
                you have to set it to true (if it is set to false)

                this will fix your problem

                pls post here or mail me at mmistroni@gmail.com fi this does not fix ur problem.. i have code @work, so i can postmor etomorrow

                hth
                marco

                • 5. Re: problem in looking up EJB 2.0 in JBoss4.0.4.GA
                  darretta

                  Thanks. I found another solution - ensure your ejb jar file only occurs once in your ear. I had my maven 2 pom entries improperly set to include the ejb jar in both the war and enclosing ear files.

                  • 6. Re: problem in looking up EJB 2.0 in JBoss4.0.4.GA
                    mmarcom

                    hello,
                    yes definitively what you mentionedi sthe solution..
                    had same problems (wrong way of packaging, ejb files in WEB-INF\lib)

                    my callByVaue probably wasnt the solution.... but it is ejb files outside .war

                    thanks and regards
                    marco

                    • 7. Re: problem in looking up EJB 2.0 in JBoss4.0.4.GA
                      wingkwok

                       

                      "wingkwok" wrote:
                      I got similar problem but my exception is "java.security.AccessControlException: access denied (java.util.PropertyPermission SERIALIZATION read)."
                      I don't use Java Security Manager.

                      What does this "SERIALIZATION read" mean? Why do I get the AccessControlException even I don't use java.security.manager commandline option?

                      Thanks in advance!

                      Wing



                      After I added the following 3 lines in ".java.policy" file in the user's home directory (${user.home}), the problem is solved.
                      Still don't understand why there was security restriction even though I didn't use "-Djava.security.manager" on the command line.