Annekee Dufour

Ranch Hand
+ Follow
since Nov 04, 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 Annekee Dufour

I want to get all entries from a table in db2 where a certain timestamp is not set. If I use a query "select something, myTimestamp from myTable", and I print myResultSet.getTimeStamp("myTimestamp"), the answer is null;

However, if I try to select all the empty timestamps with a preparedStatement:
preparedStatement = "select something from myTable where myTimestamp=?";
preparedStatement.setTimeStamp(1, null);
I do not get any results!
Does anybody know how can I find the empty timestamps?
Thanks everybody,
I guess I will be using the ReadWriteLock, or add some synchronization around the newmap. One of the reasons I did not want to use synchronization around the original map is that it will be accessed by other people's code, and they might iterate over it without synchronizing. Since there won't be that many puts, this will not be a problem most of the time, but sometimes it will be a problem.
I also intend to use an unsynchronized hashmap. Since I expect a lot of gets (> 1000 a day) and iterates, and very little puts (12-15 a day), I don't want to synchronize every get and iterate action. Therefore, if I do a put, I start by cloning the original map, put something in the new map, and then assign the newmap to my original map variable. Is this a safe alternative to synchronizing?
Your line
String result = java.net.URLEncoder.encode("Hello World", "UTF-8");
can throw an java.io.UnsupportedEncodingException (meaning: it is possible that your system doesn't know this encoding, how do you want me to handle that situation). The compiler warns you to take precautions against that, you must surround your code by a try-catch block. Can you find out how to do that?
19 years ago
19 years ago
Actually, it's the illegalstateexception that is recursing.
After the illegalstate exception occurs (meaning you are trying to write something to the outputstream while it is already flushed), Tomcat tries to send an errorpage to the outputstream, which causes another illegal state exception, causing Tomcat again to try and send an errorpage to the outputstream, etc. So you get 1024 illegalstateexceptions and then a stackoverflow error.
I had this problem too (tomcat 3.2.3 jdk1.4.1). I was advised to go back to jdk 1.3 (couldn't do that) or upgrade to jdk1.4.2 (didn't help). In the end I hacked the tomcat code of the handleError method in org.apache.tomcat.core.ContextManager:
if( errorLoop( ctx, req ) || errorServlet==null){
//original code, replaced by ADU according
//to http://issues.apache.org/bugzilla/show_bug.cgi?id=19002
//errorServlet = ctx.getServletByName("tomcat.exceptionHandler");
//end original code
//start change ADU 5/11/2003
log("Error loop for " + req);
return;
//end change ADU 5/11/2003
}
That worked.
19 years ago
It is talking about line -1 and file null. Is it possible that tomcat cannot find the jsp file? Is the file there? Is it readable? And how about the 'work' directory. Tomcat first creates a servlet there (a .java file), and that's what he tries to compile. Did tomcat create a servlet in a work subdirectory?
20 years ago
did you download the jdk or the jre? The jre does not have a compiler.
20 years ago
Thanx Ernest.
BillyBob, I sometimes see full GCs that take 7 seconds. This is harming my response times (which need to be below 2 seconds). I want to see how often that occurs. I also want to know the percentage of time my system spends garbage collecting. Maybe some tuning is necessary, increase memory or change how it is divided between young space, eden etc, another kind of garbage collection.
20 years ago
Aha, you mean a Stack and not the stack as in stack vs. heap!
20 years ago
It doesn't exist, that's my problem!
20 years ago
why would you want to do that?
20 years ago
I have some applications running with java 1.4.2, and use all kinds of fashionable garbage collection monitoring options there.
But now I have this other application that really needs jdk 1.3.1, and all I can find is verbose:gc. It shows how much time the garbage collection takes and how much garbage gets collected, but it does not even give me a timestamp. There must be more! Anyone?
20 years ago
Solved it by decompiling the oracle parser class XSLTExtFunction.class and changing the code of the getClass method.
I catch the classnotfoundexception caused by thread.currentthread.getContextClassloader(), and try Class.forName().
Sorry about the typo's in the java code, why don't we have code completion on the ranch?
20 years ago
I really need apache because we use a security plugin (Baltimore SelectAccess) that works with apache and not with tomcat. So that's our reason. It is much easier to setup tomcat standalone, so I would do that until you find a reason to change.
20 years ago