How to setup JBoss Clustering - jboss

I've been using Tomcat for years, but I have been put on a new project which will be using both JBoss 6 and Infinispan on EC2. I am new to both JBoss 6 and configuring it in a cluster. After having read around a lot, I am having a lot of difficulty finding good documentation explaining how / where exactly to configure JBoss/Infinispan to work in a cluster.
I understand that both JB and IS use JGroups for the cluster communication. I am very much interested in using JDBC_PING protocol ( http://community.jboss.org/wiki/JDBCPING ), as it sounds ideal for my needs. But my problem is that I just do not understand where/how to start configuring JBoss to use it (ie: which config files must be modified/etc).
Can anyone please point me in the right direction? I've already read through the JBoss AS 5.1 Clustering Guide ( http://docs.jboss.org/jbossclustering/cluster_guide/5.1/html/index.html ) but I am no further ahead understanding how to properly configure this. Any help and/or advice would be greatly appreciated!

Actually, you'll probably have an easier time using S3_PING (written specifically for EC2) rather than JDBC_PING.
In AS6, jgroups stack configuration is maintained in $JBOSS_HOME/server/all/deploy/cluster/jgroups-channelfactory.sar/META-INF/jgroups-channelfactory-stacks.xml. Infinispan cache configurations are maintained in $JBOSS_HOME/server/all/deploy/cluster/infinispan-cache-registry.sar/infinispan-configs.xml
Provided you obtain your EmbeddedCacheManager from the AS6 CacheContainerRegistry, the default "udp" stack will be used. To customize the stack for a given cache container, override the stack property. e.g.
<infinispan-config name="...">
<infinispan xmlns="urn:infinispan:config:4.2">
<global>
<transport>
<properties>
<property name="stack" value="insert-stack-name-here"/>
</properties>
</transport>
...
</global>
...
</infinispan>
</infinispan-config>
Out of curiosity, why did you opt for AS6 instead of AS7?

Related

How to monitor multiple JNDI datasources with FlexyPool?

I am starting to use FlexyPool to monitor an JNDI datasource managed by Tomcat.
I found how to monitor one datasource in this answer and in FlexyPool doc. I can not, however, figure how to configure the monitoring of multiple sources through the flexy-pool.properties file. Is this possible ?
Currently, the declarative configuration only supports a single DataSource. You can open an issue on GitHub for this. I would not mind if you send a Pull request for it.

Connect HermesJMS to Wildfly 8.2

we recently changed our Application Server from Glassfish to Wildfly. With Glassfish we used QBrowser to monitor our JMS Queues, sadly that tool does not work with Wildfly.
After a quick search I found the Tool HermesJMS. Although there are lots of guides how to set up a connection to a JMS queue with it I couldn´t find anything directly for the JBoss Wildfly application server. After lots of reading through different guides I think I can now connect to the wildfly server but I just can´t connect to my jms queues.
First I tried to connect via JNDI InitialContext. Here´s my settings for it:
initialContextFactory: org.jboss.naming.remote.client.InitialContextFactory
providerURL: http-remoting://localhost:
urlPkgPrefixes: org.jboss.naming.remote.client
securityPrincipal: admin
securityCredentials: admin
It does connect but all I see are my deployed web applications and a "jms" folder. But they all contain the same web-applications again plus the jms folder and appear as a red circle with a white X in it.
So next I tried to set up a session manually via "Create new JMS Session" with following preferences:
Session: HornetQ
Plugin: HornetQ
Properties:
binding: jms/RemoteConnectionFactory
initialContextFactory: initialContextFactory: org.jboss.naming.remote.client.InitialContextFactory
providerURL: http-remoting://localhost:
urlPkgPrefixes: org.jboss.naming.remote.client
User: guest Password: pass
The guest user is an user I created in Wildfly as an application user
When I then double click on one of the queues it says that there is no such queue.
javax.jms.JMSException: There is no queue with name java:jboss/jms/queue/ngsEmailProvRequestQueue
at org.hornetq.jms.client.HornetQSession.createQueue(HornetQSession.java:397)
at hermes.impl.jms.SimpleDestinationManager.createDesintaion(SimpleDestinationManager.java:60)
at hermes.impl.JNDIDestinationManager.createDesintaion(JNDIDestinationManager.java:105)
at hermes.impl.jms.SimpleDestinationManager.getDestination(SimpleDestinationManager.java:137)
at hermes.impl.jms.AbstractSessionManager.getDestination(AbstractSessionManager.java:387)
at hermes.impl.DefaultHermesImpl.getDestination(DefaultHermesImpl.java:323)
at hermes.browser.tasks.BrowseDestinationTask.invoke(BrowseDestinationTask.java:122)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Thread.java:745)
Does anybody know what I´m missing? Is it even possible to get HermesJms to work with Wildfly? Of if not is there an alternative monitoring tool for JMS queues?
Thank you for your help.
To work with Wildfly, follow this doc: https://developer.jboss.org/wiki/UsingHermesJMSWithHornetQ
Second part: Configuring HermesJMS for JBoss7 / EAP6 with HornetQ
And change those values:
binding=jms/RemoteConnectionFactory
initialContextFactory=org.jboss.naming.remote.client.InitialContextFactory
providerURL=http-remoting://localhost:8080
urlPkgPrefixes=org.jboss.naming.remote.client
In the destinations, change also:
Name: sample
Domain: QUEUE
Maybe you could have a look at JMSToolbox on sourceforge: https://sourceforge.net/projects/jmstoolbox/?source=directory
i recently revisited this as the team is moving from glassfish (yaye...) to wildfly. I tried with wildfly9 and it works.
I think it is a matter of exporting your queue name. see below
java:/jms/queue/test does not work
java:jboss/exported/jms/queue/test works
Note: wildfly9.2 is the final version that has hornetq. wildfly 10++ supports artemis instead.

