Neil Johnson

Greenhorn
+ Follow
since Jan 22, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Neil Johnson

I have worked as a director at a small company doing product development. We strived for a repeatable cycle of releases, once per quarter, divided into minor (odd releases - bug fixes, even releases - minor functionality improvements) and major releases - major enhancements and functionality. I had to work hard to get my engineers to accept a more structured way of product development.

In a recent discussion with another senior product manager, he indicated that they were having some success with agile techniques. I expressed surprise, since at first glance (and in my admittedly limited experience), Agile does not seem well suited to time-compressed development.

Does the book talk about product development or just IT Projects? How would you apply Agile techniques to structured product development, where product management defines a set of features that must be implemented?

Thanks, Neil
Hi, I am going out on a limb here with all the experts around.
My experience is that because each thread runs in its own context with its own stack, you cannot throw exceptions up out of a thread. However, you can wrap the entire run method with a try-catch(Exception) and then call a method back in the parent, before dying. Note that this call runs in the context of the thread, not the parent, so you must basically use this method to then 'wake-up' the parent or to set a flag indicating that the thread died.
Hope this helps.
Neil
Hey, this looks really promising. All my crew needs to do is 'graft' on a text editing function, extend the classes and add some 'whizzy' toolbars and the app is half written (still gotta do the SOAP stuff)! I appreciate your excellent answer.
Thanks, Neil
Hi, we need to create a custom editor for an XML document, to be used by people who don't know XML and don't need to know XML. In other words they can update the text in the document and add limited amounts of information (e.g. Bolding, or a price), without having to type in any tags.
Does anyone know of any Java source (public or for sale) that could be used as a template to create this editor? Any other suggestions?
Thanks, Neil
Oops, thought I found it for a second. The manifest specification says you need to separate the paths by spaces not semi colons. Tried that. No joy. Help still requested, please.
Neil
23 years ago
At a rough guess, it looks like you guys implemented CORBA by hand. Take a look at CORBA, it can be pretty well integrated with java. Download the sun internet version of Forte as you can generate corba idls from there.
23 years ago
I have an application which is broken into multiple jar files. I execute from the command line in the directory D:/MTI/test as follows:
java -jar DBListener.jar D:/MTI/LiveDataServer/testbed/TESTsensorframe.dat
The manifest has the following lines in it:
Classpath: mtiData.jar;mtiutil.jar;
Main-Class: testbed/DBListenerUtility
The mtiutil.jar contains the class
mti/util/MtiException
When I run the jar I get the exception:
Exception in thread "main" java.lang.NoClassDefFoundError: mti/util/MtiException
I have tried a number of variations on a them including putting the jars into their package directories and nothing works. I did check the mtiutil jar and the mti/util/MtiException class is in there. I also originally had the two jar files on the command line with a -classpath prefix and that did nothing either.
There must be an obvious solution to this (excluding pulling all the classes back out of jars and putting them into their packages again), that I am missing.
Help would be greatly appreciated.
Thanks, Nei
23 years ago
Hi, we have run into something similar and it has to do with the 'magic' numbers that are exchanged when an ObjectOutputStream hooks itself to an ObjectInputStream. Much to our surprise the constructor for this class actually does I/O operations with its counterpart across the connection (yes, I know it does say that in the documentation, I checked, afterward). What it does during this communication is to exchange the magic numbers between the classes and stuff.
To make it work we had to take the class files for the serialized objects that were compiled on one machine and move them over to the other machine. At this point, the magic numbers started to work, and we could send and receive objects. However, if the second machine recompiled the java files into classes again, everything would stop working. So, the class files must be the same on both machines before this will work! And we think the java versions for the VM and class libaries must match as well, otherwise, no luck!
Hope this helps, Neil
Hi, I am not aware of any methods either. I worked around this by creating numbered versions of the log file using an ErrorLogger class. The user can request the server application to close the current version of the log file and open a new one. This would then allow you to archive or delete the old ones. The code for a couple of the methods from this class are attached. The openLogFile method that is used to lookfor the next log file is attached. The logFileprefix is a public variable that sets the path and prefix of the log file. e.g. c:/someplace/LogStuff which with the suffix generates a name of c:/someplace/LogStuff000.log.
You can create your own logMsg method which counts lines, and automatically opens a new log file once your 'limit' has been reached, or on a daily basis, or whatever.
Its not elegant, but I hope it helps.
Neil
/**
* Opens a new log file for logging messages.
* This method will create numbered logfiles in sequence. It takes the logfile prefix and extension
* that it has been given previously, and looks for the highest number logfile in the directory. It then increments
* this number by one and opens a new log file with that number. If a Log File is already open
* it closes the existing file first.
* @return void
* @Exception IOException thrown for usual file-related errors including path not found, etc.
*/
public static void openLogFile() throws IOException {
String versionNumber;
if (currentVersion==0) {
int version;
int versionFnd=0;
File logFile = new File(logFilePrefix);
String prefix = logFile.getName();
int prefixLen = prefix.length();
String parentDir=logFile.getParent();
if (parentDir==null) parentDir = ".";
File dir = new File(parentDir);
// Find highest file version
String logFiles[] = dir.list();
int prefixFnd=0;

if (logFiles!=null) {
for (int ptr = 0;ptr < logFiles.length;ptr++) {
if ((prefixFnd=logFiles[ptr].indexOf(prefix))>=0) {
// The following assumes that the version is always 3 digits
versionNumber = logFiles[ptr].substring(prefixFnd+prefixLen,logFiles[ptr].indexOf("."));
try {
version = Integer.parseInt(versionNumber);
} catch (NumberFormatException e) { version = 0;}
if (version>versionFnd) versionFnd = version;
}
}
} else
versionFnd = 0;
currentVersion = versionFnd; // This is the highest number found
}
if (currentVersion>=999) currentVersion=0; // Wrap at 999
// increment highest version by 1
versionNumber=String.valueOf(++currentVersion);
while (versionNumber.length()<3) { versionNumber = "0" + versionNumber; }
logFile = logFilePrefix + versionNumber + extension;
if (outputStream != null) closeLogFile();
outputStream = new FileOutputStream(logFile);
logToFile = true;
logMsg("Opened log file: " + logFile);
}

/**
* Close the Log file - ignore any errors that occur.
* @return void
*/
public static void closeLogFile() {
try {
logMsg("Closing log file: " + logFile);
logToFile = false;
outputStream.close();
} catch (IOException e) { /* Ignore it */ }
}
23 years ago
Thanks, that worked! The syntax did not work exactly, but the concept worked perfectly. I appreciate you taking the time to answer, and the rest of the stuff in the Class class looks interesting as well. This will make the application a lot easier to use as well.
Thanks, Neil
23 years ago
I would like to be able to open a properties file which is kept in the same directory as the main class file (or jar) that is currently open. However, when I use the System.getProperty() method with various keys, I get back the location of the forte directory, not the location my class file is running from. I have checked the forums and the sun site, with no luck. This should be easy, please help me out.
Thanks, Neil
23 years ago