When there are lot of classes to be loaded, we may come across this error;
Solution is simple;
Open \jboss-4.2.0.GA\bin\run.conf and update as follows;
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS=”-Xms256m -Xmx1024m -XX:MaxPermSize=512m -Dorg.jboss.resolver.warning=true
-Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000″
fi
That will fix the issue.