Javini Javono

Ranch Hand
+ Follow
since Dec 03, 2003
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 Javini Javono


I know that the following "pull" scenario works, it is a
form of polling, and fits into the standard request/response
communication of a servlet web application:

1. Java Applet or Application on the client responds to the user clicking
on a JButton.
2. The Applet/Application communicates over the intranet
to a specific servlet, MyServlet, sending it the appropriate
3. MyServlet carries out processes, such as reading or polling
the database, for any change of state.
4. MyServlet sends back a binary response to the client Applet/Application.

However, if I have many clients, it may be undersirable for them
each to continually poll the server's database to determine if there
has been a change of state by using MyServlet.

Can server-side Java objects or Java-related technologies be used
to push information to the client's Java application? For instance,
some other use-case changes the state of the database, and now the
server wants to notify the client Java applications of the change in state.

Solution 1
One way for this to be done is for each client Java application to set up
a small, RMI server on the client so that client objects can be remotely called.

Are there any other technologies besides RMI that might be used?
Feel free to use buzz words (I would then have to take the buzz word
and research what it means, for as of now I am not familiar with
web services, for example).

Javini Javono
19 years ago

I know the last implemented version of Java for Mac OS 9 is Java 1.1.8.
Is there any way to use Swing with it? What should I be aware of?
Are there any caveats/compatibility issues?


It is my understanding that on Windows at least, JRE 1.1.8 does not
come with Swing, and in order to use Swing for JRE 1.1.8 you need
to download a separate .jar file with the appropriate classes in it.

So, I speculate that on a Mac, JRE 1.1.8 also does not support Swing.
I further guess that Apple did not write the Swing classes and
place them in a separate .jar file to run with JRE 1.1.8.

Given the above, to run Swing, you probably need to be in Mac OS X.
Also, it is my general understanding that Mac JRE 1.1.8 is not very
stable, so that would be another motivation to update to Mac OS X
and use JRE 1.4.

Javini Javono
19 years ago

Okay, so as mentioned above, this is the file in JBoss I changed:

