September 2014 Posts

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+