Solved

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

Posted on 2006-10-20
4
3,473 Views
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
java.lang.ClassCastException
      at antlr.CharScanner.makeToken(CharScanner.java:175)
      at weblogic.servlet.jsp.JspLexer.mSTANDARD_CONTENT(JspLexer.java:5745)
      at weblogic.servlet.jsp.JspLexer.mEXPRESSION(JspLexer.java:4864)
      at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2170)
      at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1947)
      at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1820)
      at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)
      at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)
      at weblogic.servlet.jsp.JspParser.parse(JspParser.java:234)
      at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
      at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
      at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:396)
      at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:246)
      at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:196)
      at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:598)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:406)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
      at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
      at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
      at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
>
just to be clear, the mentioned jsp DOES NOT HAVE any kink of java object; here is the page content:
<html>
<head>
<title>
</title>
</head>
<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"){
    closeWindow();
  }
  else{
    setTimeout('closeWindow()',5000);
  }
}
</script>
<body bgcolor="#ffffff" onload="loadPage();">
</body>
</html>
Any clue?
Thanks in advance
0
Comment
Question by:hanoirules
  • 2
4 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 17773536
Hi,

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...
http://dev2dev.bea.com/lpt/a/173

R.K
0
 

Author Comment

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

Accepted Solution

by:
sompol_kiatkamolchai earned 500 total points
ID: 17774116
Hi,

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.
Sompol
0
 

Author Comment

by:hanoirules
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.
Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now