jboss 6.4 EAP threadpool/executor JNDI lookup - jboss

I can't find informations if it's possible and if so then how to expose configured executor as JNDI resource.
this is my configuration inside standalone.xml
<subsystem xmlns="urn:jboss:domain:threads:1.1">
<thread-factory name="spring-async-factory" group-name="spring-thread-pool" thread-name-pattern="spring-async-%t" priority="1"/>
<blocking-bounded-queue-thread-pool name="spring-async-tp">
<core-threads count="5"/>
<queue-length count="100"/>
<max-threads count="10"/>
<keepalive-time time="20" unit="seconds"/>
<thread-factory name="spring-async-factory"/>
</blocking-bounded-queue-thread-pool>
</subsystem>
I've tried it to access with java:global/threads/spring-async-tp, java:comp/threads/spring-async-tp but that wasn't found. So if it's possible how can I found it via JNDI?

The threads subsystem is deprecated and has been removed in JBoss EAP 7.0. There is also not a way to expose the factory via JNDI. It was the intention of the subsystem to be a reference point for other subsystems to point to a thread factory. It was never the intention that these factories get used in deployments.

Related

Jboss EAP 7.1, standalone.xml, using IBM MQ, no outbound / outgoing message: can urn:jboss:domain:resource-adapters-section be empty?

Jboss EAP 7.1, standalone.xml, using IBM MQ, no outbound / no outgoing message
Is it right that standalone.xml / urn:jboss:domain:resource-adapters-section can be empty, if my application has no outgoing messages (only reads messages from MQ) ?
Is it right that standalone.xml / urn:jboss:domain:resource-adapters-section can be empty, if my application has no outgoing messages (only reads messages from MQ) ?
-> No, wmq.jmsra.rar has to be configured:
<subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">
<resource-adapters>
<resource-adapter id="wmq.jmsra.rar">
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>LocalTransaction</transaction-support>
<connection-definitions>
</connection-definitions>
<admin-objects>
</admin-objects>
</resource-adapter>
</resource-adapters>
</subsystem>
Please try using the standalone-full.xml. The standalone.xml configuration does not include JMS messaging. The embedded JMS broker in JBoss can be disabled (if desired) by providing an empty configuration for ActiveMQ.

Can not use jconsole to connect to JBoss eap7.1

I installed eap7.1 on RHEL73, everything works fine, but failed to use jconsole to connect server instance, I didn't find anything related with how to set jmx component on eap7.1, but found something for eap6, here is main points I found:
Should disable management binding and enable an remote binding:
Add option as eap server startup option:
-Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl
-Djboss.platform.mbeanserver
Use $JBOSS_HOME/bin/jconsole.sh to startup jconsole
But I always failed with jconsole reponse as " the connection to service:jmx:remote://192.168.56.11:4447 did not succeed"
Here is key point of domain.xml
...
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
<endpoint/>
<connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
</subsystem>
...
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector use-management-endpoint="false"/>
</subsystem>
...
<socket-binding-group name="ha-sockets" default-interface="public">
...
<socket-binding name="remoting" port="4447"/>
...
</socket-binding-group>
server startup successfully with the following log
"INFO [org.jboss.as.remoting] (MSC service thread 1-1) WFLYRMT0001: Listening on 192.168.56.11:4447"
netstat -an shows 4447 is ready.
The following is some guides on eap6 I followed:
https://access.redhat.com/solutions/149973
https://access.redhat.com/solutions/443033
https://access.redhat.com/solutions/413283
https://kb.novaordis.com/index.php/JMX_Access_to_Domain_Mode_EAP_7_Server_Node(this is for eap7)
Is there anything special on JMX for eap7.1?
Best regards
Lan
I have the same problems as you. My quick fix is:
change this:
<connector name="remoting-connector" socket-binding="remoting" **security-realm="ApplicationRealm"**/>
to this:
<connector name="remoting-connector" socket-binding="remoting" security-realm="ManagementRealm"/>
or remove realm:
<connector name="remoting-connector" socket-binding="remoting"/>
Probably I have a wrong user in ApplicationRealm or don't have the permission. I use this in zabbix jmx monitoring in domain mode with wildfly 10, 10.1 and 11.
You can connect the jconsole to EAP 7.1 with default configuration using the management realm. You just have to:
add a management user, via $JBOSS_HOME/bin/add-user.sh
start EAP
connect to jmx service address
service:jmx:remote+http://127.0.0.1:9990 via
$JBOSS_HOME/bin/jconsole.sh using credentials defined in above step
n.b.: The protokoll may differ from previous versions of eap

Jboss EAP 6.3: HQ119031: Unable to validate user: null

