ApplicationException ErrorCode:999

Hi,
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: )

Error!
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
Stacktrace:


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(ServletSessionContext.java:165)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(ServletSessionContext.java:95)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(ServletSessionContext.java:70)
at com.softwareag.xtools.xapplication.jsp.JspTag.checkContext(JspTag.java:226)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:114)
at _0002fsearch_0002ejspsearch_jsp_5._jspService(_0002fsearch_0002ejspsearch_jsp_5.java:71)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)


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
com.softwareag…jsp.ApplicationContext
which cannot be castet as defined in line
ServletSessionContext:165.
But in lint 165, I’m casting to this very class:
com.softwareag…jsp.ApplicationContext
Are there multiple definitions of this very
class in you classpath or WEBINF sub-directories?
Strange.

Does deleteing your Tomcat work directory change
anything?

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 …


Michael

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.
Server

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
fails.

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

Michael

Software AG Germany, Darmstadt