Skip navigation

Monthly Archives: January 2009

See you Lufthansa Systems, thank you so much for great moments… 🙂

Welcome PT. Aero Systems Indonesia, let’s build this company… 🙂

Updated 10-05-2010:
Currently i’m not working here anymore. It’s just me, not the company.


Refer to this link to prepare the instalation. Follow every steps mentioned. Here is the steps:

  1. Install openSUSE 11.0 with “C/C++ Development” selection.
  2. Download and Install orarun package. Enable and set password for newly created user oracle by orarun.
  3. Change some environment variables – ORACLE_HOME, ORACLE_SID, TNS_ADMIN in /etc/profile.d/
  4. Set updated kernel parameters by executing /etc/init.d/oracle start or rcoracle start.
  5. Download and extract Oracle Oracle 11gR1 SW.
  6. login as user oracle and run Oracle Universal Installer “database/runInstaller“. Just follow step by step questions of Oracle installer.

On my experience the setup isn’t working after I try to login (from console) as “oracle” user and start installation (step 6).
The orarun setup create “oracle” user as “System Users” not as “Local Users”, so i decide to delete “oracle” user and make the user manually from Yast –> Security And Users –> User and Group Management. Set Default Group to “oinstall” and additional groups to “dba” and “disk”.

Add user 1 Add user 2

Note: Do not create user from console (using useradd command), the created user not registered with X Server (and i dont know how to register user with X Server 🙂 ), caused failed when try to start installation.

After “oracle” user is created, login as “oracle” user from console then start installation by typing “./runInstaller”. Just fill every required information, and keep press next or press yes if there’s prerequisite check warning, until installation is finished. After installation is finished we can browse to oracle database using Oracle Enterprise Manager Database Control using address https://%5BHOST_NAME%5D:1158/em

Installation Screenshot
oracle01 oracle02

oracle03 oracle04

oracle05 oracle06

oracle07 oracle08

oracle09 oracle10

Starting Oracle database after Reboot/Restarting
Oracle 11g database is not automatically started when we turn on computer/laptop, this is steps to start oracle database:
1. Open console, login as “oracle” user

2. login to sqlplus, then type “STARTUP” to start database.

3. Exit from sqlplus (type “exit”)

4. Start Oracle Net Listener, type “lsnrctl start [LISTENER]”

5. Start Oracle Enterprise Manager Database Control service, type “emctl start dbconsole”

Oracle Enterprise Manager Database Control Screenshot
oem01 oem02oem03

– Extract tar.gz files
> tar –xvzf FILE_NAME.tar.gz

– Compress to tar.gz

– Extract tar.bz2 files
> tar –xvjf FILE_NAME.tar.bz2

– Compress to tar.bz2

– Start/Restart network
> /etc/init.d/network [start|restart]

– Force kill process
> kill -9 [PID]

– Show services/process
> ps aux

– Show services/process with filter
> ps aux | grep [FILTER]

> ssh [USERNAME]@[HOST/IP] <enter then enter pasword>

– Change files or folder owner (must as root)

– Change folder owner and it’s subdirectory (must as root)

– Start Mysql service on openSuse 11
> service mysql start (as root)
then type “mysql” to login into Mysql

– SCP , transfer files over network
(for single file)
(eg. “> scp Twilight.avi root@“)
then enter destination password.

(for directory with multiple files)
(eg. “> scp –r Movies budi@“)
then enter destination password.

Other samples:
“> scp –r budi@ .” , will copies “SexyImage” directory from user “budi” at “” to our current directory. We need to provide user “budi” password.

– Remove folder
> rm -rf FOLDER_NAME

I use Glassfish for application server. Here is the EJB:

package ejb3.bean;
import javax.ejb.Remote;

public interface HelloEjb {                                        
    String printHello(String name);


package ejb3.bean;
import javax.ejb.Stateless;

@Stateless( name="HelloEjb")
public class HelloEjbBean implements HelloEjb {
    public HelloEjbBean() {}

    public String printHello(String name) {
        return "Hello bro " + name + " welcome to EJB 3";

Package it as JAR or EAR, start Glassfish( GLASSFISH_HOME/bin/asadmin start-domain DOMAIN_NAME ) then use Admin Console (default: http://localhost:4848 ) to deploy the EJB.

To call the EJB from servlet we can directly use @EJB annotations, to get the instance of the EJB. In below sample i send the EJB to JSP page:

package ejb3.servlet;

import ejb3.bean.HelloEjb;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.ejb.EJB;

public class HelloEjb3Servlet extends HttpServlet {
    private HelloEjb helloEjb;

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException
		execute(request, response);

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException
		execute(request, response);

	private void execute(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException
        	request.setAttribute("helloEjb", helloEjb);
        	request.setAttribute("printHello", helloEjb.printHello("Djunaedi"));
        	request.getRequestDispatcher("/HelloEjb3.jsp").forward(request, response);                            

To get EJB instance in JSP using @EJB (inside scriplets) isn’t working, i get null instance. So i use JNDI lookup and that’s work:

<%@ page import="ejb3.bean.HelloEjb" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="javax.naming.Context" %>
<head><title>Hello EJB 3 !</title></head>
HelloEjb helloEjb;
try {
Context context = new InitialContext();
helloEjb = (HelloEjb) context.lookup(HelloEjb.class.getName());
catch(Exception e) {
// exception code here
Object HelloEjb Directly : <%= helloEjb %><br>
Print Hello : <%= helloEjb.printHello("Ujang") %>

Object HeloEjb from Servlet : <%= request.getAttribute("helloEjb") %><br>
Print Hello : <%= request.getAttribute("printHello") %>

Calling EJB 3 using JNDI lookup isn’t the same between Application Server, JNDI lookup name is not standardized. Refer to this article find out more.