No EJB receiver available for handling after some time

I am using Jboss 7.1 Final. I have setup remote ejb using jboss-ejb-client.properties and standalone.xml accordingly. But after the server running for sometime it will throw this exception while trying to lookup the remote ejb. Is there anything I need to set in the jboss-ejb-client.properties in order for it to work. Note that I already defined the HEARTBEAT_INTERVAL, is that not enough?
Here is the properties file:
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connections=default
remote.connection.default.host=222.222.23.222
remote.connection.default.port=4447
remote.connection.default.username=us
remote.connection.default.password=ps
remote.connection.default.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL=60000
Since no takers to this question, I found some possible solutions by googling. It might be that I have been opening too many connections by calling new InitialContext() -- I might be calling it every few minutes!!! See this link:
https://developer.jboss.org/thread/222883
In there someone mentioned GC and the connection closing etc. That might be helpful.
How do you lookup to your EJB from your EJB Client ? Incase you are using java:/ namespace the problem will happen.
Please use ejb:/ namespace to eliminate the problem.

How to integrate ActiveMQ with Dell Boomi

I have a tough time integrating the ActiveMQ using Dell Boomi as the Dell Boomi documentation is old and may be misleading too sometimes. As I could not find a good suggestion on the web I am putting my query here. Can someone please help with the steps of how to integrate ActiveMQ with Boomi?
With below steps I got it working--
Copy activemq-core-5.4.3.jar and geronimo-j2ee-management_1.1_spec-1.0.1.jar files from your ActiveMQ to your Atom/usrlib/database (create if not there) directory.
Create a jndi property file and place in ActiveMQ home directory. Reference this.
You might get NoClassDefFound error for JMS/Topic etc, means your Boomi lib does not have the implementation for that. You need to copy activemq-all-5.4.3.jar from ActiveMQ home folder to Atom/lib.
I am not specifying how to create JMS Connection and Operation in boomi however, below properties you can use for JMS conneciton in Boomi--
Connection Factory JNDI Lookup: ConnectionFactory.
Initial Context Factory: org.apache.activemq.jndi.ActiveMQInitialContextFactory (default).
Provider URL: tcp://localhost:61616 (Default port).
JMS Operation--
Destination : dynamicQueues/Dell_Boomi (Dynamic will create a queue if not existing).
That's all, try your luck and share your experience!
pick
jars activemq-client,hawtbuf,geronimo-jms_1.1_spec,geronimo-j2ee-management_1.1_spec
from the lib\plugin\queue and copy it to the lib folder. Restart Atom and it should work now.

How to programmatically un/register POJOs as services in JBoss 4.2.3.GA

I need to be able to circumvent the whole deployer malarkey and programmatically register/unregister (dependency-less) POJOs as services in JBoss.
Currently I'm dynamically creating an MBean interface and registering this with the JBoss MBeanServer, and then registering local/remote with Jndi.
This works ok (I can have a standard service from a vanilla SAR reference one of these service POJOs with the #EJB annotation) - however the container seems to leaves stale references behind as after calling unbind() and unregisterMBean().
Obviously I'm missing something by not dealing with the container in a way it expects, but what am I missing? Or is there an easier way (can't see much in the way of an API)?
thanks.