Olakunle Oladipo Oni

+ Follow
since Aug 28, 2008
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Olakunle Oladipo Oni

I know the subject of this post is not new. I could as well as titled it HTTP status 404 issue. But since I am still learning and somethings are not totally clear to me I've decided to present the title as above so that more viewers
may not ignore my post/question because obviously there will be many posts titled "HTTT Status 404 error..." and various variants of it. So if you're reading this post I'll appreciate your patience and understanding even if you
feel prompted to dismiss my issue as a common matter that i should have resolved with past posts. Let us take this as peculiar to me...I'm trying to learn about servlets/jsp following the directive of an e-book (Head First Servlets and JSP) to the letter. I"ve installed tomcat (precisely apache-tomcat-6.0.53). The tomcat install directory was place directly under C:\.This e-book taught me to do everything manually issuing command line commands to compile source file, placing the compile file in a suitable directory and starting the web server using "startup" command after changing directory to C:\apache-tomcat-6.0.53\bin. I had know problem after following the directive to start (and even stop) tomcat
web server. Let me say precisely where i am experiencing problems. The book said i should build this directory tree: ch1\WEB-INF\classes under the  C:\apache-tomcat-6.0.53\webapps which eventually gave me the  
C:\apache-tomcat-6.0.53\webapps\ ch1\WEB-INF\classes directory structure. I learnt that the directory "ch1" corresponds to the name of the web app. I placed the web.xml in the WEB-INF and placed the compiled class (via DOS prompt
command) in the classes folder. I started the tomcat server via DOS prompt (after setting directory to  C:\apache-tomcat-6.0.53\bin). To indicate the correctness of this procedure a new prompt came up indicating that the server was successfully started. I loaded my browser (Google chrome) and supplied the URL http://localhost:8080/ch1/Serv1 but the response had been the error page HTTP Status 404 (no path info...). The message section showed no message
or path information(blank) only the description section indicated that the requested resource(with no resource or path information supplied) is not available. I'll appreciate anyone showing me the missing link concerning this problem. The
relevant code is supplied below to validate their correctness..

The Servlet code

web.xml code

                                                                Olakunle Oni
6 years ago
I've been trying to run an RMI application from the client side but i've not been successful at doing that. The general concept of RMI (distributed application) is that the server side of the application registers a server object with an RMI registry. This happened successfully with my server application. I'm testing the entire application on my local system for now i.e the server and client part all reside on the same computer. I'm connecting both ends of the application by opening two command prompt side by side with the RMI registry console in between them. Syntactically, there are no problems with the programs because both successfully compiled. Infact it's a basic RMI program in which the client program calls a sayHello() method and a greeting message is returned to the client. I have a feeling that the problem is more of external to the code itself i.e. IP referencing by the system an so on. I stuck to the default port of 1099. I followed the required steps (correctly) to get the application running but when it comes to running the client end to connect to the server, i kept receiving this same message. ConnectException.....refused to host:

i followed the directives/advice i got from other forums but the error persisted. The directive i followed include
1 referencing the rmi.server.hostname env variable when running the server program
2 editing the hosts folder under \etc folder to ensure that RMI registry is indeed sticking to the localhost

The same exception persisted. I'll appreciate if someone can assist with effective advice on the way out. The application is being run on windows 7. Both the server and client program are shown below:

The client program:

Olakunle Oni
10 years ago
I cannot resolve ConnectException i'm having with an RMI application I'm working on. The client application kept giving a phrase like "connection refused to host: taking the appropriate steps such as
(1) starting the RMI registry
(2) starting the server application
(3) starting the client application to connect it with the server application.

I want to build and test the application first on my local system before doing anything further. Both Server and client programs reside in one computer and in the same folder. The OS is windows 7. what prompted my posting this is because i've tried the options i'm aware of like:
(1) referencing the system variable java.rmi.server.hostname when running the server application
(2) Editing the \host folder in my OS

I kept recieving the same error message from the client application. I'll appreciate is someone could give advice on the way out. There is no issue with compiling both programs: This application relies on the client calling the server program to send the data entered on the client side to a database:

The client app is shown below:

mport javax.swing.*;
import java.rmi.*;
import java.awt.event.*;
import java.awt.*;

