And Todays’s Quote Would Be..

Life begins at the end of your comfort zone.

Neale Donald Walsch

How To Fix Glassfish’s Exception “only one instance running in the cluster”

Recently ive met a new exception on my Glassfish 3.1 log file, here is the complete stack trace

[#|2014-10-09T13:22:09.248+0700|INFO|glassfish3.1.2|
org.shoal.ha.cache.command.load_request|_ThreadID=301;_ThreadName=Thread-2;|
Skipped Loading of 396544c17b8bbbc620000f9b2196 since there is only one instance running in the cluster.|#]

Because of this error, somehow im unable to do a session failover on my Glassfish.

Using asadmin get-health show that my instance are both healthy and alive

glassfish3>asadmin get-health
Enter the value for the clusterName operand> cluster1
instance1 started since Thu Oct 09 16:43:21 ICT 2014
instance2 started since Thu Oct 09 16:45:40 ICT 2014
Command get-health executed successfully.

but both instances started not at the same time.

So what i do is very simple, i restarted my cluster so both of my instances started at the same time. And somehow, my error is gone and i can do failover seamlessly.

restart glassfish cluster

Google+

A Weird Error At Glassfish, “Class [ java/lang/AutoCloseable ] not found.”

Today i’ve found a very weird error on my Glassfish 3.1, here is the complete stack trace

[#|2014-10-09T10:54:02.685+0700|SEVERE|glassfish3.1.2|global|_ThreadID=24;_ThreadName=Thread-2;
|Class [ java/lang/AutoCloseable ] not found. 
Error while loading [ class com.edw.dodol.service.MyService ]|#]

Im using SpringMVC and the error affect all my service classes, so somehow my application is unable to start.
After trying several solution, i found out that my JAVA_HOME variable are still pointing to a JDK6 version, while my application need at least JDK7.

Changing my JAVA_HOME variable into JDK7 solve this issue.

A very weird error actually, usually running an application under a different SDK version will create a “Major-Minor Version Exception”, but somehow i cant see that error anywhere :-(

Google+

Creating A Simple HTTP GET Request Using Mule ESB

It is the first time im using Mule ESB, so im trying to create a simple tutorial using it.

In this tutorial, im trying to do a simple GET request. But first, a simple POST request for comparation.

<expression-component doc:name="Expression"> 
	<![CDATA[
	sendFields = new java.util.HashMap();
	sendFields['aaa']='1';
	sendFields['bbb']='2';
	
	payload = sendFields;]]>
</expression-component>
<http:outbound-endpoint exchange-pattern="request-response" 
			method="POST"
			address="http://192.168.0.1/" 
			contentType="application/x-www-form-urlencoded"
			doc:name="HTTP" />

Looks very simple, create a simple hashmap, send it through http outbond using POST method.
While this is my code for GET method

<http:outbound-endpoint exchange-pattern="request-response" 
			method="GET"
			connector-ref="NoSessionConnector" 
			address="http://192.168.0.1/?aaa=1&amp;bbb=2"
			contentType="text/html" 
			doc:name="HTTP" />

So instead of pushing my parameters via hashmaps, i add them directly on my url.

Google+

Changing JBoss 5 Admin Console Username and Password

JBoss 5 Admin Console username is very default, it is admin and admin. Therefor i am trying to change it to increase the security of my jboss application.

I thought that it is very easy to change the password, but apparently it not. I need to manually change the content of a properties file instead of a simple change password form.

Okay, so basically i need to change the content of jmx-console-users.properties file, which located at

<JBOSS_INSTALLATION_FOLDER>/server/default/conf/props

jboss console

you will see, admin=admin. Changing it, will change the username and password needed to login into jboss admin console.

Hope it can help.

ps.
thank you to my friend, Molly Nella Septiandini who have helped me solved this issue ;-)

Google+

Fixing Jasper Report Error, “Font ‘Arial’ is not available to the JVM.”

Yesterday, i had a weird error when deploying to my Red Hat machine. Somehow my pdf generated report is throwing exceptions, it said “Font ‘Arial’ is not available to the JVM.”. A little bit weird since on my development machine, everything is running well.

After i run this command,

fc-list | grep "Arial"

I found out that “Arial” font isnt installed on my RedHat server, a little bit tricky due to im unable to run “yum” command because the server is behind a network firewall. So my workaround is download a .rpm, and installed it manually. After several minutes googling, i found a very recommended .rpm installer.


http://www.mjmwired.net/resources/mjm-fedora-f11.html#ttf

I installed it using

 sudo rpm -ivh msttcore-fonts-2.0-3.noarch.rpm

And check my installed fonts

fc-list | grep "Arial"

Now i can see “Arial” fonts on my list of installed fonts on RedHat, restart my tomcat and my pdf reporting is running well again.

Here is the complete stacktrace of the error,

21:57:12,135 INFO  [stdout] (AsyncLogger-1) <2014-09-29 21:57:12,131>,[http-/0.0.0.0:80-94]>>[ERROR]Font 'Arial' is not available to the JVM. See the Javadoc for more details. net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Arial' is not available to the JVM. See the Javadoc for more details.
21:57:12,135 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fonts.FontUtil.checkAwtFont(FontUtil.java:357)
21:57:12,135 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.loadFont(SimpleTextLineWrapper.java:369)
21:57:12,135 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.getGeneralFontInfo(SimpleTextLineWrapper.java:339)
21:57:12,135 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.createFontInfo(SimpleTextLineWrapper.java:279)
21:57:12,135 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fill.SimpleTextLineWrapper.start(SimpleTextLineWrapper.java:241)
21:57:12,135 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:537)
21:57:12,136 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:623)
21:57:12,136 INFO  [stdout] (AsyncLogger-1) 	at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:699)
Google+