Gary Down

Ranch Hand
+ Follow
since Apr 09, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Gary Down

Is this of any use??
Reporter

Just an old cobol programmers sugestion to another...

Gary,
20 years ago
Thanks Craig,
I had advanced to using a cell renderer
as


Your way is much smarter and neater.
20 years ago
How do I make the items (all String items) in my JList display in the centre of the panel?

The Jlist is held in a JScrollPane inside a JSplitPane.

Please don't just tell me to read the doco again as I have read it over a few times but still don't understand it. Pointing me to something specific might be of use though.

Thanks,
Gary.



20 years ago
Maybe this link will assist in clarifying the relationships between throwable and exception
The Throwable class anthrowable.htmd it's subclasses

Gary.
20 years ago
Assuming you have correctly created a BadException class :-

e.g.
class BadException extends Exception {}

try this:
throw new BadException();

Gary.
20 years ago
Thanks everyone,
I now have comunicating clent/server classes.
My problem was basically being pretty new at this stuff and an environmental problem with my "Eclipse" setup.

All the help, comments etc.. are greatly appreciated.

For me, it is on to getting my head around the "Serializable" classes.

Thanks again,
Gary.





20 years ago
Boy oh Boy
this books seems like it is the one I need.

Coming from 20 years developing systems in many older, more direct programming languages (please don't get into a discussion about them, they are just an early part of the evolution on programming which, without them, none of this would exist).

As technoogy has changed, so too, do I need to change. Syntax, coding styles, etc.. etc.. are old and overrated arguments. Any experienced programer can come to terms with new language syntax. What we need is a good guide to new thinking, new methods, and (most of all) a nudge in the new direction.

There was little more de-humanising (a good word if it exists) than sitting down and writing unnatural machine code and slightly more readable languages, but it did give give a good understanding of the mechanics involved in software development. The aim of the game is to produce usable, reliable and trusted systems that do "the job", not examples of fancy code, pretty front ends etc.. (all of which have a place but are not the end product). So, if this book gives a good insight into changes in technological sytems, I am all for (read need) t.

Gary.
Nate,
thanks for your efforts so far.

Do the class files need to be in a jar file instead of individual classes in the diectory?

As you see, I'm pretty new to this and seem to have gotten into a hole at the moment.

Thanks again.
Gary.
20 years ago
ALL my class files live in
G:\eclipse\workspace\WordBank\bin\wordbank

My policy file is
G:\eclipse\workspace\WordBank\policyFile

I use the following parameters to run my program
-Djava.rmi.server.codebase="file:/G:/eclipse/workspace/WordBank/bin/wordbank"
-Djava.security.policy="file:/G:/eclipse/workspace/WordBank/policyFile"

The main of my remote :-

I thought I'd give it a try without the security manager and get this:-

What have I missed???


WBRemote: pre rebind //127.0.0.1:1099/WBInterface
WBRemote exception: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: wordbank.WBRemote_Stub
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: wordbank.WBRemote_Stub
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at java.rmi.Naming.bind(Unknown Source)
at wordbank.WBRemote.main(WBRemote.java:192)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: wordbank.WBRemote_Stub
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: wordbank.WBRemote_Stub
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
... 9 more

What have I missed???
20 years ago
Thanks Nate,
unfortunately the problem is with the rebind itself. The main I included is from the remote/server program. I haven't got to testing the client as yet. I believe i have a problem with the RMI plugin in Eclipse IDE. I have contacted them about that and am waiting for a reply.

Thanks again,
I'll let you know one way or the other,
Gary.
20 years ago
I am using RMI in Eclipse developing a serer/client aaplication on my PC...

Everything compiles and the WBRemote_Stub.class is generated

How do I fix/prevent this message when starting the server program?

I am new to this so even the most basic ideas will be of help. I am still reading the RMI tutorial which is pretty vague about external things (e.g. policy.file, is this something I need to do??) so any step by step ideas gratefully accepted.

Thanks,
Gary


WBRemote exception: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)

20 years ago
Am I heading in the right direction....

I have been reading up on RMI and get the impression that I could create a server program, which when started could populate it's "Sets"

e.g. in this case "private static Set usersArray = new TreeSet();".

Then as each client transaction called to get the "Sets" it could just return them as required (given that the necessary functions have been implemented via the interface).

If so, and given the "main" coding below, what do I need to do in the "client" side and (if anything) external to the JAVA classes (e.g. policy file??)

Also,
At the moment I get
WBRemote exception: access denied (java.net.SocketPermission G resolve)
at the Naming.rebind statement


Arnel,
guess I'm not too clear..

This was written as a single user application running on a single desktop PC.
Now we would like to expand it to have the data held in a single central database (most likely on a website). The aim here is to allow several users access to the data. All the users (young students at that) will need to have access to the same starting information. Each student will update their respective copies of the data and then (when OKd by the teacher) the updates will be applied to the database.
The problem is that some students may finish before others have even started, causing the later students to begin with a different set of data.

Hope that is a bit clearer.

Gary.