public class Aclienty
static JFrame frame;
static JPanel panel,panel1;
JLabel labelAuthorID,labelLastName,labelFirstName,labelPhone,labelAddress,labelCity,labelState,labelZip;
JTextField textAuthorID,textLastName,textFirstName,textPhone,textAddress,textCity,textState,textZip;
JButton submit;
static String authorID;
static String lastName;
static String firstName;
static String phone;
static String address;
static String city;
static String state;
static String zip;

public Aclienty()
frame = new JFrame("Earnest Publishing House");
panel = new JPanel();
panel1 = new JPanel();
panel.setLayout(new GridLayout(8,2));
panel1.setLayout(new GridLayout(1,1));
frame.getContentPane().setLayout(new BorderLayout());

labelAuthorID = new JLabel("Author ID");
labelLastName = new JLabel("Last Name");
labelFirstName = new JLabel("First Name");
labelAddress = new JLabel("Address");
labelPhone = new JLabel("Phone");
labelCity = new JLabel("City");
labelState = new JLabel("State");
labelZip = new JLabel("Zip");

textAuthorID = new JTextField(5);
textLastName = new JTextField(15);
textFirstName = new JTextField(15);
textPhone = new JTextField(10);
textAddress = new JTextField(50);
textCity = new JTextField(10);
textState = new JTextField(10);
textZip = new JTextField(6);

submit = new JButton("Submit");

ButtonListener blisten = new ButtonListener();
frame.getContentPane().add(new JPanel(), BorderLayout.WEST);
frame.getContentPane().add(new JPanel(), BorderLayout.EAST);
frame.getContentPane().add(panel, BorderLayout.CENTER);
frame.getContentPane().add(panel1, BorderLayout.SOUTH);
class ButtonListener implements ActionListener
public void actionPerformed(ActionEvent evt)
JButton source = (JButton)evt.getSource();
MyDialog myDialog;
AuthorServer server = (AuthorServer)Naming.lookup("rmi://";);
authorID = textAuthorID.getText();
lastName = textLastName.getText();
firstName = textFirstName.getText();
phone = textPhone.getText();
address = textAddress.getText();
city = textCity.getText();
state = textState.getText();
zip = textZip.getText();

String str = server.insertDetails(authorID, lastName, firstName, phone, address, city, state, zip);
myDialog = new MyDialog(frame,"Inserted Successfully");
myDialog = new MyDialog(frame,"No record inserted");
catch(Exception e)
public static void main(String[]args)
new Aclienty();
class MyDialog extends Dialog implements ActionListener
MyDialog(Frame parent, String title)
setLayout(new FlowLayout());
add(new JLabel(title));
JButton buok = new JButton("OK");
public void actionPerformed(ActionEvent evt)

The server app is shown below:

import java.rmi.*;
import java.rmi.registry.*;
import java.rmi.server.UnicastRemoteObject;
import java.sql.*;
import java.sql.Connection;

public class AuthorServerImpl extends UnicastRemoteObject implements AuthorServer
static ResultSet result;
static Connection con;
static PreparedStatement stat;

public AuthorServerImpl() throws RemoteException
public String insertDetails(String authorID,String lastName,String firstName,String phone,String address,String city,String state,String zip) throws RemoteException
int rowsAffected = 0;
String sReturn = "fail";

con = DriverManager.getConnection("jdbc:mysql://localhost:3306/publishing","thepubs","eansbok");
stat = con.prepareStatement("insert into authors(AuthorID,Last_Name,First_Name,Phone,Address,City,State,Zip)values(?,?,?,?,?,?,?,?)");
stat.setString(1, authorID);
stat.setString(2, lastName);
stat.setString(3, firstName);
stat.setString(4, phone);
stat.setString(5, address);
stat.setString(6, city);
stat.setString(7, state);
stat.setString(8, zip);
rowsAffected = stat.executeUpdate();
if(rowsAffected > 0)
sReturn = "success";
catch(Exception ex)
System.out.println("Error at value insert" + ex);
return sReturn;
public static void main(String[]args)
System.setSecurityManager(new RMISecurityManager());

AuthorServerImpl instance = new AuthorServerImpl();
Naming.rebind("Authorserver", instance);
System.out.println("Server Registered");

