Category Archives: Enterprise Java

Handling deprecated warnings in Apache’s HttpClient and HttpParams

If you encounter deprecation warning in Apache common HttpComponent 4.3 and above, here’s an example how to fix this. This would be the old, deprecated code: And this is the same code block, accommodating the new Builder pattern: A more … Continue reading

Posted in Enterprise Java | 2 Comments

MySQL reconnect issues or ‘The last packet successfully received from the server XX milliseconds ago’ errors

If you encounter problems with stale connections in your pools after long period of inactivity, like this for instance: 2013-07-18 08:40:21,671[ERROR,JDBCExceptionReporter] The last packet successfully received from the server was 50,286,413 milliseconds ago. The last packet sent successfully to the … Continue reading

Posted in Enterprise Java | Tagged , | 2 Comments

Getting rid of CLOSE_WAITs in Tomcat 6/7 with mod_proxy

If you happen to have operate an application iwth long request / response cycles and you experience pile ups of CLOSE_WAITs, you should consider the following: a) redesign you application. If possible, try to detach processes asynchronously, by using threading, … Continue reading

Posted in Distributed Computing, Enterprise Java, Uncategorized | Leave a comment

Joda DateTime in Hibernate Queries and JPA Entities

If you use JodaTime in a JPA Entity, you’ll need to observe the following things: 1) Your Entity member should declare the following annotations: @Column(name = “cutoff”) @Type(type=”org.joda.time.contrib.hibernate.PersistentDateTime”) @Getter @Setter private DateTime cutOff; 2) If you want to query that … Continue reading

Posted in Enterprise Java, Uncategorized | Tagged , , | Leave a comment

Issues while migrating from Jetty to tomcat 7

If you use Jetty for development of web apps and have to deploy to a tomcat 7 container, you’ll probably get some unpleasant error messages on start up, especially if you use JSTL. One of these issues might be: SEVERE: … Continue reading

Posted in Enterprise Java | Leave a comment

Resolving HornetQ issues with two JBoss 6 instances in one network

If you have the following warning in your JBoss 6 logs: [quote] WARN [org.hornetq.core.cluster.impl.DiscoveryGroupImpl] There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node … Continue reading

Posted in Distributed Computing, Enterprise Java, Uncategorized | Tagged | 5 Comments

Migrating to JBoss 7

For those who have an existing JBoss 4/5/6 installation, migrating to JBoss 7 will take slightly more time, as the new archicture of JBoss has a completely new directory layout and configuration mechanism. For starters, you should set up your … Continue reading

Posted in Enterprise Java, Uncategorized | Tagged | Leave a comment