Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!

Russell Wurth

+ Follow
since Jul 12, 2004
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 Russell Wurth

I am running WebLogic Server 9.2. I have a web application that I am currently auto-deploying to my dev server. I would like to have a directory called 'files' exposed via the web that will be a directory listing of my project, located at c:\bea\user_projects\domains\myProject\files

How can I do this? I already have the following in my web.xml:

And this is in my weblogic.xml:

This does not appear to work. Any thoughts?

Thanks in advance!

11 years ago
In case anyone does a search on this topic in the future, the plugin is actually called Lomboz.
13 years ago
I have just started looking at multithreaded testing, which JUnit doesn't do very well.

This article has some insight on using GroboUtils with JUnit to write multithreaded tests:

This is the approach I am going to take.

What about UML plug-ins to Eclipse? Any recommendations?
I am trying to package a class file with 2 jar files that are in my classpath.

Working directory (source/class file) : c:\eclipse\workspace\MyProject

Within my working directory, I am able to compile and run, creating Test.class. Both files are in my working directory.

Using Ant, I want a single jar that will include 'ar.jar' and 'Test.class' to be run on another environment. I would like to leave 'ar.jar' in the directory that it is currently in.

Here is my build.xml

The problem is that when I run 'java -jar MyJarFile.jar', I get a NoClassDefFoundError since it is not finding 'ar.jar'. The 'ar.jar' file is packaged in MyJarFile.jar, but I cannot figure out the correct Class-Path to reference 'ar.jar'.

Any advice?
13 years ago

Thanks, I achieved this result after I had posted. I wasn't thinking clearly last nite...

Thanks again

Russell Wurth
Great idea Mike, it works! The design is much more straight forward than regenerating the TableModel in the Controller.

One question though: With Max's design, the setupTable method was able to capture and reset the selected row between data refreshes.

I am guessing the only way I could do this is if I subclass my JTable to override it's tableChanged() method, capture the selected index, refresh the data, and reselect.


Would it be something like this for every time I need to update the display?

Thanks in advance!
My MVC design for my GUI has a TableModel that is updated with the correct number of rows to display depending on the Search/Search All results.

My problem is that I have a TableColumnModel instance variable as part of the main gui. In the constructor of my main gui, I set my TableColumnModel variable in the following fashion:

Now, using setAutoCreateColumnsFromModel() seems to be the only way to prevent my mainTable from losing it's columnModel settings since they are recreated every time I re-render the table using mainTable.setModel().

It works, but is there a better way, such as tying my column formatting in my TableModel? I could also create a new class MyTableColumnModel and call mainTable.setColumnModel() after every setModel() call, but that seems like overkill since I am not formatting my columns that much. I could also alter my method that performs the mainTable.setModel() call to format the columns every time, but again, seems like more work than needed.

I'm currently doing my SCJD project and have never written any complex test programs.

Is it worth my while to learn and implement JUnit for my SCJD project? If so, where is a good place that I can go for a quick-and-dirty intro to JUnit?

14 years ago

What's meaning of "book"?It means input into the "owner" field? or other operation?

Yes, you should allow the user to put an ID in that field, effectively flagging the record/row as booked. Your instructions should explain whether this is numeric or alphanumeric.

2.How to realize "Thread safety"?
Synchronizing a hashmap object in the lock and unlock methods is having resolved the problem?[/QB]

Yes, you are correct.

Are you implementing a single Data class? I was going to have an instance of a Data object per client that send it's read/update data/book/unbook commands to the server

Are you suggesting a lock for each read? I was only going to lock/unlock in a map for any writing that needs to go to the file.

Although the NIO package is not documented as unallowed in my instructions.html file, I was not planning on using it. I recieved no response from Sun regarding it's usage for my project.

My design uses a singleton DBFileAccess class that will be called by the server for read/write operations requested to the server by the object. I open a single RandomAccessFile for my database file, and I am planning on synchronizing on the RAF object for any read or write method call.

I wrote a test application to create threads to read a random row from a predetermined set of rows and compare the results with what should be there in order to ensure that the read is completed correctly. I put a random thread sleep in critical portions of the read in order to ensure that no other thread will interrupt. Here is a sample:

This appears to work with my test program, creating 50k threads to read and no read errors.

My question is this: Are there any other ways to control multiple threads accessing my file, so that the construction of the data from the byte array is not interrupted? I am assuming that since I am synchronizing on myRAF, that a read and an update will not occur at the same time. My only complaint with this design is the performance does not appear to be very good, but probably good enough for SCJD.

Can anyone recommend a good plugin for Eclipse to do Struts/Servlets/JSPs?
14 years ago