java/j2ee tips and blueprints
java/j2ee tips and blueprints
It is a very sad thing that nowadays
there is so little useless information.
Oscar Wilde
multiple tomcat instance - single setup
running multiple tomcat by using a single catalina_base and catalina_home
this will make it easy to manage server management to use only one tomcat setup instance
download tomcat-6+ and unpack it.
and modify two configuration file under conf
more...
hibernate native id generator bug 3.2.4-ga
hibenate native id generator for mysql not working just update to 3.2.5
Caused by: java.sql.SQLException: No value specified for parameter 11 at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:2212) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1724) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1596) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
more...
Clustering Acegi via JGroups (DistributedHashtable)
in my previous blog I suggest to use jms or caching for a distributable SessionRegistry
but I found a more simple solution JGroups -
DistributedHashtable :JGroups gives us such a perfect simple class to distributed maps.
- All read-only operations runs on local copies
- perfect merge strategies.
- easy implementation and configuration
- vs..
more...
DistributableEventPublisher for Spring via JGroups
Messaging is really easy through a single JVM. For a distributed environments JMS is strongly recommended. but for smaller and simple projects here is and example implementation via JGroups.
Usage
DistributableEventPublisher distributableEventPublisher=….
distributableEventPublisher.castEvent(TEXT_MESSAGE/XML/Serializable);
requirements:
- springframework 2+
- JGroups 2.6.1
- JUnit (for test)
more...
light-weight distributed messaging via JGroups
JGroups is a framework that provide seamless networking utilities for java/j2ee applications. As a light-weight alternative to JMS here is an example.
more...
JGroups Basics
JGroups is a basic networking api for java.It handles all networking issues for u with very complex configuration and simple interfaces.Here are some basic introduction for JGroups
more...
for <distributable/> j2ee application
no matter what size is your application distributable should be always under consideration. otherwise it becomes a full pain full reimplementation of whole application. yes reimplementation is always good but for developers it is always painful and for customers it is always very but very expensive.
here is some key points
Model extends Objects implements java.io.Serializable
Your model objects and communication objects should be Serializable. Do not forget serialization is the most important feature. it necessary for caching,messaging,storing,…
API replacements
Every instance should be aware of its copies in cluster. so you may need some api replacements like
Map->DistributedHashtable : nice seamless implementation from JGroups.
Cache->Distributable cache: (eg:EhCache,OSCache)
Observer,Listener>JMS Queues : for whole notifications in the cluster.
Timer->Quartz distributable scheduler
more...
Complete Apache 2.2-AJP Load Balance via mod_proxy
Complete guide for apache-http server load balancing via mod_proxy and some performance enhancements
required modules:
proxy_module
proxy_ajp_module
proxy_balancer_module
more...
You can know the name of a bird in all the languages of the world, but when you're finished, you'll know absolutely nothing whatever about the bird... So let's look at the bird and see what it's doing -- that's what counts. I learned very early the difference between knowing the name of something and knowing something.
Richard Feynman