Steve Leach

Ranch Hand
+ Follow
since Sep 24, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steve Leach

Your getAB() call is immediately after you start the thread, and so the thread won't have started running yet.
You need to have your servlet wait for the thread to be ready.
Your code doesn't make it obvious why you are using threads though.
19 years ago
I have had similar problems, specifically with Apache forwarding requests to Tomcat. Apache wasn't sending the requested host name through to Tomcat, which was then using the local machine hostname rather than the name the client requested.
will return the host name requested by the client, IF it was set by the browser. If the browser doesn't set that header then I don't think there is anything you can do.
19 years ago
Hi
There's really not a lot of point in someone here typing out another introduction to servlets when there as so many available on the web already.
Try...
http://www.webdevelopersjournal.com/articles/intro_to_servlets.html
In answer to your specific questions...
1. To run a servlet on a remote host, that host must be running a "web container" such as Apache Tomcat. You then install your servlet in that web container.
2. Running a Java application through CGI has nothing to do with servlets, and is quite inefficient. The introduction page I mentioned earlier explains why.
Hope this helps.
20 years ago
Not a bad suggestion, except that it's running on a Linux system. I had a problem the other day because the X-Window libraries weren't installed, and that reported a problem in a different native method. It was a "library not found" error rather than a "class not found" error though.
The other issue is that, even if it is a missing library, I have no way to know which one is missing.
20 years ago
Hi all
I just posted this in the servlets forum, but then realised it's nothing to do with servlets, despite being run by one.
I am getting a NoClassDefFoundError thrown by sun.misc.Unsafe.ensureClassInitialized(), but there is no indication of which class it cannot find (getMessage() returns null).
This is happening when loading an object through java.io.ObjectInputStream.readObject().
Does anyone have any suggestions about how I can find out which class is missing ?
Cheers
Steve
20 years ago
You could give your java class a "main()" method, and then invoke it using the OS scheduler as an application.
Alternatively, have an application that creates a new thread. The thread will check the time and then sleep for a while. If the time is appropriate it can do it's stuff. If you do this, you should set a "date last run" variable so that it doesn't run twice on the same day.
Does this help ?
20 years ago
Hi again all, here's my latest challenge...
While trying to run a report (using Jasper reports) on my new server I am getting a NoClassDefFoundError thrown by sun.misc.Unsafe.ensureClassInitialized().
I have included a full stack trace below, but it looks like the de-serializer is not finding one of the classes that was serialized when compiling the report.
So far so good.
The problem I have is that the exception has no message, and therefore I have no way of knowing which class it cannot find.
I have checked the javadoc for NoClassDefFoundError and it seems that there are no other methods that might provide the information about which class (which seems a strange ommission - you would have thought there would be a "getUnfoundClassName" method or something).
Does anyone have any suggestions on how I can track down the missing class ?
Please respond, even if only to say "no idea mate, sorry!".
Cheers
Steve
20 years ago
Do you mean is anyone using servlets for anything other than http web servers ? Or is anyone using GenericServlet rather than HttpServlet for http ?
I think that the people who designed the servlet spec were being cautions, and assuming that someone *might* in future want to use servlets for other protocols. As far as I am aware, no-one has yet.
20 years ago
Any suggestions about what ?
20 years ago
Sorry for the spot of petulance. However, by throwing my toys out of the pram at least I discovered that I'm not being ignored
20 years ago
Once again I've sorted things out myself before anyone bothered responding. I'm starting to wonder whether there is actually any point in using this forum.

The problem was that the new server was running under Apache with mod_jk, and the Apache config was specifying the wrong name.
20 years ago
Just noticed that you have a capital "D" for "Disposition". Maybe it is case-sensitive.
20 years ago
I used...

which works.
The only difference I can see is that I use "inline;" and you use "attachment;". Could that be it ?
20 years ago
Hi all
I have just loaded my application onto a new server, and almost everything is working properly, except...

when called with a relative path name is changing the name of the server, which means the session cookie gets lost. The server name it is changed to is an alias defined in the <host> section of the server and is also what request.getServerName() returns.
Has anyone seen anything like this before ?
Cheers
Steve
20 years ago
Yep, I'm happy to spend a week (assuming a project of several months) to get infrastructure sorted out. It's really not that much time, and picking a framework that is not right can easily lose you more time than that.
In my case one of the design goals was to allow multiple views against the same application. The views are expected to be very different, both in appearance and in structure. In order to achieve this we put the JSP pages in control, and the java code just provides functionality for the pages to use.
This would be difficult to build elegantly with Struts, which assumes control in the java code and it's xml configuration files - at least as far as I can make out.
Again, I'm not saying struts is a bad idea. Just that you have to look at it carefully and make sure that decisions made by the struts developers don't force you to compromise too far on your own project.
20 years ago