Wednesday, May 27, 2009

JBoss -- Memory configuration

In the jboss server , if out of memory exception ,then configure the following in
jboss/bin/run.conf file,

if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-Xms512m -Xmx1024m -XX:PermSize=512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
fi

Friday, May 22, 2009

String array to java.util.List

Convert a String array to list,

String array[] = {"jijo","mathew"};
List list = Arrays.asList(array);

Thursday, May 21, 2009

Convert String to Blob and Blob to String

Convert String to Blob

String data = "hello world";
java.sql.Blob blob = org.hibernate.Hibernate.createBlob(data.getBytes());

Convert Blob to String

byte[] bdata = blob.getBytes(1, (int)blob.length());
String data1 = new String(bdata);

Thursday, May 7, 2009

Access JBoss application using IP address

Take the command prompt and change the the control to the joboss/bin directory
then,
run -b yourip

eg:
run -b 192.168.0.109

Then u can access the jboss applications using the ip.
eg: http://192.168.0.109:8080/applicationname