2 Replies Latest reply on Feb 23, 2007 11:43 AM by Venda Vendelin

    @RemoteBinding doesn't work?

    Venda Vendelin Newbie

      I am using JBoss 4.0.4.GA. I deploy my JAR containing EJBs in EAR archive. The JNDI name of my beans gets prefixed by the EAR name by default. I want to override this behaviour to have the JNDI name independent from the EAR name.
      I thought that the @RemoteBinding(jndiBinding="someJNIDIName") is just what i need, but it doesn't seem to take any effect at all?

      This is my code:

      public class DemoBean implements DemoRemote {
      // some methods

      result in JNDI view in jmx console:
       +- myear (class: org.jnp.interfaces.NamingContext)
       | +- DemoBean (class: org.jnp.interfaces.NamingContext)
       | | +- remote (proxy: $Proxy77 implements interface uk.co.rubicon.test.DemoRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)

      The jndi name stays the same (default) no matter what I do. Anybody has a clue what am i doing wrong?

        • 1. Re: @RemoteBinding doesn't work?
          Andrew Rubinger Master

          Is DemoRemote annotated w/ @Remote?

          (Stab in the dark)

          This has always worked for me...


          • 2. Re: @RemoteBinding doesn't work?
            Venda Vendelin Newbie

            Yup, it was annotated with @Remote

            I finally found the problem by everybody's favourite trial and error approach. I'll state the solution here to save troubles to people with similar problems.

            What I had was the following file structure:

            ear file:
            | +-META-INF
            | +-Demo.jar
            standalon war file:
            | +-WEB-INF
            | +-lib
            | +-Demo.jar

            Note Demo.jar is deployed twice, once in the ear and again in the war. This was making the @RemoteBinding annotation being ignored. I don't know why, because i thought jars in WEB-INF/lib aren't being deployed even if they contain ejbs, but perhaps I am wrong.

            when I repacked it all to one EAR (and removed the redundand Demo.jar from WEB-INF/lib) it started working

            | +-META-INF
            | +-Demo.jar
            | +-DemoWeb.war