JBoss migration – Quartz

This is a continuation of the previous article regarding some migration points (1, 2) from JBoss 4.2.2-GA to JBoss 7.1.1 and, presumably, Tomcat 7. 3. Quartz Quartz migration has been the simplest of all, by far. 3.1 JBoss 4.2.2 In JBoss 4.2.2 Quartz was configured using a MBean with a simple configuration: <pre lang="xml"> <?xml version="1.0" encoding="UTF-8"??> <server> <mbean code="org.quartz.ee.jmx.jboss.QuartzService" name="user:service=QuartzService,name=QuartzService"> <depends>jboss.jca:service=DataSourceBinding,name=XOracleDS</depends> <depends>jboss.web.deployment:war=/X</depends> <attribute name="Properties"> org.quartz.scheduler.instanceName = DefaultQuartzScheduler org.quartz.scheduler.rmi.export = false org....

July 20, 2012 · len

JBoss migration – the HAR archive

This is a continuation of the previous article regarding some migration points from JBoss 4.2.2-GA to JBoss 7.1.1 and, presumably, Tomcat 7. 2. The HAR archive The HAR archive was a nice mechanism which allowed hibernate integration. A ${name}.har file was created, containing all the mappings (*.hbm.xml) and data classes (*.class), allong with a hibernate-service.xml (later renamed to service-hibernate.xml in JBoss 5). This took care of creating the SessionFactory and making it accessible through JNDI....

July 20, 2012 · len

JBoss migration – the data source

I have spent a lot of time lately trying to create a migration plan for an application currently running on JBoss 4.2.2. Since this application development started a few migration attempts to newer versions of JBoss have been done (see for 5.1) but as it seems each version has different style configuration files and this application is expected to have a long lifetime the work seems a bit futile so in parallel of...

July 20, 2012 · len

To migrate or not to migrate

This is not a guide, nor intended to help, it’s a steam valve for my efforts to migrate an application to jboss 7 as each exception can take minutes or hours to solve without altering the original code. Caused by: org.jboss.jca.common.metadata.ParserException: IJ010061: Unexpected element: local-tx-datasource at org.jboss.jca.common.metadata.ds.DsParser.parseDataSources(DsParser.java:183) at org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:119) at org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:82) at org.jboss.as.connector.deployers.processors.DsXmlDeploymentParsingProcessor.deploy(DsXmlDeploymentParsingProcessor.java:80) at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotation Information(MethodAnnotationAggregator.java:58) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.ha ndleAnnotations(InterceptorAnnotationProcessor.java:85) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.pr ocessComponentConfig(InterceptorAnnotationProcessor.java:70) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.de ploy(InterceptorAnnotationProcessor.java:55) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] ... 5 more Caused by: java....

June 23, 2012 · len

Enable ehcache debug in jboss

I’ve been trying to setup ehcache clustering in JBoss and unless there is a problem I’ve noticed there is little logging involved. So enabling logging should be a straightforward operation, I said. And it sure is if you bother to consider that the default ehcache distribution uses slf4j which is packed only with the jdk logger. So by default no matter how much you configure log4j no logging will be done....

November 9, 2011 · len

Hibernate JbossCache integration

Introduction JbossCache is a wonderfully complex piece of software. Trying to use it with Hibernate might seem an easy task at first but in reality it can also prove wonderfully complicated. First question is: why would you consider using it in the first place? Compared to ehcache for instance there are a few theoretical advantages: clustering (scalability), configurability and jmx monitoring. Next question which is not quite obvious is which version to use?...

September 20, 2010 · len

JBoss session cookies

If you are using cookies for inter-context communication you will notice after migrating from JBoss 4 to 5 that they just don’t work. If you take the time to do some cookie debuging you will notice that in JBoss 5 the cookies are bound to the context as shown bellow: Name JSESSIONID Value ACF23793236E94A664E652AA77AC7578 Host localhost Path /myApp/ Secure No Expires At End Of Session This means there is no way this cookie can be used to comunicate with /myApp2/ for instance....

September 14, 2010 · len

Tomcat query parameters and encodings

Did you ever wondered which from which encoding the query parameters are parsed by default in java (servlet) and the response in rendered? Say UTF-8. Wrong. Try ISO-8859-1. There are 3 cases to consider: 1. Query parameters as GET 2. Query parameters as POST 3. Response encoding. In order to solve 1 and 2 one solution is just to convert the parameters to UTF-8: String param = request.getParameter("test"); if(param != null) param = new String(param....

April 8, 2010 · len

JBoss migration 4.2.2-GA to 5.1.0-GA

In my stupidity innocence I just hoped that deploying the application on the new JBoss (from 4.2.2-GA to 5.1.0-GA) should be just a simple matter of changing paths in ant. Here are some problems I encountered and was able to fix. application.xml The format of this file has changed from: <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"> <display-name>My application</display-name> <description>My server interface</description> ... to <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://java....

February 3, 2010 · len

JBoss and LDAP

Target: create a test environment for JBoss JAAS authentication using LDAP. Platform: Linux Ubuntu 9.10, JBoss 4.2.2.GA, java 1.6.0_15 Install and configure openldap Installing ldap proved to be the most complicated part as apparently Karmic stripped all ldap configuration from the install so all tutorials found on ubuntu site are useless. Finally I’ve found a thread which described the process. Here are the steps I followed: apt-get remove --purge slapd ldap-utils #remove all my tests apt-get install slapd ldap-utils #install fresh ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine....

December 3, 2009 · len