which, if I recall correctly, one does after installing the JRE version
1.4.2 (I think) which is part of the standard updates (not part of the developer

Note that I have not yet ever started JBoss, but here is my run.conf
file at this time:

As far as I know I followed the directions as given by Apple's web
site; but, please remember that I have not yet started JBoss
ever on my computer at this time.

Javini Javono

[ November 21, 2004: Message edited by: Javini Javono ]
[ November 21, 2004: Message edited by: Javini Javono ]
19 years ago

Here's an update on how I got Tomcat to run on my mac.
First I downloaded all the recent stuff (which may or may
not be a requirement); so, I installed XCode Tools 1.5
and then Java 1.4.2 Update 1 Developer Tools.

Then I went to the directory

and issued this command:

sh -v startup.sh

Then I went to my Safari browser and placed in this


and the default page came up as expected.

The only thing which fooled me was that I always thought
that the default port for Tomcat was 8080, and that may
have been why I could not get Tomcat to function.

Finally, I did make one other change though I cannot say
that it is critical for Tomcat alone or if it is critical only
if you use JBoss: it was a writeup at apple about what
happens after you install JRE 1.4 and how you need to
change a line within a JBOSS file, but I don't have the

Javini Javono
19 years ago

I did install the developer stuff. So perhaps that is why there were folders
and files out there related to JBoss, for example. Here is an example hit
for a file and folder search on "JBoss":

Macintosh HD/Library/JBoss/3.2/client/jboss-client.jar

Javini Javono
19 years ago

I have Mac OS X 10.3.6 up and running. I have never installed
any software to support studies in J2EE (including EJBs), DB with MySql,
or servlets and jsp pages. Yet, it seems that quite a lot is
already installed on the computer which is a Mac PowerPC G4.

The reason I say that it seems that quite a lot of stuff is already
installed is that when I do a search, for instance, on "JBoss"
or "MySql" or "tomcat" I get plenty of hits.

Is it true that J2EE support and MySql support is already a part of
the operating system (or more accurately, the web or application
server) without me having to install anything?

My next question would then be, okay, what switch do I turn on
to make it all start operating? For this, I'm currently hunting
through http://developer.apple.com/internet/

Javini Javono
19 years ago

There are a lot of exceptions that can occur in the two phases of the
project: (1) connecting to the database, opening the database file, or
both, and (2) using the data access connection to read and write the

There are very intelligent and experienced individuals who have weighed
in that there were too many exceptions in one of the examples above.

Also, there are basically two different strategies: (1) where run-time
exceptions are predominantly thrown, and (2) where checked exceptions
are predominantly thrown.

I'll address the case where checked exceptions are predominantly thrown.
And, I'll address the case where we are attempting to open the database
file. There are many errors which can occur, and each specific case when
reported to the user in English allows the user to take action to attempt to
address the error. Therefore, I am inclined to recommend that each
individual exception be thrown; also, that these individual exceptions, for
the most part, be part of a hierarchy of exceptions, so that the client
programmer is free to catch a more general exception type. But for that
client programmer who needs to convert the exception to English, throwing
the more specific exceptions may be better. Of course, one might say that
the exception, when thrown, already should have English text describing
exactly what the exception is, and under this case, the client programmer
might not need to catch each individual exception, but could catch a super
class. [An interesting case would be what would happen if the exception
message in "English" had to handle an audience which may speak "French",
or "Italian" or "Russian"; would this change the answer to your question?]
Again, though, if the individual exceptions are listed in the method, the
client programmer can base a plan of action knowing exactly which
exceptions will be thrown, and this may be valuable (or perhaps not?).

Another reason I'd throw the individual exceptions, is that you might have
one super exception, and there could be ten subclasses of this exception,
but for a given method, it might only throw 5 subclasses of the super
exception; by throwing the individual exceptions, the client programmer knows
which five exceptions might occur. Again, some very intelligent and expert
Java individuals have given advice contrary to this, and thus my response
might be considered more a learning response (for me), and could very well be
incorrect; or, perhaps, there is wiggle room, and additional context which
needs to be known for a given case before deciding which path is best, or
perhaps its half of one and half of another.

Javini Javono

In the month of July so far, two people received a score of 80/80 in locking:
Adrian Popescu and Maria Lepschy.

Did you all take any special action to ensure that a thread did not starve
waiting for a record lock? Or did you simply call notify() or notifyAll()
(which one?) and let the system determine which thread would be chosen
randomly next?

Javini Javono

Mark Spritzler wrote:

I'd say a scenario with multiple users and multiple machines all trying to get at a record at the same time.

I'm writing because I don't understand the implications behind the above remark, a remark
which others appreciate (because they see the implications immediately).

In my design and implementation, for every client there exists one data object on the server.

The following scenario works fine for me:
One computer, one application, multiple threads each representing a user, accessing
the database through the local or remote server.

I don't immediately see how the situation changes when you assume multiple machines.

Javini Javono

This is my own personal preference having almost completed this assignment,
so please feel free to ignore this advice if it does not resonate well with you.

In general, there being a couple exceptions, my exception hierarchy was all
checked exceptions, and one reason I really like this, is that you can then
leverage software tools to help you: the compiler tells you what exceptions
you need to check, Sun's doccheck tells you which exceptions you need to
document, and so forth.

Now, there are some reasons for run-time exceptions, of course, but I personally,
found great value in having the vast majority of my exceptions being checked

Let me try to rephrase this: if you find that you end up creating run-time
exceptions just to make the find() method happy, and then these run-time
exceptions start to "pollute" the other methods (where, let's assume, that
these are not run-time exceptions), then one possibility to consider is to
have find() throw no exceptions and make a search() method throw
reasonable exceptions, and find() delegates to search() and swallows as
outline previously.

Hopefully others might have good ideas on this topic.

Javini Javono
[ July 06, 2004: Message edited by: Javini Javono ]

"Such configuration information must be in a file called suncertify.properties which
must be located in the currect working directory".

Sorry to hear about this delay in you receiving your certification.

Exactly what does your application say when there is no properties file
when the server is attempted to be started with the following
java -jar runme.jar server

Does it inform the user that the properties file is missing, or give
any hint so that the Sun tester could take appropriate action (perhaps
marking off for not starting due to the properties file, but not
failing becauase the server actually does work).

Is it stated in the user's guide that the properties file must be present?
If so, maybe the Sun tester didn't read the user's guide (perhaps all the
user's guides seem pretty similar

Is it stated in the design decisions document that the propertes file
must be present?

Again, anything that the application itself does, or any supporting
documents do to tell Sun that the properties file must be present
is, in my opinion, to your advantage.

Gook luck, and again sorry to hear about this delay in your

Javini Javono

Please note that no one ever really fails this exam (as long as they
have $100 to resubmit). So, you may attempt to appeal, and in
the very worst case, you can resubmit and probably pass.
Goodluck, again.
[ July 06, 2004: Message edited by: Javini Javono ]

public int[] find(String[] criteria); as you can see it does not throw any Exceptions.
Due to this fact if an IOException occurs for instance in my find method I simply
ignore it and return a 0 length array to the caller. It's not a real big problem as it
is unlikely to happen but could. I think it would be better to return an Exception
that alerted the client to the fact an IOException occurs rather than a empty array.

I'm not an expert, so I hope others will offer their opinions and advice.
For my project, my find method had this signature:
public int[] find(String[] criteria) throws RecordNotFoundException;

Your signature, which throws no exception, seems quite unique to me, though
others with more experience on this web site may consider it normal (see the
FAQ link above for possibly more information and method signature examples).

There appear to be two school of thought: throw an IOException as a runtime
exception of your own making, or throw the SunGivenException with the cause
being the IOException.

In your case, it seems that if you are to throw an exception, you have little choice
but to throw a RuntimeException of your own making: IORuntimeException,
for example.

The down-side is that no one is required to catch the exception once it is
thrown; but, there's nothing you can do about that given the interface you
have to work with.

Of course, regardless of what solution you eventually find to implement,
nothing stops you from printing or logging the exception to the terminal
window or the log.

Do your other methods throw any exceptions?

Here is an idea I just thought of, though I won't be changing my current
design and implementation to experiment with it.

Usually the specifications define, I think, at most two or three required

These create "problems" of different sorts: for instance, how does one
throw a RecordNotFoundException if the method only throws a
DuplicateKeyException, for example.

However, your unique signature made me think of a new idea. You can
define two methods: find() and search(). The find() method delegates
to the search() method and "swallows" all exceptions; afterall, if someone
really doesn't want to know if an exception occurred, perhaps, and you'd
have to be the final decision maker, but perhaps this is alright in this case.
Your search() method could be used to define your own, sensical exception
hierarchy; and, this would be particularly true if none of your methods
threw any exceptions. You would write your code to call search() assuming
that you did care about getting back reasonable exceptions to report to
the user.

Javini Javono
[ July 05, 2004: Message edited by: Javini Javono ]

Thanks for your response.

I forgot to add one, small point. When, sporatically, the
error is printed to the terminal window, the application still runs
as it normally would.

Javini Javono
19 years ago

The id value (an 8 digit number) of the customer who has booked this. Note that for
this application, you should assume that customers and CSRs know their customer ids.
The system you are writing does not interact with these numbers, rather it simply records
them. If this field is all blanks, the record is abailable for sale.

One small warning: I don't have your assignment, so I hope those that are perhaps
better informed will speak up. Possible hint: have you scanned the instructions to
see if there are any other topics which relate to this question, and shed light on it
directly or indirectly?

Here is what I have done so far; but, please note that there are a myriad of choices
people have made in the past (I have UrlyBird). If I did not have what they called
the client ID stored, I randomly generated it, and documented that this simulates
some process where the new user is assigned a client ID. In the user interface, the
user is free to modify the text that represents the client ID. And, when the user
books a record, I simply store their client ID in the appropriate field in the database.

Javini Javono

I did my work on my Sun Certified Java Developer project on a Mac running Mac OS X using Project Builder. (This was some 20 months ago.) My project ran fine on Red Hat Linux the first time I tried it. I did have to make a few small changes to get it to run on Windows. In the end, both the client and server pieces of the project ran fine on all three platforms.

Ditto: I am doing my Sun Certified Java Developer project on Mac OS X, but using JEdit
instead. The executable .jar file created on the Mac runs fine both on the Mac (as would
be expected) and on Windows 2000 Professional. To keep the interface tweaking to a
minimum, I used Sun's Metal Look and Feel.

In regard to the first question in this thread, I have read while perusing books in book
stores where it states that some API or APIs are not available on the Mac OS X, but I
can't recall what they were (though my memory is that they were related to advanced
graphics API or to an advanced sound-related API). If, and when, I stumble upon these
references again, I'll post them here.

I've done no J2EE development on the Mac yet.

Javini Javono
19 years ago