?
Solved

why doesTomcat not recognize the script? but only treat is as "text"?

Posted on 2005-03-22
14
Medium Priority
?
195 Views
Last Modified: 2010-04-01
dear experts,

we just move to Tomcat 5.0.27 which seems have different configuration. after I move all the codes which work fine on another server (Tomcat 4) to this server, the Tomcat does not recognize my codes, instead, it shows <%=request....%> which means all the codes in <%% > was not compileed, but only treated as "text", why? thanks.
0
Comment
Question by:dodowoman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +1
14 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 13609104
Can you view the tomcat start page at:

http://localhost:8080

?

how's your codes look like?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13609402
yeah, I think you're going to have to post some example code...
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 13611348
One difference that I can recall between tomcat 4 and tomcat 5 is that its config file is not server.xml anymore. It creates different files for each web app.. Have you checked that part?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 35

Expert Comment

by:TimYates
ID: 13611461
THis sounds like a ropey install though...

As if the JSP compiler servlet isn't loading...
0
 

Author Comment

by:dodowoman
ID: 13612904
to ryancys,
this is not a local server, so I can't test that.

to Kuldeepchaturvedi,
based on the document I have seen, it is still server.xml for configuration. and each application has web.xml as before. but the parameters in server.xml don't look the same between different version.

to TimYates,
I think you are right that the JSP compiler servlet isn't loading. how do we check that, do you know? thanks.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13613024
Inside

    /tomcat/conf/web.xml

there should be a section for the JSP compiler servlet like this:

------------

  <!-- The JSP page compiler and execution servlet, which is the mechanism  -->
  <!-- used by Tomcat to support JSP pages.  Traditionally, this servlet    -->
  <!-- is mapped to URL pattern "*.jsp".  This servlet supports the         -->
  <!-- following initialization parameters (default values are in square    -->
  <!-- brackets):                                                           -->

... LOADS of comments snipped out ...

  <!-- If you wish to use Jikes to compile JSP pages:                       -->
  <!--   Set the init parameter "compiler" to "jikes".  Define              -->
  <!--   the property "-Dbuild.compiler.emacs=true" when starting Tomcat    -->
  <!--   by adding the above to your CATALINA_OPTS environment variable.    -->
  <!--   If you get an error reporting that jikes can't use UTF8 encoding,  -->
  <!--   try setting the init parameter "javaEncoding" to "ISO-8859-1".     -->

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

 ... then on the last page of the file ...

    <!-- The mapping for the JSP servlet -->
    <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13613035
I reckon either

a)  Someone's commented that bit out (or removed the file)

or

b)  Someone has stripped out the web.xml file thinking they were in WEB-INF inside a web application...
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 13613093
if its loading the jsp as a text file, this means.. server is up and running and recieving the request.
but intercepter is not working... so I go with Tim on it.. somebody messed up the web.xml...
try copying one from an up & running tomcat and see if that works...
0
 

Author Comment

by:dodowoman
ID: 13614602
thanks.
but, I created a WEB-INF under my application directory and put web.xml in it. I thought Tomcat will find the application web.xml before it loads the tomcat/conf/web.xml for all the server. is that right?
0
 
LVL 35

Accepted Solution

by:
TimYates earned 400 total points
ID: 13615557
No

tomcat web.xml first...

Try reinstalling Tomcat...  Or just get the conf/web.xml file out of a tomcat binary zip...
0
 

Author Comment

by:dodowoman
ID: 13634699
thanks to all. I finally get Tomcat to compile the codes. But, after I modified the /tomcat/conf/web.xml to add my servlet entry, and put this modified web.xml to myApplication/WEB-INF/ to be my application web.xml, I restart the server and got the following message:

Mar 25, 2005 2:58:47 PM org.apache.commons.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
      at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:505)
      at org.apache.commons.digester.Rule.end(Rule.java:276)
      at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.commons.digester.Digester.parse(Digester.java:1548)
      at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:263)
      at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:624)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
      at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
      at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
      at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:687)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:968)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
      at org.apache.catalina.core.StandardService.start(StandardService.java:480)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name invoker
      at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2234)
      at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2214)
      ... 48 more
Mar 25, 2005 2:58:47 PM org.apache.catalina.startup.ContextConfig applicationConfig
SEVERE: Parse error in application web.xml
java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name invoker
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
      at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.commons.digester.Digester.parse(Digester.java:1548)
      at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:263)
      at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:624)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
      at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
      at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
      at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:687)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:968)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
      at org.apache.catalina.core.StandardService.start(StandardService.java:480)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)
Mar 25, 2005 2:58:47 PM org.apache.catalina.startup.ContextConfig applicationConfig
SEVERE: Occurred at line 158 column 23
Mar 25, 2005 2:58:47 PM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
Mar 25, 2005 2:58:47 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Mar 25, 2005 2:58:47 PM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
Mar 25, 2005 2:58:47 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /127.0.0.1:8054
Mar 25, 2005 2:58:47 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=3/99  config=/www/test.screendb.med.harvard.edu/tomcat/conf/jk2.properties
Mar 25, 2005 2:58:47 PM org.apache.coyote.tomcat5.MapperListener registerEngine
WARNING: Unknown default host: localhost
Mar 25, 2005 2:58:47 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1984 ms
0
 
LVL 19

Assisted Solution

by:Kuldeepchaturvedi
Kuldeepchaturvedi earned 400 total points
ID: 13634982
above message means that the the entry you made in web.xml is not a correct one. System is not finding the servlet that you are asking him to find.. please check if the package name and servlet names are spelled correctly in your web.xml and web.xml is well formed
0

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

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

752 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