This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes How to enable JDK 1.4 assertions in Tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to enable JDK 1.4 assertions in Tomcat?" Watch "How to enable JDK 1.4 assertions in Tomcat?" New topic
Author

How to enable JDK 1.4 assertions in Tomcat?

Thomas Wermter
Greenhorn

Joined: May 08, 2003
Posts: 4
Hi,
I want to use the assert statement from JDK 1.4 in my servlets in Tomcat 4.1.24 (Win). I know I have to enable it by a command line parameter -ea. But how do I tell this my Tomcat server?
I tried to set the CATALINA_OPTS shell variable
(CATALINA_OPTS="-ea") but it didn't work.
Any ideas?
Thanks,
Tom
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

in 'setclasspath.bat' you need to insert this line:
Rene


Regards, Rene Larsen
Dropbox Invite
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

The potential problem with this: If your servlet throws an assertion error, is the container designed to handle it? I think not, because assertions aren't meant to be handled by code (even though they can be).

So... umm.... won't that cause the current thread to die with an assertion error? How would the container notify the browser that something had gone wrong? Would it perhaps kill the container?

I'd be interested to hear your results...

Also... moving this from Servlets -> Apache/Tomcat
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to enable JDK 1.4 assertions in Tomcat?