Secure JBoss JMX Console

Since JBoss can now be installed from a zip file it comes with a default unsecured jmx-console. This is unacceptable for production so here is the method to secure the jmx-console using http authentication (applies to JBoss 4.2.2.GA). 1. Edit jboss/server/default/deploy/jmx-console.war/WEB-INF/web.xml and uncomment the security-constraint element: <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> 2....

December 8, 2008 · len

Another way to use Quartz in JBoss

I was explaining here how to create a Quartz job using the standard Quartz-ra service which comes bundled with JBoss. The method is rather limited, or I was not able to find the proper documentation on how to register new jobs on the fly. This is why in this post I will show how to access the quartz scheduler directly. Note: everything here applies to JBoss 4.2.2GA Remove the existing Quartz You need to remove the existing Quartz-ra and quartz....

October 13, 2008 · len

Creating a Quartz job

In new versions of JBoss (such the 4.0.5 which I am using) there is a quartz-ra.sar service which should allow me to define some a job with a cron like specification. Searching the forums and the jboss site I was able to put together quickly an example: import org.jboss.annotation.ejb.ResourceAdapter;import org.jboss.logging.Logger;import org.quartz.Job;import org.quartz.JobExecutionContext;import org.quartz.JobExecutionException; import javax.ejb.MessageDriven;import javax.ejb.ActivationConfigProperty; @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0/2 * * * * ?") }) @ResourceAdapter("quartz-ra....

July 10, 2007 · len

Does Date() returns localtime?

Getting the correct date and time was always a problem but I could not expect it’s still a problem on today java and OS versions. Trying to deploy a JBoss on various Linux and JBoss I could not notice that on each system the date in the log was different from the localtime. Initially I thought it’s just a JBoss configuration problem but a simple example shows it’s not: import java....

July 3, 2007 · len

JBPM Hibernate cache

Applies to: JBPM 3.1.2, JBoss 4.0.5-GA Everything starts with a beautiful concept but has to pass past those nasty errors. The same applies to this JBPM project, everything was nice, I have seen it running and then I was supposed to take the sources, clean, organize and enhance. Everything ok until now. The only problem is that when deploying the JBPM (sar) service there was this error: 16:09:17,402 ERROR [CommandExecutorThread] org....

January 4, 2007 · len

Webapp logging

Applies to: JBoss 4.0.5 GA Everything started with a web application which worked perfectly inside a Tomcat 5 container and had to be migrated to JBoss. At the first deployment got this error: 14:45:56,496 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by 14:45:56,496 ERROR [STDERR] log4j:ERROR [WebappClassLoader delegate: false repositories: /WEB-INF/classes/----------> Parent Classloader:java.net.FactoryURLClassLoader@172bab9] whereas object of type 14:45:56,497 ERROR [STDERR] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@19616c7].14:45:56,542 ERROR [STDERR] log4j:ERROR Could not create an Appender....

December 3, 2006 · len

JMX invocation with secured console

Applies to: JBoss 4.0.5 GA As I am working on a rather complex application with a lot of dependancy bounded MBeans I found it necessary to have a small application, in a different JVM, invoke a MBean method for administrative purposes. Even if this sounded easy at the begining it seemed that I had to face 2 problems: JBoss JMX implementation JAAS access to the secured console Since I both googled and searched JBoss forums without much help I decided, upon succeding, to write this article as it might help someone futher....

December 1, 2006 · len