Tuesday, April 04, 2006

add username password to jmx console

* Update /tools/jboss-3.2.5/server/default_OR_all/deploy/jmx-console.war/WEB-INF/jboss-web.xml
uncomment this: <security-domain>java:/jaas/jmx-console</security-domain>
* Update /tools/jboss-3.2.5/server/default_OR_all/deploy/jmx-console.war/WEB-INF/web.xml
uncomment this:

<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
<description>An example security config that only allows users with the
role JBossAdmin to access the HTML JMX console web application
</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>JBossAdmin</role-name>
</auth-constraint>
</security-constraint>

* The username password to jmx console is admin/admin
(if you want to alter it use /tools/jboss-3.2.5/server/default/deploy_OR_all/jmx-console.war\WEB-INF/classes/jmx-console-users.properties)

Sunday, March 12, 2006

Setting default connection pool idle timeout for mysql

in mysql-ds.xml

Add the following to your datasource:

<idle-timeout-minutes>10</idle-timeout-minutes>

In this example we have decreased the timeout from 15 minutes to 10 minutes (jboss default is 15 minutes)

The method by which i have understood that thats whats needs to be done is by looking at: hsqldb-ds.xml

Tuesday, March 07, 2006

JBoss connection pool and fail over database

JBoss uses a connection pool to connect to databases. If you however have your database behind a fail over machine then note that the fail over machine that provides you with the link to the real database might have a timeout on the connection, in my case the fail over machine - the alteon had a timeout of 10 minutes while jboss had a timeout of 15 minutes for its connections this means that some of the connections got disconnected by the alteon, the solution to that problem was to decrease the timeout of the connections in jboss connection pool to be smaller than the timeout of the connection pool of the alteon

Monday, March 06, 2006

Cache invalidation in cluster

If you want your EJB's to invlidate their cache cross cluster you must add the following to each entity bean:

<cache-invalidation>True</cache-invalidation>
click here for more details

Tuesday, February 28, 2006

View CMP generated SQL's

Add the following to your log4j.xml

<category name="org.jboss.ejb.plugins.cmp">
<priority value="DEBUG" />
</category>

Tuesday, February 21, 2006

Turning on tomcat's access log in jboss

Edit the file:

jboss-4.0.3\server\default\deploy\jbossweb-tomcat55.sar\server.xml

Uncomment the following section:

<!-- Access logger -->
<valve classname="org.apache.catalina.valves.FastCommonAccessLogValve" prefix="localhost_access_log." suffix=".log" pattern="common" directory="${jboss.server.home.dir}/log" resolvehosts="false">
</valve>

The log file would be created:

jboss-4.0.3\server\all\log\localhost_access_log.2006-02-21.log

Starting up 2 jboss nodes on windows with HASingleton

One can start up 2 jboss nodes on the same machine, if you have any problems startin up your nodes then define them explicitly in tcp mode rather than udp mode (HASingleton prooved to be working much better in tcp mode):

Setting up tcp mode instead of udp mode is very easy:

a. in cluster-service.xml
b. bind_addr="localhost"
c. start_port="7800" on first node and 7801 on the other node
d. initial_hosts="localhost[7800],localhost[7801]" on one node and on the other initial_hosts="localhost[7801],localhost[7800]"