Announcement Announcement Module
Collapse
No announcement yet.
Spring2 + EJB3 + JBoss405 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by cwash5 View Post
    So in your web application can you do the following?

    Code:
    
    SecurityService securityService = (SecurityService)ctx.lookup("java:comp/env/schlange-security/SecurityServiceEjb/local"); 
    
    This doesn't work either, I can get another proxy instance looking up for "schlange-security/SecurityServiceEjb/local", which can be casted only to EJBLocalObject.

    The global JNDI namespace in my JMX console looks like this:

    Code:
      +- schlange-security (class: org.jnp.interfaces.NamingContext)
      |   +- SecurityServiceEjb (class: org.jnp.interfaces.NamingContext)
      |   |   +- local (proxy: $Proxy99 implements interface org.schlange.security.server.SecurityService,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
      |   |   +- remote (proxy: $Proxy97 implements interface org.schlange.security.server.SecurityService,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
    Last edited by tiago182; Dec 22nd, 2006, 07:29 PM. Reason: Missing part

    Comment


    • #17
      Did you end-up figuring out anything to fix this problem? I'm basically having the exact same issue. I guess I might have to start looking at the JBoss Spring deployment thing, though I'd rather not since this seems like a programming problem which can be fixed somehow.

      Comment


      • #18
        Sorry, but at the end I left this aside because I've realised I didn't *really* need such EJB... Just in case, I've just tried it now within JBoss 4.2.2.GA and it still doesn't work: javax.naming.NameNotFoundException. Next time I shall try another application server (if I really need to use EJB3).

        Comment


        • #19
          Thanks for the quick reply. I guess I'll keep messing with this... argh...

          Comment


          • #20
            Classloading issues with local ejbs are an old, long and sad story. What it boils down to is that you have 2 classloaders for your local interface and you cannot assign instance created in one classloader to a variable in other classloader. (Classes in different classloaders can never be the same class, no matter if they have the same qname or not - that's exactly why we have different classloaders)

            Usually there is an option in your app server to turn off the local interface pass-by-ref optimization and use pass-by-value. (Let's ignore the fact that app server is fully aware of all the classloaders it created and could do this on it's own, if needed)

            Comment


            • #21
              Originally posted by dejanp View Post
              Classloading issues with local ejbs are an old, long and sad story. What it boils down to is that you have 2 classloaders for your local interface and you cannot assign instance created in one classloader to a variable in other classloader. (Classes in different classloaders can never be the same class, no matter if they have the same qname or not - that's exactly why we have different classloaders)

              Usually there is an option in your app server to turn off the local interface pass-by-ref optimization and use pass-by-value. (Let's ignore the fact that app server is fully aware of all the classloaders it created and could do this on it's own, if needed)
              Good catch! Would you know how to switch to "pass-by-value" on JBoss 4.x?

              Comment


              • #22
                Originally posted by tiago182 View Post
                Good catch! Would you know how to switch to "pass-by-value" on JBoss 4.x?
                Tiago,

                I'm still playing with this issue myself, but I think the answer probably lies in this Wiki entry on JBoss classloading:

                http://wiki.jboss.org/wiki/Wiki.jsp?...gConfiguration

                Glad I found that to better understand how classloading works in JBoss/EAR's/EJB's, as well as had dejanp reply and send me down that path.. hopefully I'm finally about to get this thing working...

                Comment


                • #23
                  Changing the ear-deployer.xml file worked for me! I'm going to try and create EJB configs to accomplish the same thing however so I don't have to have this file changed in all of the various dev/qa/prod JBoss env's however.

                  Comment


                  • #24
                    Originally posted by devnulled View Post
                    Changing the ear-deployer.xml file worked for me! I'm going to try and create EJB configs to accomplish the same thing however so I don't have to have this file changed in all of the various dev/qa/prod JBoss env's however.
                    Great! I'll follow your path and I'll try this solution as well on the evening after work. Cheers!

                    Comment


                    • #25
                      Hi tiago182,

                      Let us know if you have found a solution to the prob by changing jboss xml file.

                      Cheers!
                      CK

                      Comment

                      Working...
                      X