ERROR HQ224018: Failed to create session: HornetQException[errorType=SECURITY_EXCEPTION message=HQ119031: Unable to validate user: null]
When the Jboss EAP 6.3 server is about to receive JMS message. I have the user successfully authenticated by remoting subsystem so why the user is null? How to overcome this error?
EAP documentation encorage you to:
(...) set allowClientLogin to true (...) If you would like HornetQ to
authenticate using the propagated security then set the authoriseOnClientLogin to true also.
But due to HORNETQ-883 bug you have to turn off security for messaging:
<hornetq-server>
<!-- … -->
<security-enabled>false</security-enabled>
<!-- … -->
</hornetq-server>
In short, if your JMS client is connecting from within your JEE container and have no need to supply credentials to connect to JMS (when calling factory.createConnection()), then obtain connections using the InVM Connector. The InVM Connector doesn't require credentials when opening a connection to JMS (since the caller is within the JVM instance, hence the name) but still enforces security for Remote JMS clients. Connectors and ConnectionFactories are configured in the urn:jboss:domain:messaging subsystem of standalone.xml.
Otherwise, if you don't use the InVM Connector with security enabled, you'll probably need to run the add-user script in [jboss-home]/bin to add client credentials to the appilcation-users.properties file and supply those credentials when calling factory.createConnection(username, pwd) for both Remote and InVM clients connecting via Remotely available factories.
Gory Details
In our JBoss EAP 6.4 instance, security needs to remain enabled for remote connections (outside the JVM) so our <security-settings> for HornetQ are specified appropriately. Consequently, the JMS ConnectionFactory dictates the level of security based on which Connector it is configured with.
<hornetq-server>
<connectors>
<!-- additional connectors here -->
...
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<!-- JNDI bindings here -->
<entry name="java:/ConnectionFactory" />
</entries>
</connection-factory>
...
</jms-connection-factories>
So, in the JMS client apply the standard connection boiler-plate:
InitialContext context = new InitialContext();
javax.jms.ConnectionFactory factory = (ConnectionFactory) context.lookup("java:/ConnectionFactory");
and when creating the connection:
javax.jms.Connection connection = factory.createConnection();
Transacted JMS
For Transaction-aware in-container client connections to JMS, our InVM ConnectionFactory is configured like this:
<jms-connection-factories>
...
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
</jms-connection-factories>
Obtain the transacted JMS ConnectionFactory as such:
InitialContext context = new InitialContext();
javax.jms.ConnectionFactory factory = (ConnectionFactory) context.lookup("java:/JmsXA");

Jboss as7 monitoring HTTP Listener Threads

I want to monitor HTTP Listener Threads at jboss as 7. How can I do this?
Are there any MBeans, witch allows to do this?
Web subsystem contains only general information but I want to monitor:
http-thread-max
http-thread-current
http-thread-busy
http-thread-spare-max
http-thread-spare-min
Yes, you can use Mbean for Thread pool monitoring:
Memory and Thread Monitoring.
JBoss Performance Tuning part 1 - Tune JBoss Thread Pools
Also, check out the jBoss console, I think there should be a tab with Thread pools - listing sizes, business, etc.
As a last resort, collect thread dumps and see for yourself.
I need to get information about HttpThreads, not only jvm threads.
I modified thread subsystem of standalone.xml and via Jboss DMR I got http thread metric.
ModelNode request = new ModelNode();
request.get(ClientConstants.OP).set("read-resource");
request.get(ClientConstants.OP_ADDR).add("subsystem", "threads");
request.get("recursive").set(true);
request.get("include-runtime").set(true);
final ModelNode response = client.execute(new OperationBuilder(request).build());
return response.get(ClientConstants.RESULT).get("bounded-queue-thread-pool").get("http_queue");
Standalone.xml thread subsystem looks like:
<subsystem xmlns="urn:jboss:domain:threads:1.1">
<thread-factory name="my_tf" group-name="group1" thread-name-pattern="my_tf_" priority="1"/>
<bounded-queue-thread-pool name="http_queue" allow-core-timeout="true">
<core-threads count="100"/>
<queue-length count="50"/>
<max-threads count="200"/>
<keepalive-time time="30" unit="minutes"/>
<thread-factory name="my_tf"/>
</bounded-queue-thread-pool>
</subsystem>

enabling jmx remote in jboss 6.1

I'm trying to enable jmx remote in jboss 6.1. When I've added options like below
-Djboss.platform.mbeanserver
-Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl
-Dcom.sun.management.jmxremote.port=12349
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
, jboss can't start properly and I'got following error:
" Deployment "JBossLogService" is in error due to the following reason(s): java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager"), **ERROR**"
Do you have any ideas how to fix it ?
In Jboss EAP 6.1 JMX is enabled by default.
ensure you have:
<extension module="org.jboss.as.jmx"/> under <extensions>
<subsystem xmlns="urn:jboss:domain:jmx:1.2">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
use -Djboss.bind.address.management=YOURSERVERIP as command line argument to start you AS or change it here:
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:**127.0.0.1**}"/>
</interface>
..
</interfaces>
use jconsole start script under JBOSS_HOME/bin/jconsole.sh (it loads JBoss remoting libraries on classpath )
to use jvisualvm instead refer to https://github.com/johnaoahra80/jboss-as-tool-integration/tree/master/visualvm
use that url in jconsole service:jmx:remoting-jmx://yourIP:magementport (default is 9999)
use user/password you crated using JBOSS_HOME/bin/add-user.sh
add next options
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-version.jar
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/jboss/log4j/logmanager/main/log4j-jboss-logmanager-version.jar
-Xbootclasspath/p:$JBOSS_HOME/modules/system/layers/base/org/apache/log4j/main/log4j-jboss-logmanager-version.jar
-Dcom.sun.management.jmxremote