Hu Yong Jun

+ Follow
since Jun 20, 2003
Merit badge: grant badges
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 Hu Yong Jun

I am testing the system.

There is an error that says there is no route to "" and I can not start the RMI registry server when I pulls out the network cable.

I works on the pc whose IP is It is localhost.

What is wrong?
Thank you all.

Before really writing I have a read statement to check if the record with that recNo exists and is already created by other. It is this statement that throws the EOFException.
The test method throws an EOFException when I test the Data.create() method.

How can append record to the random access file?
I think that the adatper adds the network function in remote mode while the adaptee is used in local mode. So there must be a difference between the adapter and the adaptee: the adapter throws RemoteException but the adaptee not. You would write 2 client programs, one for adapter in remote mode and the other for adaptee in local mode.

In my understanding, the adapter can not be used in both remote and local mode if this difference exists.

In my design I use the adpater design pattern (server-side). The adpater class has two important roles, firstly its has all the server-side business logic in it and is used in both remote and local mode.

[ October 12, 2004: Message edited by: Hu Yong Jun ]
[ October 12, 2004: Message edited by: Hu Yong Jun ]
I think it is very good.

I have almost accomplished my assignment.

I have a LockCookieGenerator to generate the unique cookie.
I turn the concept of DataAdapter into session facade so that the Data is a singleton. So I can use "synchronized" on the Data object, say the methods in Data modifying database are synchronized. I also model the lock as a object, not a pair of cookie/recNo values.

My design is not the good maybe. I hope that I could pass the exam.
[ October 12, 2004: Message edited by: Hu Yong Jun ]
Does the server program of the system in remote mode supports local mode?

Is there only one user in local mode so the lock machanism is not needed?
[ October 12, 2004: Message edited by: Hu Yong Jun ]

The LocalXxx and RemoteXxx share the same interface named as Xxx. The methods in the Xxx interface all throw RemoteExceptioon so the LocalXxx's methods throw RemoteException in local mode. This is because the subclass RemoteXxx is remote and must throw RemoteException. In local mode, the system is in local invoking manner and does not throw RemoteException at all so that it could do nothing with RemoteException.

In the view from client, the system is always a client/server application and is remote. It is the system that shelds or hides or bypasses the network when it is in local mode.

Anyone has other opinions?
I has resolved this problem minutes before.

The src is complied in j2sdk 1.4.2 environment, but I runned it with the old version java.exe.

When I replaces the old java.exe with a 1.4.2 one, it is OK!

The following is found in WWW:

Why does java not allow packages from java.lang when I'm connecting from another machine? I get an unmarshaling error:
java.rmi.UnmarshalException: Error unmarshaling return;
nested exception is:
java.lang.SecurityException: Prohibited package name: java.lang
java.lang.SecurityException: Prohibited package name: java.lang
<exception cut here>
When mixing different versions of java, the java security manager on the java VM where the catalog is running decides that one version is trying to override the restricted packages. It's not actually true, but that's why it happens. You can prevent this from happening by running the catalog on the lowest version of java that you are mixing together. This usually happens with the iPaq handheld platform (H21). So if you have a machines running jdk1.3.1, 1.4.0 and 1.4.1_beta, the catalog must be run on 1.3.1.

There is an error when I runs my system outside of the Jbuilder IDE.

The command is like:

The error message is like:

What's wrong?
Does the java needs a security manager to access the java.util.logging package?
In scea, the SunCertify specify the name of the submission file. The name contains your test ID.
Does SunCertify specify the name of the submission jar file in SCJD? How does SunCertify identify my submission file?
[ October 11, 2004: Message edited by: Hu Yong Jun ]
A thread deletes a record. It must unlock the lock whose record does not exist. So no RecordNotFoundException would be thrown in the body of Data.unlock() method. Is it correct?
The creation does not need a record lock because there is no record it can lock, but it does need a object lock because it modifies the database.

One thread wants to create a new record and gets the next available recNo, says #29, at the same time the second thread gets the next available recNo, unfortunately #29 too. The first thread completes the creation and then the second thread throws duplicate key exception. The second can try to get next available recNo again.
I am very very glad that I have got the grade of P in the SCEA part II at a lower score.

I have lost half of the total points in the class diagram. I think that I have not do my best enough. It is a very big pity that I could not get a higher score.

I want to ask SunCert for more detail of my losing points badly. I have written to them. Did anyone get the more detail?
Thank Andrew.

I resolved this problem after reading thread 004798.

I think others might search here and find something helpful so I edited this message and added a reference to the thread 004798.
Please See thread:

1. There is a line in the code like:

It is OK when starting server with

It is OK when starting client with

Now I delete that line containing RMISecurityManager, and start the server with no JVM parameter:

I use JBuilder of IDE tool. The stub class is in the classes directory.

Keeping no line containing RMISecurityManager, when I start server and client with JVM parameters as following, it is OK.

[ October 03, 2004: Message edited by: Hu Yong Jun ]

[Andrew: split lines, converted smileys to text, and converted the "please see ..." to a real URL]
[ October 03, 2004: Message edited by: Andrew Monkhouse ]