[JBoss Seam] - Re: multiple @Remove, EJB3 incompatible?
by pete.muir@jboss.org
"sannegrinovero" wrote : Our application has some Stateful Beans with 1 single @Destroy and multiple @Remove; toying since some days JBoss Tools i get this error:
| Duplicate @Remove method "methodname".
So, this is probably a bug with JBoss Tools.
anonymous wrote : The warning from the tool makes sense as "This method will be called when Seam destroys the session context".. How could Seam know which method to call?
Seam doesn't call the @Remove, the EJB container does - Seam asks for the Session to be destroyed, and the EJB container can act on it.
I'm quite confused by what you are saying, but what *happens* is this:
You call a method annotated @Remove, after the completion of the this method, the container destroys the SFSB, executing any callbacks (@Destroy methods are all registered as callbacks) before it does so.
anonymous wrote : EJB3 uses the single @Destroy as a callback to cleanup, and is triggered by one of the @Remove;I think Seam is abusing this to call a @Remove (expecting it to be single) to trigger the EJB destroy.. is that right?
No, Seam doesn't call methods @Remove, you do
anonymous wrote : couldn't seam directly ask EJB to trigger destruction?
When?
anonymous wrote : or have another annotation, an extension to @Remove, single on a bean, so to know which one to call?
Why?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118258#4118258
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118258
18 years, 3 months
[JBoss Messaging] - unable to choose a default cluster node for messaging
by bodrin
I want to setup something like a master-slave cluster - all jms clients (external) using only the master node and switch to the slave only if the master is down.
So, first looking at http://docs.jboss.org/jbossas/jboss4guide/r4/html/cluster.chapt.html
| 16.2.2. Client configuration
|
| The JNDI client needs to be aware of the HA-JNDI cluster.
|
| ...
|
| java.naming.provier.url=server1:1100,server2:1100,server3:1100,server4:1100
|
|
| When initialising, the JNP client code will try to get in touch with each server node from the list, one after the other, stopping as soon as one server has been reached. It will then download the HA-JNDI stub from this node.
| Note
|
| There is no load balancing behavior in the JNP client lookup process. It just goes through the provider list and use the first available server. The HA-JNDI provider list only needs to contain a subset of HA-JNDI nodes in the cluster.
|
I can set it like this:
| java.naming.provider.url=master:1200,slave:1300
|
Then I lookup the "/ClusteredConnectionFactory" which is configured to not support load-balancing via
| <attribute name="SupportsLoadBalancing">false</attribute>
|
in JBOSS_CONFIG\deploy\jboss-messaging.sar\connection-factories-service.xml
I have observed that subsequent createConnection() calls on the ConnectionFactory object chooses one and the same cluster node.
The problem is that ones it is the master :
| ant
| Buildfile: build.xml
|
| identify:
| [echo] ###########################################################################
| [echo] # Running the DISTRIBUTED QUEUE example #
| [echo] ###########################################################################
| [echo] The queue: testDistributedQueue
| [echo] The client jar: ../..//jboss-messaging-client.jar
|
| sanity-check:
|
| init:
|
| compile:
|
| run:
| [java] Distributed queue /queue/testDistributedQueue exists
| [java] java.lang.RuntimeException: Assertion failed, 0 == 0
| [java] at org.jboss.example.jms.common.ExampleSupport.assertNotEquals(ExampleSupport.java:85)
| [java] at org.jboss.example.jms.distributedqueue.DistributedQueueExample.example(DistributedQueueExample.java:89)
| [java] at org.jboss.example.jms.common.ExampleSupport.run(ExampleSupport.java:147)
| [java] at org.jboss.example.jms.distributedqueue.DistributedQueueExample.main(DistributedQueueExample.java:173)
| [java]
| [java] #####################
| [java] ### FAILURE! ###
| [java] #####################
|
| BUILD FAILED
|
... but sometimes it is the slave :
| ant
| Buildfile: build.xml
|
| identify:
| [echo] ###########################################################################
| [echo] # Running the DISTRIBUTED QUEUE example #
| [echo] ###########################################################################
| [echo] The queue: testDistributedQueue
| [echo] The client jar: ../..//jboss-messaging-client.jar
|
| sanity-check:
|
| init:
|
| compile:
|
| run:
| [java] Distributed queue /queue/testDistributedQueue exists
| [java] java.lang.RuntimeException: Assertion failed, 1 == 1
| [java] at org.jboss.example.jms.common.ExampleSupport.assertNotEquals(ExampleSupport.java:85)
| [java] at org.jboss.example.jms.distributedqueue.DistributedQueueExample.example(DistributedQueueExample.java:89)
| [java] at org.jboss.example.jms.common.ExampleSupport.run(ExampleSupport.java:147)
| [java] at org.jboss.example.jms.distributedqueue.DistributedQueueExample.main(DistributedQueueExample.java:173)
| [java]
| [java] #####################
| [java] ### FAILURE! ###
| [java] #####################
|
| BUILD FAILED
|
Do you know if it is possible to make such a setup that it will always choose the master (serviceID=0) node?
I mean the one where the ha-jndi stub is connected to (There is no load balancing behavior in the JNP client lookup process.) ?
Note that I have changed the distributed-queue example - I have added an InitialContext configuration:
| ...
| // connecting to the first node
| java.util.Hashtable properties = new java.util.Hashtable();
| properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
| "org.jnp.interfaces.NamingContextFactory");
| properties.put(javax.naming.Context.URL_PKG_PREFIXES,
| "org.jboss.naming:org.jnp.interfaces");
| properties.put(javax.naming.Context.PROVIDER_URL, "localhost:1200,localhost:1300");
|
| ic = new InitialContext(properties);
| ...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118254#4118254
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118254
18 years, 3 months