File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to enable JDK 1.4 assertions in Tomcat?

 
Thomas Wermter
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in 'setclasspath.bat' you need to insert this line:
Rene
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic