Problem in deploying web-app on bea weblogic 8  - java.lang.ClassCastException at antlr.CharScanner.makeToken(

Posted on 2006-10-20
Last Modified: 2013-12-10
Hi, I'm facing a strande problem in deploying a web-application.
I have two enviroment with same software application, Bea Weblogic 8.
In test enviroment, I deploy the web-app and everything goes well; in production enviroment, same code and lib (same war copied from one to onother) I get this error:
####<Oct 20, 2006 11:09:19 AM CEST> <Error> <HTTP> <DANUBIO> <cgServer2> <ExecuteThread: '13' for queue: 'default'> <<WLS Kernel>> <> <BEA-101020> <[ServletContext(id=19891540,name=ACSConsole,context-path=/ACSConsole)] Servlet failed with Exception
      at antlr.CharScanner.makeToken(
      at weblogic.servlet.jsp.JspLexer.mSTANDARD_CONTENT(
      at weblogic.servlet.jsp.JspLexer.mEXPRESSION(
      at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(
      at weblogic.servlet.jsp.JspLexer.mTOKEN(
      at weblogic.servlet.jsp.JspLexer.nextToken(
      at weblogic.servlet.jsp.JspLexer.parse(
      at weblogic.servlet.jsp.JspParser.doit(
      at weblogic.servlet.jsp.JspParser.parse(
      at weblogic.servlet.jsp.Jsp2Java.outputs(
      at weblogic.utils.compiler.CodeGenerator.generate(
      at weblogic.servlet.jsp.JspStub.compilePage(
      at weblogic.servlet.jsp.JspStub.prepareServlet(
      at weblogic.servlet.jsp.JspStub.prepareServlet(
      at weblogic.servlet.internal.ServletStubImpl.getServlet(
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
      at weblogic.servlet.internal.WebAppServletContext$
      at weblogic.servlet.internal.WebAppServletContext.invokeServlet(
      at weblogic.servlet.internal.ServletRequestImpl.execute(
      at weblogic.kernel.ExecuteThread.execute(

just to be clear, the mentioned jsp DOES NOT HAVE any kink of java object; here is the page content:
<script src="<%= request.getContextPath()%>/js/windowUtil.js"></script>
<script  language="javascript" >
function loadPage(){
  openPopup('<%= request.getContextPath()%>/jsp/Login.jsp');
  if(navigator.appName == "Microsoft Internet Explorer"){
<body bgcolor="#ffffff" onload="loadPage();">
Any clue?
Thanks in advance
Question by:hanoirules
  • 2
LVL 23

Expert Comment

ID: 17773536

A ClassNotFoundException indicates that the input processor's class could not be found by the web application's class loader or any of its parent class loaders. This could be the result of several problems. Things to check include:
Make sure there are no typos in the class name of the input processor node for the webflow configuration.
Make sure that the input processor's class file is in either the web application's WEB-INF/classes directory or within a jar file in the WEB-INF/lib directory.

Make sure that your input processor is in a subdirectory corresponding to its Java package. If the class file is not in a directory structure corresponding to its Java package structure, the class will not be found.

In order to understand why some problems occur with deploying input processors and pipeline components, you first need to understand a little bit about how WebLogic's class loaders work and how they relate to application deployment.

Class loaders are a fundamental part of the Java platform architecture. They allow classes to be loaded and are also tied to the Java security model. For any running Java VM there exists a parent/child hierarchy of class loaders. The root of this hierarchy is the bootstrap class loader which is responsible for loading classes internal to the VM and also classes from the standard java.* packages. The child of the bootstrap class loader is the extensions class loader which loads jar files from the JDK's extensions directory. The child of the extensions class loader is the system class loader. This is the class loader which loads classes from the CLASSPATH environment variable provided to the Java VM on startup.

When a class loader loads a class it first looks in the parent class loader. Only if the class is not found in the parent class loader will the class loader try to load the class itself. So initially the search for a class will move up the class loader hierarchy until it reaches the bootstrap class loader. If the class is returned by the bootstrap class loader then the search ends. If the class is not found then the search proceeds down the class loader hierarchy until it reaches the class loader where the original request was made. If none of the class loaders in this chain have the class then a java.lang.ClassNotFoundException will be thrown.

In the process of loading classes, a class loader must resolve external dependencies declared in the class being loaded. For example, if you have a field in your class that is of type java.lang.String, the class loader must make sure the String class is loaded as well. If for some reason the class file for the field's type cannot be found you might think that a ClassNotFoundException would be thrown, but instead you get a java.lang.NoClassDefFoundException.

It is possible for multiple class loaders to contain the same class. This is not ordinarily a problem but in some cases it can cause confusing java.lang.ClassCastExceptions to occur. From a source code perspective a class is uniquely identified by its fully qualified class name. Things are slightly different in the Java runtime environment: a class is uniquely identified by it's fully qualified name and the class loader which loaded it. So if you get ClassCastExceptions where nothing appears to be wrong in the source code, check to see if the class loader of the class you are casting to and the class loader of the object being cast match.

WebLogic server implements its own class loaders. WebLogic server's application class loader allows classes to be both loaded and unloaded. This in turn enables applications to be hot-deployed. Each enterprise application deployed on WebLogic server has its own application class loader whose parent is the system class loader. EJB jar files within an enterprise application are loaded into the base application class loader corresponding to that enterprise application. A new class loader whose parent is the class loader for the enterprise application is created for each web application . By creating a separate hierarchy of class loaders for each enterprise application, WebLogic server can host multiple applications on the same VM that are isolated from each other.

For more info. look at here...


Author Comment

ID: 17773725
Excuse me, where did you see a "ClassNotFoundException"?
LVL 11

Accepted Solution

sompol_kiatkamolchai earned 500 total points
ID: 17774116

Please make sure that both of environments are using the same service pack.

You can check it from admin console by right click on Console node and click "View server & browser info" and look for "Server Build"

Hope this help.

Author Comment

ID: 17774852
Thanks! The problem has been solved. Just to inform everybody, in case this happens to someone, as Sompol said (!!!), it was a service pack compatibility problem.
In production env. they have service pack 6, and test env. service pack 5.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question