ApplicationException ErrorCode:999

I recieve the following exception when I dont work on the sessioon for some time (about 5 min).
And ALL my jsp files in the application gives this same exception.
The problem automatically disappears when I restart Tomcat.
(But it is not a good idea to restart Tomcat each 5 min :frowning: )

An error occurred in the application program. Please report the following problem to your webmaster.
Error message: 999: Application Error! Please contact the X-Application-Team.
Help message: Please send a copy of the stack trace and of the error page to the development team in order to solve this problem immediately.
Exception Type: ApplicationException

ApplicationException: 999: Application Error! Please contact the X-Application-Team.
java.lang.ClassCastException: com.softwareag.xtools.xapplication.jsp.ApplicationContext
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findApplicationContext(
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(
at com.softwareag.xtools.xapplication.jsp.JspTag.checkContext(
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(
at _0002fsearch_0002ejspsearch_jsp_5._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.tomcat.core.ServletWrapper.doService(
at org.apache.tomcat.core.Handler.service(
at org.apache.tomcat.core.ServletWrapper.service(
at org.apache.tomcat.core.ContextManager.internalService(
at org.apache.tomcat.core.ContextManager.service(
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(
at org.apache.tomcat.service.TcpWorkerThread.runIt(
at org.apache.tomcat.util.ThreadPool$

X-Application Version: 3.1.2
Tamino Version : 3.1.1
Platform : Win2k
WebContainer : Tomcat 3.3
JDK Version : 1.3.1

Weired. This exception indicate that there is
an instance of
which cannot be castet as defined in line
But in lint 165, I’m casting to this very class:
Are there multiple definitions of this very
class in you classpath or WEBINF sub-directories?

Does deleteing your Tomcat work directory change

The whole problems seems to be related to
your Tomcat timeout. To verify this you could
change the Tomcat timeout to 1 minute. If the
problem arises after one minute, we could be
sure about this …


Software AG Germany, Darmstadt

Hi Michael,
Thanks for your help.
I noticed when this exception to tell it let me explain my development environment a little more.

I generated an application using XApplication Generator.
Then I deleted the xapplication.jar file from the lib directory.
I added a directory named class under the WEB-INF directory.
I compile the source files of the xapplication source into this directory.
I sometimes add some System.out.printl comments in these source files to debug my application.
When I recompile a class while testing the application this exception occurs.
Everything works fine unless I compile a class.
Thanks for your interest.

Ok, that explains the behavior: if you re-
compile your classes Java loads a new version
of the ‚ÄúApplicationContext‚ÄĚ class. And casting
an existing instance of the old
‚ÄúApplicationContext‚ÄĚ class to the new class

Nice to see this problem solved without fixing
anything on our side :slight_smile:


Software AG Germany, Darmstadt