catch(Exception ey)
This code was actually adopted from an NIIT Manual that i had wayback 2006 when i was a complete newbie to java. Now i intend trying out the RMI samples i have in the manual. But i feel there is something i'm missing. I'm not sure if there should a restructuring of this code due to API enhancements or anything else. I'm appreciate a rapid response...

Olakunle Oladipo Oni
10 years ago
A beautiful day to someone out there. Please i'll appreciate someone to give an assistance on how i'm to resolve a problem involving connecting a desktop java application to a database. I had no problem connecting from the application
when it's loaded using the java command line utility. I was able to carry out the necessary processes like insert, delete, update and retrieve from the desktop java application if i loaded using the command line. I transferred the application to my netbeans editor, ran it and it loaded successfully as well. But i sense a logic error somewhere because when i tried inserting data using the destop java application form i kept recieving the message 'No suitable Driver found'. I checked the 'services' window in netbeans, i discovered that a mysql connector/J driver is already bundled with the IDE (Precisely in C:\Program Files\NetBeans 6.5\ide10\modules\ext\mysql-connector-java-5.1.6-bin.jar) because i saw it the drivers node i believe it is added and registered with the IDE already. The version of the connector/J driver i used previously that the program was assessing successfully is mysql-connector-java-5.1.19-bin.jar and i had it in drive C. I had the classpath system variable path for the driver (BOTH THAT FOR THE NETBEANS INSTALLATION PATH and that of the version i used successfully earlier) in place. I kept having the same response of not seeing the suitable driver from within the netbeans IDE. I'LL appreciate if someone can help to point out where the problem is and how to resolve it.

Olakunle Oni
11 years ago
Of recent i developed a basic reservation application for a number of transportation systems. I could get the date and time of the reservation and other requirement of the application. What i actually want from this post is for some one to give me a tip on how to go about making the application check the number of users that can make a reservation beyond real time. I mean if the application can been programmed such that only twenty people can make a reservation ( by entering their details in a form) the program should be able to keep track of the number of users even after the program as stopped running ( like shut down till the next day) for sometime. I want a situation such that the program can still check from the present count when loaded again. I precisely want the medium where the data will be checked and maintained to be a text file and not necessarily a database ( if the answer can address that of database storage, i'll appreciate it as well). I'm interested in seeing this happen with a desktop application. I just interested in someone assisting with the specific java package that can do this. I'll appreciate sample codes to highlight the answer.

olakunle oladipo oni
11 years ago
I want to be clear about using the netbeans IDE to implement java EE solutions. I’ve been getting myself acquainted with JAVAEE technologies in recent days and from my findings, I’ve discovered that it’s a good medium to start with. I have basic knowledge about how the IDE operates but I’ll appreciate if someone can clarify (giving practical steps on the basis of the IDE) on the issues I will raise about how to organize my codes for JAVAEE solutions on the netbeans IDE.
I want to create a basic web application and possibly try out others to gain expertise with JAVAEE solutions using the netbeans IDE. I intend to start with servlets before proceeding with JSP. The question I’m raising is based on a recent solution I tried to implement using netbeans.
(1) Firstly, how do I create a netbeans project that constitutes only a servlet and an associated resource like an html page with no index.jsp template. I want a basic application in which a user enters an employee ID from the HTML front end and the servlet on the basis of the supplied ID retrieves the employee data from a database and displays it. I have code for these web components (including database access) but I’m not very clear about implementing it on netbeans. Why I’m asking this question is because I feel the index.jsp within the project I created is interfering with the servlet file.
(2) A dialog came up in the process of creating the servlet file suggesting I (may) supply initialization parameters. I’ll appreciate if someone can highlight on how the supply of initialization parameter is applicable to the problem presented above and how (and in which context) I’m to supply these parameters in netbeans for solutions in general.
(3) The issue of URL mapping isn’t totally clear to me as well. I’ll appreciate a clarification of this issue with respect to the present problem and how to implement this in netbeans. With a clarification of these fundamental issues I believe I should be good to go with other problem solving ventures in the domain of servlets before going into JSP which I’m aware is based on servlet technology.

Olakunle Oni
Building, packaging and deploying java web components from netbeans is unclear to me. Let me give some background information concerning my attempts at achieving this processes. I'm a hands on learner and i've learnt many things this way. But i sense that it can be needless trying to clarify this issue myself at this juncture. I recently installed the glassfish version 3 web application server. Typical of software installations like this, a documentation accompanied it and i believe (to a reasonable extent) i followed the instructions in getting the required software set. The Javaee 6 tutorial that came with the installation directed me to a two directories precisely:
C:\glassfish3\glassfish\docs\javaee-tutorial\examples\web\hello1> The "hello1" directory contains jsp web components
C:\glassfish3\glassfish\docs\javaee-tutorial\examples\web\hello2> The "hello2" directory contains servlet web components

I followed the directive as stated in the tutorial (to the best of my knowledge) at building,packaging and deploying these sample web components, but i sensed a clog in the wheel of progress somewhere. These are the steps i followed(as directed from the tutorial) but where i discovered there's a problem somewhere:
(1)With the netbeans IDE loaded, I was directed to click on File-Open project i did this
(2)In the open project dialog i was to navigate to C:\glassfish3\glassfish\docs\javaee-tutorial\examples\web\ i did as well
(3)I was to select the "hello1" folder i did
(4)The next step was to "Select the open as Main Project check box" This is the point i felt something isn't right.
In the "Open project dialog", the textfield under the "Project name" area showed the message <unregonized project; missing plug-in?> The "open as main
project area" was inactive and uneditable. There is no point projecting to the next two steps which had to do with clicking the "Open Project" button and going
to the projects tab, right-clicking the hello1 project and selecting "build".
I"ll appreciate somebody giving me straight answers at resolving the issue of building, packaging and deploying java web components from netbeans. I dont
need reference to materials anymore (I've seen much, though i still go through other sources once the knowledge of the fundamentals is clear). One issue i
believe that's closely connected to this is how to organize the directory structure with respect packing of the software components. I'm not totally a novice to
netbeans but i'm very unclear (at least at the moment) about how to organize the directories where this component or that component should be with respect to
netbeans. For example if i'm to make a new project of the sample programs of the tutorial what will should be the correct project location with respect to netbeans. Will it be C:\glassfish3\glassfish\docs\javaee-tutorial\examples\web and the project folder be C:\glassfish3\glassfish\docs\javaee-tutorial\examples\web\hello1> I tried something like this, i still wasn't getting the expected. In a nutsell, can i set a different directory path in netbeans for web components having
another path on my file system? How can i successfully, build, package and deploy web components set in a directory path different from that set in net beans. does the net beans system of setting directories correlate with that on my computer. I believe the clarification of this issues will be the key to my understanding the netbeans IDE. On a final note, the concept of the "main" project and sub-projects in net beans is unclear to me at the moment. Does that mean i dont have to
create a new project for every class i write? Does it mean that in a single consisting of many classes, the main class represents the main project and the class that are composed in the main class the sub-projects. I'll be very glad to have straight answers to this rather multiple questions.

Olakunle oladipo oni
Mr Wong

In response to the reply of my topic "super keyword and packages" which you gave on the 08, April 2012, I would say i appreciate the reply. I would have appreciated more people baring their mind on the question and this hopefully could have supplied more answers. There are some parts of my question which your answer didn't address. One thing i wanted to get clearly was if the subclass gets initialized with different values (for the instance variables) from that of the superclass by calling super(a,b); assuming access level of these two variables from the superclass isn't private. Though the parameters supplied in the subclass constructor is local to the constructor, is that enough to initialize the variables differently from that of the superclass or does the value supplied by calling the subclass constructor become that of the superclass as well? I wouldn't want you to mind my seemingly over flogging the topic but try give me a comprehensive answer. Since you are the only one who gave answer to this topic, i deem it fit to send you this reply. Hoping to hear from you.

olakunle oladipo oni
11 years ago
(1) I asked a question concerning the super keyword a week earlier but answer was not satisfactory. One of the reasons i guess was the way the question was presented. I'll be as clear as i can be at the moment and i'll appreciate someone's patience in giving me a detailed answer (as can be possible) to the question that will be raised. I'm aware that the super keyword is a way for the superclass part (the superclass constructor) of a derived class to be initialized. So it is the first required statement after the constructor declaration of the derived class. This idiom takes the typical form:

Now i'll make some propositions/analysis concerning the above code snippet in the light of my present understanding and raise my questions as well. If anything sounds invalid from my propositions/analysis i'll appreciate a corrective response as addition to the given answers. Firstly according to the code the parameters 'int a and int b' became a part of the derived class contructor by virtue of inheritance and access control of the superclass. Is the derived class contructor declaring its own version (copy) of the instance variables (from the superclass) or simply referencing what's already present in the superclass? If the variables had a 'private' access control in the superclass can they still be declared/referenced in the derived class constructor even if the derived class doesn't have access to them? My understanding of the super keyword is as a means of initializing the superclass contructor. Is it really the superclass intializing itself or the subclass doing the initialization since the value passed when the subclass contructor is called is passed to the superclass constructor via super(a,b);? If the value passed as arguments to the subclass constructor is transferred to the superclass constructor via super(a,b); i.e. (If this is correct) Then the subclass and superclass should have the same values for these variables . What if i want the same variables to typically be initialized differently for the superclass and the subclass? The crux of all the questions is that if the my my superclass gets initialized by calling super(a,b); is the subclass sharing the initialization or does it really need to have its own initialization for the same set of variables?. I'll appreciate a clear cut answer.

(2) I'm aware that packages a namespace implementation mechanism to prevent clashes with class names. I'm also aware that package names map to directory path. I want in a concise explanation with a reality scenario as a reference point how a name clash from classes of different packages may occur. Assuming I've created classes/interfaces in package myfiles.ex.yz which map to myfiles\ex\yz folder path on my computer (the classes/interfaces are actually available in the yz folder). How do i make this package available to another programmer via the web? Must the folder structure be published as it is? How can another programmer access my package on his computer. I'm appreciate a practical answer. Will a programmer download a path of folders and what directory will be ideal to place this directory path. My default directory (where my jdk utilities reside) follows the following path c:\Program Files\Java\jdk1.6.0_24\bin and it is in this same directory that i have the \myfiles folder that start my package structure. Recently i wanted to run an applet demo( that came with the jdk) from this directory path using the command prompt: C:\Program Files\Java\jdk1.6.0_24\demo\applets\TicTacToe The appletViewer command did not work. I need clarity on how to set environment variable for paths on my system through the advanced settings tab. One final question, where can i actually locate the standard and extended java class library (That's usually imported)
on the file system of my computer?

Olakunle Oladipo Oni
11 years ago
(1) I wrote a java program involving the use of the FileInputStream class to read from a plain text and executable file. As expected, being a byte stream, the
generated result was a series of integers representing the individual bytes read from the stream. The sample results look like this:

49 43 182 0 23 54 4 178 0 20 187 0 11 89 21 4 184 0 26 183 0 16 18
......................and so on. The integers spans rows. I use my program to determine the byte count. Of course i know if I'm to read the plain text file and
view it as it really is i.e. see the text in the result i should use a FileReader character stream. My concern for this question is not character streams. I'm
interested in knowing how the individual bytes got resolved into integers of varying ranges. I'm aware that byte data type have a range of 0-255 for unsigned
integers and that's why non of the output integers exceed that range safe for the -1 integer value that marks the end of the file. Most interestingly, the numbers
of the integers exceeds the number of words making up the plain text. How did the integers of varying ranges came to be? Are the individual integers a result of
each individual character of the text. Is there a provision for the spacing between the words that make up the text. What are the zeros in the outcome
representing? I'll appreciate a clear explanation.

(2) One of the established rules of implementing proper object formation via inheritance is to make a call to the superclass constructor the first statement
after defining the subclass constructor. Something i want to get clearly is that, if the superclass portion of my subclass object get initialized via call to
super(a,b); does this actually translate to the automatic initialization for this instance variables for the subclass portion of the code even if this variable
have private access in the superclass? If the subclass constructor is used as a means of initializing the superclass portion of the code, is the subclass
constructor actually initializing itself with these values as well since it has access to the variables by inheritance? Is it typical that the superclass and subclass
constructors can intitialize themselves differently (with different values) for the same kinds of attributes(variables)? I'll appreciate a clear answer to this
question putting into consideration the access level from the superclass.

Olakunle Oni

11 years ago
The term "Java keywords" and "Java reserved words" to me seem to be used synonymously sometimes. What is the real difference between them? What makes a word "reserved" and not still considered a "keyword". Or can the two words apply in most instances?I'll appreciate a clear cut explanation with examples from both sides using the Java programming language as a reference point.

Olakunle oladipo oni

11 years ago
Of recent I've been undergoing some program design in the area of swing to acquaint myself with java's GUI capabilities. What I'm working at is with the basic intent of practicing to lead to competence and consequently create a basic application. The idea behind the application is a simple one: the components of this application are three. They include, a JFrame and two JDialogs. All three compiled without problems but one of the JDialog that serves as a child to the first did not show up as a result of the event that should have generated it from the first. The application is to make a basic calculation (addition) of a parameter like say 'salaries' from the first JDialog and on clicking the JButton 'ADD', a string displaying an aggregation of the result is expected to be appended to another JDialog emanating from the first. I'll be pasting the source code of both Dialogs on this page. I'll appreciate if someone can help me to figure out the problem and provide the clue. The JDialog that should give the final result didn't show ...I discover that to the appraise the problem better all the code should be pasted here. JFrame code is simply an authenticating code. I had no problems with that... I'll appreciate explanations is need be...

olakunle oladipo oni
12 years ago
I need someone to give insight concerning the listed key phrases in the 'subject' field. I'll appreciate a clear answer from anyone...

(1) The java utilities can be found in the default directory which on my own computer is the \bin directory. On installing the jdk, in which part of the directory structure resulting from this process can i find the standard and extension libraries? As an analogy, anytime i make a package, it assumes a directory path that is traceable on my computer and when i'm using the 'import' statement the directory structure comes to bare. I want to locate the directory path of the standard and extension packages of the java platform. How can this be done?

(2) If someone has written a number of java programs and placed them in packages and wants to direct it to a friend to use across the atlantic. How does he really do this? Does he send directory structures directly or as a form of bundle. Does it make sense to send it as an attachement via an e-mail facility? Or are there websites for this? If someone directs a package to me, what will an appropriate directory to save it in other to make use of it?

(3) I saw in a manual that to set the environment variable in a windows 95/98, the 'set classpath' line is added to a part of the autoexec.bat file on this kind of system while on the windows 2000/NT/XP i learnt that this can be done through the control panel. I checked the environment variable on the control panel but didn't see anything reflecting the default directory or other directory paths associated with the java platform on my computer (maybe i've not checked the right places). How can i set classpaths from the control panel since my computer runs on windows xp?

olakunle oni
12 years ago
Hi and a beautiful day to someone on this forum. I'm throwing some questions to the open and i'll really appreciate somebody's patience. My question isn't one but a number of them. I just believe we have one thing to learn (however simple) from time to time...

(i) I've created an application program in java. How can i or somebody else run it just by the click of a button i.e without necessarily utilizing the command line utility? I'll appreciate clear answers...

(ii) How can i package my java program in such a way that users can install it on their computers via a cd or storage medium just like most of us install other developed software? Of course, as a pointer to the first question, I'll want it to be run by the click of a button.

(iii) In what particular instance of program design should a do-while construct be appropriate at the expense of the while construct. I'll appreciate if practical instances are given to this question. Is there really a significant difference to using any of these constructs other than just the time in which a construct is accessed in a running program?

(iv)Do i really need the application of stream class and the system class to create an application that can be executed via the command line in which i can input numbers one at a time by pressing 'enter' and incrementing the additions and carry out basic calculations like summation or averaging? In a nutshell, how can i carry out this basic calculations from the command line with a number at a time?

(v) What is the significance of the root directory from the context of the command prompt?

(vi) When the phrase ‘java-enabled browser’ is said in java courses, can the phrase be taken
literally i.e does it mean the browser is actually empowered by java or the other way round. In
other words does it mean that the java interpreter is just a component of the browser software
that is activated once the browser is up and running. This question may appear simplistic but I
just want to be clear.

Olakunle Oni
12 years ago
I appreciate your response. This is the advantage of forums like this. I just saw something i overlooked...
12 years ago