5 Replies Latest reply on Nov 3, 2009 12:01 PM by Joel Konieczny

    Clustered Session Beans with additional HTTP Remote Proxies

    Joel Konieczny Newbie

      Bumped into the following issue, not sure if I'm doing something silly, or if I've wandered into an interesting pothole...

      We have a number of stateless session beans that we're using two remote proxies for, one RMI and one HTTPS. They deploy initially just fine and work as expected. When we attempt to redeploy them, the redeploy fails on a NameAlreadyBoundException on the HTTPS bind point.

      Narrowed it to a simplified test case and the problem seems to be the combination of clustering and the HTTP or HTTPS remoting proxy.

      Test case is a single EJB with no meaningful logic (echo method that round-trips a String) packaged in a jar packaged in an ear. Server is 5.1.0.GA

      The jboss.xml for the jar is:

      <?xml version="1.0"?>
      <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
      http://www.jboss.org/j2ee/schema/jboss_5_1.xsd"
       version="3.0">
       <enterprise-beans>
       <session>
       <ejb-name>TestBean</ejb-name>
       <remote-binding>
       <jndi-name>TestBean/remote</jndi-name>
       </remote-binding>
       <remote-binding>
       <jndi-name>TestBean/remotehttps</jndi-name>
       <client-bind-url>
       https://${public.firewall.address}/servlet-invoker/SSLServerInvokerServlet
       </client-bind-url>
       </remote-binding>
       <clustered>true</clustered>
       </session>
       </enterprise-beans>
      </jboss>
      


      Granted clustering doesn't add anything to the HTTP remoting (fail-over and load balancing are performed upstream), but we do need it for the RMI proxies.

      Remove the clustered annotation and you can deploy/undeploy/redeploy till the cows come home. Ditto with leaving the clustered but taking out the https binding.

      Is there a way to have the clustering only apply to certain remote bindings, or alternatively to have the same bean listed multiple times in the jboss.xml file (other than to transparently subclass the bean implementing the same interfaces)?



        • 1. Re: Clustered Session Beans with additional HTTP Remote Prox
          jaikiran pai Master

          Can you please post the entire exception stacktrace?

          • 2. Re: Clustered Session Beans with additional HTTP Remote Prox
            Joel Konieczny Newbie

            Deployed on a fresh start of the server (no issues), then touched the ear.

            12:15:10,735 INFO [EJBContainer] STOPPED EJB: com.tab.test.bean.TestEJB.TestBean ejbName: TestBean
            12:15:10,735 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=test_ear-1.0.ear,jar=test_c
            ode.jar,name=TestBean,service=EJB3 state=Create
            java.lang.RuntimeException: Could not bind Reference Class Name: Proxy for: com.tab.test.bean.TestEJB.TestBeanInterfaceR
            emote
            Type: ProxyFactoryKey
            Content: ProxyFactory/test_ear-1.0/TestBean/TestBean/remotehttps/CMPPartition
            Type: EJB Container Name
            Content: jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3
            Type: Proxy Factory is Local
            Content: false
            Type: Remoting Host URL
            Content: http://localhost:8543/servlet-invoker/ServerInvokerServlet
            Type: Remote Business Interface
            Content: com.tab.test.bean.TestEJB.TestBeanInterfaceRemote
            Type: Cluster Partition Name
            Content: CMPPartition
            Type: Cluster Proxy Factory Load Balance Policy
            Content: org.jboss.ha.client.loadbalance.RoundRobin
            Type: Cluster Family Name
            Content: jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3httpCMPPartition
            Type: Cluster Target Remoting Host URL
            Content: http://localhost:8543/servlet-invoker/ServerInvokerServlet
             into JNDI at "TestBean/remotehttps"
             at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:915)
             at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:895)
             at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:884)
             at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bindEjb(JndiSessionRegistrarBase.java:151)
             at org.jboss.ejb3.session.SessionContainer.lockedStart(SessionContainer.java:210)
             at org.jboss.ejb3.session.SessionSpecContainer.lockedStart(SessionSpecContainer.java:577)
             at org.jboss.ejb3.stateless.StatelessContainer.lockedStart(StatelessContainer.java:192)
             at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
             at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
             at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelCont
            rollerContextAction.java:241)
             at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerCo
            ntextAction.java:109)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAc
            tion.java:70)
             at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
             at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
             at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
             at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContext
            Action.java:62)
             at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:
            71)
             at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:5
            1)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
             at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
             at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
             at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer
            .java:62)
             at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
             at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
             at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
             at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
             at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
             at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
             at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
             at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.j
            ava:98)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.
            java:181)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205
            )
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
             at java.lang.Thread.run(Thread.java:619)
             Caused by: javax.naming.NameAlreadyBoundException: remotehttps
             at org.jnp.server.NamingServer.bind(NamingServer.java:209)
             at org.jnp.server.NamingServer.bind(NamingServer.java:167)
             at org.jnp.interfaces.NamingContext.bind(NamingContext.java:650)
             at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611)
             at org.jboss.util.naming.Util.bind(Util.java:105)
             at org.jboss.util.naming.Util.bind(Util.java:91)
             at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bind(JndiSessionRegistrarBase.java:910)
             ... 62 more
            12:15:10,798 WARN [HDScanner] Failed to process changes
            org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR
             DETAILS):
            
            DEPLOYMENTS MISSING DEPENDENCIES:
             Deployment "jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3_endpoint" is missing the foll
            owing dependencies:
             Dependency "jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3" (should be in state "Confi
            gured", but is actually in state "**ERROR**")
            
            DEPLOYMENTS IN ERROR:
             Deployment "jboss.j2ee:ear=test_ear-1.0.ear,jar=test_code.jar,name=TestBean,service=EJB3" is in error due to the follo
            wing reason(s): javax.naming.NameAlreadyBoundException: remotehttps, **ERROR**
            
             at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
             at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
             at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:
            128)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
             at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
             at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.j
            ava:98)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.
            java:181)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205
            )
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
             at java.lang.Thread.run(Thread.java:619)
            



            • 3. Re: Clustered Session Beans with additional HTTP Remote Prox
              Joel Konieczny Newbie

              Ignore the discrepancy between the specified client-bind-url in the jboss.xml and the remoting url in the error, I was just fiddling around to see if http versus https made any difference, which it seems, does not.

              • 4. Re: Clustered Session Beans with additional HTTP Remote Prox
                jaikiran pai Master

                Looking at this exception stacktrace and our code, i don't see any obvious reason why the name isn't unbound on undeployment. Could you please create a JIRA here https://jira.jboss.org/jira/browse/EJBTHREE and attach your sample application to it?