Using Wrapper To Run Your Application Into A Service

Last time, my friend asked me to do some research for changing our existing java application from a bat file into a windows service. He already try to done that, but the service always returning message something like “failed to start”.
So this is my quick tips to after i research for a while.
(more…)

How to install php on mac using bundle apache server

Installing php on mac is not a big deal, mostly people will do it with macport because the file hierarchy in bundle version is difference from the linux.

By default the httpd.conf file will locate at /etc/apache2/ directory.

You can open it with your preferred editor or using vi or vim if you don’t have one.

sudo vi /etc/apache2/httpd.conf

uncomment the line with words :

LoadModule php5_module libexec/apache2/libphp5.so

and save it. After that was done, now copy the php.ini.default file to php.ini. you can easily copy this script :

sudo cp /private/etc/php.ini.default /private/etc/php.ini

what the next thing to be done is create a dummy php file for testing whenever your php is running or not.

vi ~/Sites/index.php

and insert this code to your index.php file.

<?php
    phpinfo();
?>

to test it, you still need to restart your server.

sudo apachectl restart

or you can go to your “system preferences” and uncheck-check the web web sharing option.
and finally try to browse to this location

http://localhost/~username/index.php

where the “username” is your real username at your mac.

That’s it, i hope you like it..

Using camel and mina for creating socket server

In this section, i will try to introduce “apache camel” which the powerful integration framework to build an ESB for your application.
The main feature that camel have is camel can give you an easy way to implement your integration application rules.
In this example, we will use :

  • Maven
  • Spring
  • Mina

as the stack for our example application.
(more…)

Injecting spring bean to quartz jobs

Why my service always return a null pointer in quartz jobs? I was asked my self and try to do some research.

Finally, i know that the spring context and quartz was run as a different singleton context and start at the same time. That is why my service class always have a null value. Ok, now everything is clear for me. What i have to do now is injecting the service rather than made it auto wiring. (Auto wiring is also possible, you can read it at harinair blog)
(more…)

Learning Scala With Lift Framework using Maven

Hi everyone, Today i want to share about my experienced using maven to create a lift project.
Honestly, when i wrote this article, i just want to start to using scala for my future development language(in short means i’m newbie in scala). I always consider to create my projects using maven (even i just want to do some research), so just type

mvn archetype:generate

and it will show you the list of all the archetype in maven remote repository.
At my previous reading, i learn that scala has it’s own framework(similar like Java and Spring) which call lift. So i choose number 64.

64: remote -> lift-archetype-sbt_2.8.1 (-)

but careful it is not always the same number at the future, because community is moving fast so perhaps the number will change later.

(more…)

How to consume XML from RESTful Web Service using Jersey (2)

Wew.. it is a little bit frustrating from my last post about “consuming XML from RESTful Web Service using Jersey“, no one throwing any question for the null address return. But that is ok, what ever, i will continue this topic to make my reader got more understanding about JAXB marshaling and un-marshaling.

At my previous post, we was getting a null return from the AddressModel at PersonModel Class.
here is a review about the classes :
1. AddressModel.java

@XmlRootElement
public class AddressModel {

    private String street1;
    private String street2;
   
    public AddressModel() {
    }

    public String getStreet1() {
        return street1;
    }

    public void setStreet1(String street1) {
        this.street1 = street1;
    }

    public String getStreet2() {
        return street2;
    }

    public void setStreet2(String street2) {
        this.street2 = street2;
    }
}

2. PersonModel.java

@XmlRootElement
public class PersonModel {

    private String name;
    private String age;
    private AddressModel address;

    public PersonModel() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public AddressModel getAddress() {
        return address;
    }

    public void setAddress(AddressModel address) {
        this.address = address;
    }
}

(more…)

How to consume XML from RESTful Web Service using Jersey

I remember when the first time of my experiment using jersey to consume a xml, it is f**king terrible. There so many obstacle and i think it is better to share the work around with everybody here so my bad experience will be a good experience for others.

Let’s have a step by step tutorial for this problem.

(more…)

Clustering CAS 3.3.5, Jboss Cache 3.1 And Jboss AS 5.1

After sometimes to research and figuring how to make CAS 3.3.5 work with Jboss Cache 3.1 finally i could make it worked together nicely.

There so many issue to make this work became possible, and the worse things is there is no good documentation for CAS 3.3.5 to work with Jboss Cache 3.1. That is one of my reason to release this post.

Before you start this implementation, you need to read this. Those tutorial is working for jboss version 4.x and that is also the basic idea to create CAS working in Jboss AS 5.1
(more…)