2 Replies Latest reply on Oct 14, 2010 9:52 AM by Werner Johansson

    Failing to register a Cluster Singleton

    Werner Johansson Newbie
      15:29:14,971 ERROR [STDERR] javax.naming.NameNotFoundException: nodeSingletonJAR/NodeSingleton/remote
      15:29:14,971 ERROR [STDERR]     at org.jboss.ha.jndi.HAJNDI.lookupRemotely(HAJNDI.java:265)
      15:29:14,971 ERROR [STDERR]     at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:206)
      15:29:14,972 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
      15:29:14,972 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
      15:29:14,972 ERROR [STDERR]     at javax.naming.InitialContext.lookup(InitialContext.java:392)
      15:29:14,972 ERROR [STDERR]     at se.ports.spikes.ClusterSingleton.NodeSingleton.start(NodeSingleton.java:99)
      15:29:14,972 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      15:29:14,972 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      15:29:14,972 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      15:29:14,972 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)
      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      15:29:14,972 ERROR [STDERR]     at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
      15:29:14,972 ERROR [STDERR]     at $Proxy38.start(Unknown Source)
      15:29:14,972 ERROR [STDERR]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
      15:29:14,972 ERROR [STDERR]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      15:29:14,973 ERROR [STDERR]     at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      15:29:14,974 ERROR [STDERR]     at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
      15:29:14,974 ERROR [STDERR]     at org.jboss.system.ServiceController.start(ServiceController.java:460)
      15:29:14,974 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
      15:29:14,974 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
      15:29:14,974 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      15:29:14,975 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      15:29:14,975 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      15:29:14,975 ERROR [STDERR]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
      15:29:14,975 ERROR [STDERR]     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
      15:29:14,975 ERROR [STDERR]     at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
      15:29:14,975 ERROR [STDERR]     at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      15:29:14,976 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      15:29:14,976 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:619)

      Hi!

       

      I'm trying to do the following. I have to register an EJB3.0 as a singleton in a JBoss 5.1 GA in order have a single-point access to a onfiguration object it hands out. I want this to be ready to go as the server is loaded and not on first call.

       

      In order to get this I have to get it into being a clusterwide singleton( well 2 nodes, 2 machines). I've tried several approaches. Just deploying the EJB in the /all/deploy-hasingleton directory, the -beans.xml approach which failed since I'm not up to speed on JMX annotations in  xml file, name="" and so on and the classical JMX -service.xml

       

      The last one works so and so, it does become a service with an interface in the JMX console and I can access it. It just doesn't move into the HA-JNDI namespace as I'd like it too which means I get the errors below. A NameNotFoundException which is a little odd as it registers it self in the Global JNDI tree when I look into the jboss.JNDIVIEW jmx bean.

       

      I've used the JMX interface to interact with the bean and it does run as expected. It's not lost by any means. I've done a netstat -av and all ports are active and default so nothing should be whining there. I haven't seen it whine at that particularly problem anyway.

       

      http://community.jboss.org/wiki/WritingaClusteredHASingletonService

       

      This actually describes my problem down to the last detail, almost. In fact, this is the solution that I've used to get to

      the state described above. For some reason however the @nnotations doesn't work as described and thusly I've had

      to revert to the old xml way.

       

       

      <<< snippets >>>

       

      < jboss-service.xml in META-INF (whole file)>

      <?xml version="1.0" encoding="UTF-8"?>

      <server>

      <mbean code="se.ports.spikes.ClusterSingleton.NodeSingleton" name="dummy:service=NodeSingletonMBean">

      </mbean>

       

      <mbean name="ports.se:service=NodeSingleton-Controller" code="org.jboss.ha.singleton.HASingletonController">

       

        <depends>dummy:service=NodeSingletonMBean</depends>

       

      <attribute name="HAPartition">

      <inject bean="HAPartition" />

      </attribute>

      <attribute name="TargetName">dummy:service=NodeSingletonMBean</attribute>

      <attribute name="TargetStartMethod">startSingleton</attribute>

      <attribute name="TargetStopMethod">stopSingleton</attribute>

      </mbean>

      </server>

       

      < NodeSingleton.class (top of it)>

       

      package se.ports.spikes.ClusterSingleton;

       

      import java.util.Properties;

       

      import javax.annotation.PostConstruct;

      import javax.naming.Context;

      import javax.naming.InitialContext;

      import javax.naming.NamingException;

       

      import org.jboss.annotation.ejb.*;

      import org.jboss.util.naming.Util;

       

      @Service( objectName = "dummy:service=NodeSingleton" ) // Doesn't seem to work

      @Management( NodeSingleton.class )

      public class NodeSingleton implements NodeSingletonRemote, NodeSingletonMBean {

      ...
      }

       

       

       

      Eclipse with Maven2 forces me into a Java compliance of 1.5 to see the annotations so I might have

      done something wrong there.

       

       

       

      This does produce the results described but I can't move beyond that. When I do a lookup later and

      find the NodeSingleton I succeed to get a proxy. It's null however but it does think it has one at least.

      Odd but true.

       

      I've scoured through the forums to find what it is but it seems very likely to me I'm missing something very obvious.

      Or rather I have to get this registered in the HA-JNDI properly is more like it.

       

      Anyone got a clue to what I'm missing/doing wrong?

       

      (english isn't my native language so please don't be offended or laugh your asses off

       

       

      Error mess mentioned above:

      15:29:14,971 ERROR [STDERR] javax.naming.NameNotFoundException: nodeSingletonJAR/NodeSingleton/remote

      15:29:14,971 ERROR [STDERR]     at org.jboss.ha.jndi.HAJNDI.lookupRemotely(HAJNDI.java:265)

      15:29:14,971 ERROR [STDERR]     at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:206)

      15:29:14,972 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)

      15:29:14,972 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

      15:29:14,972 ERROR [STDERR]     at javax.naming.InitialContext.lookup(InitialContext.java:392)

      15:29:14,972 ERROR [STDERR]     at se.ports.spikes.ClusterSingleton.NodeSingleton.start(NodeSingleton.java:99)

      15:29:14,972 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      15:29:14,972 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      15:29:14,972 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      15:29:14,972 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

      15:29:14,972 ERROR [STDERR]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

      15:29:14,972 ERROR [STDERR]     at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)

      15:29:14,972 ERROR [STDERR]     at $Proxy38.start(Unknown Source)

      15:29:14,972 ERROR [STDERR]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)

      15:29:14,972 ERROR [STDERR]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)

      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)

      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)

      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)

      15:29:14,972 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      15:29:14,973 ERROR [STDERR]     at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)

      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      15:29:14,973 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      15:29:14,974 ERROR [STDERR]     at org.jboss.system.ServiceController.doChange(ServiceController.java:688)

      15:29:14,974 ERROR [STDERR]     at org.jboss.system.ServiceController.start(ServiceController.java:460)

      15:29:14,974 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)

      15:29:14,974 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)

      15:29:14,974 ERROR [STDERR]     at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)

      15:29:14,974 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

      15:29:14,974 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

      15:29:14,975 ERROR [STDERR]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

      15:29:14,975 ERROR [STDERR]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

      15:29:14,975 ERROR [STDERR]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

      15:29:14,975 ERROR [STDERR]     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

      15:29:14,975 ERROR [STDERR]     at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)

      15:29:14,975 ERROR [STDERR]     at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)

      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)

      15:29:14,975 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

      15:29:14,976 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

      15:29:14,976 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:619)

       

      Other links I've used:

      (Seemed to fit but once again)

      http://docs.jboss.org/jbossclustering/cluster_guide/5.1/html/deployment.chapt.html

       

      (Mainly to get an overview)

      http://www.redhat.com/docs/en-US/JBoss_Enterprise_Web_Platform/5.0.1/html/Administration_And_Configuration_Guide/index.html

        • 1. Re: Failing to register a Cluster Singleton
          Werner Johansson Newbie

          An addition...

          I got it registered as a HA singleton master, the problem is that it won't register in the JNDI tree with

          just the @Service annotation or the <mbean></mbean> hook it seems. It's quite annoying since by

          adding @Stateless it does do the JNDI hook I need but that defeats the whole purpose.

           

          Am I really the only one with this @nnotation problem where JBoss 5.1 won't work with them?

          Do I need some special lib to make them work? I'm using Mavens provided stuff out of the box for ref.

          • 2. Re: Failing to register a Cluster Singleton
            Werner Johansson Newbie

            I got it solved.

            The problem for me was that my JBoss 5.1 GA did not ackownledge the Jboss annotations properly so in order to get it working I had to do a few tweaks to make it work.

            The article of how to write a HA singleton can be follow for most part. However there are some editions that are needed to make it work as you'd expect. And this was not just me or my company working on this as we asked others we know at other firms who had the same problem.

             

             

            <?xml version="1.0" encoding="UTF-8"?>

            <server>

                 <mbean name="dummy:service=NodeSingleton-Controller" code="org.jboss.ha.singleton.HASingletonController">

                      <depends>dummy:service=NodeSingleton</depends>

                      <attribute name="HAPartition"> <inject bean="HAPartition" /> </attribute>

                      <attribute name="TargetName">dummy:service=NodeSingleton</attribute>

                      <attribute name="TargetStartMethod">startSingleton</attribute>

                      <attribute name="TargetStopMethod">stopSingleton</attribute>

                 </mbean>

            </server>

             

            Ok, this how the mbean looks like, don't fret it. It has to be there but it's the standard issue. This is to make sure you have a @service. That annotation is broken it seems to get it work a nameYour-service.xml is needed to make it go up as one. Pity but that's how it is. No surprise really and anyone who has been at it for while won't sweat this. I did sweat since I had too ask around after a day of reading to get is properly explained how.

             

             

             

            <?xml version="1.0" encoding="UTF-8"?>

            <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"

                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                 http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

                 version="3.0">

            </ejb-jar>

             

            This little file has to be in the META-INF file. Why? To get the EJB to be registered in the JNDI tree it seems since the -service.xml doesn't do the magic punch. Why its needed at all? Don't ask me. It's just one of those things.

             

            Also you need a jboss.xml noting up the JMX bean as in what JNDI name and that looks like this:

             

             

            <?xml version="1.0" encoding="UTF-8"?>

            <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_0.xsd"

                 version="3.0">

             

                 <enterprise-beans>

                      <service>

                           <ejb-name>NodeSingleton</ejb-name>

                           <ejb-class>se.ports.spikes.clusterSingleton.NodeSingleton</ejb-class>

                           <business-remote>se.ports.spikes.clusterSingleton.NodeSingletonRemote</business-remote>

                           <object-name>dummy:service=NodeSingleton</object-name>

                           <management>se.ports.spikes.clusterSingleton.NodeSingletonMBean</management>

                           <jndi-name>NodeSingleton/remote</jndi-name>

                      </service>

                 <enterprise-beans>

            </jboss>

             

            One again, note the namespace that is included. This is also needed to make it work. I know the names aren't the most clever but I hope can understand them as you read through. The java is pure POJO, annotate to all your hearts content. The trick is that if they don't work you can always do it in the old xml way. Not as pretty but it works at least. It does have some quirks liked the ejb-jar.xml file that contains nothing but by its very presense makes it register correctly.

            There is a not a lot more to add really. It took a long while to understand the silly things needed but that's what it takes until 6 is out and hopefully working.

             

             

            I put in this little information since I'm pretty sure I'm not to only one who have had it. Sadly few take the time to write down their solutions. It would be a real windfall if people did that when special cases crop up. I know I would greatly appriecate them