Confused about jrun-web.xml

G'day there
I'm hoping someone can clarify the *actual* purpose of the
[cf]/WEB-INF/jrun-web.xml file, and how CF uses it.
My understanding of it was that it was the
JRun-internal-webserver's
equivalent of Apache's httpd.conf, or IIS's... err...
whereever IIS stores
its config. Basically a web server configuration file. So if
one wasn't
actually USING the JRun webserver for a given web site, then
that file is
just ignored.
However that understanding is incorrect, it seems.
I have this sort of set-up on my dev machine's file system:
C:\webroots
\webapp1root
\lib
\subapp
\myCfc.cfc
\webapp2root
\lib
\subapp
\myCfc.cfc
And my IIS default website (I'm just running XP Pro, so only
one website @
a time) is set up to have either webapp1root or webapp2root
as its webroot,
depending on which I am working on, at a given moment in
time. And the
website also has a virtual directory to "subapp", called...
"subapp".
Currently I'm working on webapp1, so was bemused that when I
did this:
createObject("component", "subapp.myCfc")
I was getting an instance of
C:\webroots\webapp2root\lib\subapp\myCfc.cfc
created, instead of the webapp1 version.
I spent rather too long ballocksing around checking virtual
directories, CF
mappings and all that sort of palarver, only to eventualy
find that I had a
residual mapping in my jrun-web.xml file pointing to
webapp2root's subapp
directory.
Once I removed that: all good.
Now to me, jrun-web.xml should be completely irrelevant to
that mix, as I'm
not using the JRun web server.
So obviously it's NOT just a web server config file. WTF *is*
it?
I have read various docs on the Adobe website, but they all
seem to be
written for an audience who would already know what the
author is on about
(hence making the doc a bit of a waste of time, in my view),
and it's all
completely impenetrable for me, as I'm just a CF developer
and haven't got
a clue about the inner workings of JRun (and, to be frank:
I'd like to keep
it that way if poss... JRun knowledge is not exactly a
marketable skill
What am I missing here?
Adam

I didn't skip over that part, but I probably wasn't as clear
as I needed to be. web.xml (and jrun-web.xml) are deployment
descriptors for a J2EE web application. That actually has nothing
to do with a "web server", it has to do with telling the
application server (JRun, in this case), any information it needs
to deploy the web application (ColdFusion, in this case). The
jrun-web.xml file simply includes stuff that isn't apart of the
J2EE spec but JRun developers thought it helpful to add in.
Again, _it has nothing to do with the "web server" as you see
it_.
If you are using IIS as your frontend web server, you're
still using JRun, the Application Server. In order for the JRun
Application Server (_not_ the web server) to start, it looks at
certain files to determine what web applications to deploy and how
to deploy them. Those files are web.xml and jrun-web.xml, among
others. The reason they're named "web.xml" and "jrun-web.xml" is
because it's deploying a "J2EE
Web Application". It has absolutely nothing to do with a web
server (an application that listens on port 80 or 443 and responds
to HTTP requests).
Let's see if I missed anything from your post:
quote:
G'day there
I'm hoping someone can clarify the *actual* purpose of the
[cf]/WEB-INF/jrun-web.xml file, and how CF uses it.
My understanding of it was that it was the
JRun-internal-webserver's
equivalent of Apache's httpd.conf, or IIS's... err...
whereever IIS stores
its config. Basically a web server configuration file. So if
one wasn't
actually USING the JRun webserver for a given web site, then
that file is
just ignored.
Nope. It's not a "web server configuration file". It's a web
application deployment descriptor. Lots different. It all stems
from the fact that ColdFusion is nothing more than a J2EE web
application being deployed on JRun.
quote:
{snip}
Now to me, jrun-web.xml should be completely irrelevant to
that mix, as I'm
not using the JRun web server.
So obviously it's NOT just a web server config file. WTF *is*
it?
See my first post, and clarification at the top of this post
quote:
I have read various docs on the Adobe website, but they all
seem to be
written for an audience who would already know what the
author is on about
(hence making the doc a bit of a waste of time, in my view),
and it's all
completely impenetrable for me, as I'm just a CF developer
and haven't got
a clue about the inner workings of JRun (and, to be frank:
I'd like to keep
it that way if poss... JRun knowledge is not exactly a
marketable skill
What am I missing here?
I have no idea how that mapping got in there in the first
place, but this is standard J2EE deployment descriptor stuff. Most
other J2EE servers (BEA, Glassfish, JBoss, etc) all have a
server-specific ___-web.xml deployment descriptor that goes along
with each web app, telling the Application Server the information
it needs to deploy the web app.
So, to sum up:
jrun-web.xml is not a web server configuration file.
jrun-web.xml is a JRun-specific J2EE Web Application
deployment descriptor file.
J2EE Web Application deployment descriptor files have nothing
to do with a web server (an application that responds to HTTP
requests), though the web.xml and jrun-web.xml files do tell JRun
how to interpret the requests passed to it via the IIS ISAPI
filter.
I don't know how you got that mapping in there in the first
place.

Similar Messages

  • Virtual-mapping in jrun-web.xml file for CFIDE is not working

    I have put virtual-mapping for my web root into jrun-web.xml
    file. It looks like this:
    <virtual-mapping>
    <resource-path>/*</resource-path>
    <system-path>E:/WebSites/mywebroot</system-path>
    </virtual-mapping>
    So I need give virtual-mapping for my CFIDE too. It looks
    like this:
    <virtual-mapping>
    <resource-path>/CFIDE/*</resource-path>
    <system-path>E:/Apps/JRun4/servers/myserver/cfusion-ear/cfusion-war/CFIDE</system-path>
    </virtual-mapping>
    It is now working for me. When I use following url:
    http://localhost:8002/CFIDE/administrator
    I am getting "HTTP 404 - File not found". I have set it for
    other servers they are working on same server. What I did wrong
    this time?
    Thanks ahead.
    Mikenj

    Hi John,
    i did some some changes in Account dimension in my Planning Dev server. When i was migrating it to QA using LCM in shared services it is howing this error: Import failed for the following reason - Error parsing the deployment xml.
    First i define migration in Dev for export and the migration was successful.Then i went into QA shared services and started migration, i got this error for importing.
    Could you help me out on this?
    Regards,
    Shilpa

  • Odd message about web.xml

    I'm getting this message on the console of the WL9.0 Admin server when
    it starts up:
    <Aug 10, 2007 10:28:30 AM EDT> <Warning> <J2EE Deployment SPI>
    <BEA-260128> <Changes not allowed to DTD based descriptors. The
    attempt to modify property 'ServletName' in WEB-INF/weblogic.xml for
    module 'CES' will be vetoed if possible. The change will not be
    persisted in either case.>
    I don't get it. I use <servlet-name> three times in web.xml: twice in
    a <servlet> block and once in a <servlet-mapping> block. In
    weblogic.xml, I don't use <servlet-name" at all.
    I have no clue what the message is complaining about.
    Here's weblogic.xml:
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
    Application 8.1//EN"
    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app
    xmlns="http://www.bea.com/ns/weblogic/90"
    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
    http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
    <description>WebLogic Descriptor</description>
    <jsp-descriptor>
    <jsp-param>
    <param-name>packagePrefix</param-name>
    <param-value>gov.bls.idcf.ces.jsp_servlet</param-value>
    </jsp-param>
    <jsp-param>
    <param-name>workingDir</param-name>
    <param-value>/tmp</param-value>
    </jsp-param>
    <jsp-param>
    <param-name>compileCommand</param-name>
    <param-value>d:\Jikes\bin\jikes.exe</param-value>
    </jsp-param>
    </jsp-descriptor>
    </weblogic-web-app>
    Tim Slattery
    [email protected]
    http://members.cox.net/slatteryt

    Question: does it work?
    From my understanding this is not what you should do. The Welcome page is used when no specific page of the application is given in the url. It can either be a jspx page or a html page. A task flow may contain a page, but is not a page. From this definition I conclude that you should not do this.
    One other reason is that is you use security you secure a task flow (as a whole resource) and the welcome page is the entry point giving the use the ability to log in (so it is not secured). The welcome page might also be the landing page after a logout.
    Timo

  • (newbie) Question about replacing .class files and web.xml file

    I'm new to servlets and I have two quick questions...
    Do I absolutely need a web.xml file to define all my servlets, or can I simply place .class files into the WEB-INF directory and expect them to run?
    If my application server (for example Tomcat) is running and I replace a servlet .class file, do I need to restart the server for the new .class file to take effect?
    ...or are both of these questions specific to the application server I'm using?

    Hi,
    From an article I read:
    With Tomcat 3.x, by default servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory.
    A servlet could be accessed by simply using an url like this one:
    http://[domain]:[port]/[context]/servlet/[servlet full qualified name].
    The mapping was set inside the web application descriptor (web.xml), located under $TOMCAT_HOME/conf.
    With Tomcat 4.x the Jakarta developers have decided to stop allowing this by default. The <servlet-mapping> tag that sets this mapping up, has been commented inside the default web application descriptor (web.xml), located under $CATALINA_HOME/conf:
    <!-- The mapping for the invoker servlet -->
    <!--
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    -->
    A developer can simply map all the servlet inside the web application descriptor of its own web application (that is highly suggested), or simply uncomment that mapping (that is highly discouraged).
    It is important to notice that the /servlet/ isn't part of Servlet 2.3 specifications so there are no guarantee that the container will support that. So, if the developer decides to uncomment that mapping, the application will loose portabiliy.
    And declangallagher, I will use caution in future :-)

  • Question about web.xml

    So in my web.xml file (for Tomcat 5.5) I used to map a servlet like this:
    <servlet-mapping>
    <servlet-name>
    ServletName
    </servlet-name>
    <url-pattern>
    /servlet/ServletName
    </url-pattern>
    </servlet-mapping>and it wouldn't work. Now when I map it like this:
    <servlet-mapping>
    <servlet-name>
    ServletName
    </servlet-name>
    <url-pattern>
    /servlet/*
    </url-pattern>
    </servlet-mapping>it works just fine. Can anyone explain to me why this is since I've seen web.xml files that don't use the /* for the dir. location?
    Thanks in advance.

    I posted this too soon. Using that 'wild card' it grabs the last servlet mapped in web.xml. So I commented everything out and left the file with the following(I used '*' just to keep stuff private):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
        <display-name>DISPLAY NAME</display-name>
        <description>
         DISPLAY NAME
        </description>
       <servlet>
    <servlet-name>SignIn</servlet-name>
        <servlet-class>lmt.SignIn</servlet-class>
    <init-param>
          <param-name>url</param-name>
          <param-value>jdbc:mysql://localhost/********</param-value>
        </init-param>
        <init-param>
          <param-name>**********</param-name>
          <param-value>*******</param-value>
        </init-param>
        <init-param>
          <param-name>********</param-name>
          <param-value>***********</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>
    SignIn
    </servlet-name>
    <url-pattern>
    /servlet/SignIn
    </url-pattern>
    </servlet-mapping>
    </web-app>This is will not locate the servlet.
    I get a 404 with this message: "type Status report
    message /servlet/SignIn/
    description The requested resource (/servlet/SignIn/) is not available.
    I really have no idea what's wrong here. Is there a problem with some configuration elsewhere? Thanks again.

  • About Tomact's Web.xml file

    Starting service Tomcat-Standalone
    Apache Tomcat/4.0.1
    PARSE error at line 38 column 11
    org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,
    distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page
    *,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
    Starting service Tomcat-Apache
    Apache Tomcat/4.0.1
    I am getting this message when i keep web.xml file in web-inf folder.that is after starting tomcat.

    Hi
    The elements in web.xml file must follow a specific order, it the one tomcat prints in the error-message. (It should also tell THIS IS THE REQUESTED ORDER)
    I made the same problem before... ;)
    Made you have a <servlet-mapping> tag before a <servlet> tag? That is not correct! Hope this solves your problems. :)
    /Tobias

  • Using security-constraint in web.xml; not recognizing url-pattern tag

    I am creating a very simple jsp application within JDeveloper 10.1.3.1. I have 2 jsp files...a readData.jsp and a maintainData.jsp. I would like to deploy this application to Oracle Application Server 10.1.2.2. I would like to use Oracle Internet Directory with Single Sign on enabled. The deployment to OAS works fine. For the security, I would like an administrator user to get to both pages...and a user to only be able to see the readData.jsp. I used the security constraints on the properties of the web.xml file within JDeveloper. Here is my web.xml file:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>adm_full_access</web-resource-name>
    <url-pattern>*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>adm_all</role-name>
    </auth-constraint>
    </security-constraint>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>usr_access</web-resource-name>
    <url-pattern>readData.jsp</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>usr_all</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    <security-role>
    <role-name>usr_all</role-name>
    </security-role>
    <security-role>
    <role-name>adm_all</role-name>
    </security-role>
    </web-app>
    When I deploy to OAS I added an OID account to the adm_all role...this works fine I can log on as that user and get to both jsps. But, when I add my user to the usr_all role within OAS I try to log on to the app...I then enter my SSO username and password and I get Access Denied errors from my browser when trying to access either page. I am confused about the <url-pattern> tag...is that relative to a directory within my deployment? Most of the examples I have seen use servlets...so I was wondering if I can even use the <url-pattern> tag to restrict/allow access to individual jsps? If someone could point me to some documentation on this set-up I would appreciate it!
    Thank you.

    I was able to get this to work. By doing the following:
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>adm_full_access</web-resource-name>
    <url-pattern>*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>adm_all</role-name>
    </auth-constraint>
    </security-constraint>
    I was restricting access to all other groups by uisng <url-pattern>*</url-pattern>. Any other security-constraints set-up after that will not work. So saying * requires usr_all will restrict ALL webpages to ONLY adm_all, regardless of what future constraints say. So, my first security-constraints lists all directories or pages that every user can access. My next security-constraint then list resources that only my admins (adm_all) can acess. Any other security constraints then are set-up for each user role that I have...if adm_all should have access to these then the <role-name>adm_all</role-name> is added to each security constraint.

  • Client-cert auth impl in web.xml does not work in Oracle Application Server

    Hi,
    I am new to implementing security features on the web applications.. I have developed a new web service using jdev1012 and deployed in OAS 10.1.2. Its working fine according to the business requirements, but I am in need of implementing client-cert authentication to enable the web service available to only those who have client certificate.
    My server details are:
    Oracle Application Server 10g Release 2 (10.1.2)
    Server certificate is in place and SSL mode have been already enabled.. able to access my web service through https://<mydomain.com>/myws/TreqWS as well able to see the WSDL file through https://<mydomain.com>/myws/TreqWS?WSDL.
    I tried to include the following in my web.xml file as part of implementing CLIENT-CERT authentication.
    <security-constraint>
    <display-name>SecurityConstraint</display-name>
    <web-resource-collection>
    <web-resource-name>WSCollection</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    <login-config>
    <auth-method>CLIENT-CERT</auth-method>
    <realm-name>WSCollection</realm-name> <!-- am not sure about this realm-name and its purpose -->
    </login-config>
    It is not woking as expected, though I have restarted my oc4j container after including this content to the web.xml file. i.e, I am able to invoke the web service though my sample java client program, though I donot have client certificate/keystore.
    I believe I am missing something..Can anyone help me in this regard to implement CLIENT-CERT authentication successfully?
    Thanks,
    Ms

    I am having the same problem with doc and xsl. I have added this
    <mime-mapping>
    <extension>xls</extension>
    <mime-type>application/vnd.ms-excel</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>doc</extension>
    <mime-type>application/msword</mime-type>
    </mime-mapping>
    to my web.xml. I even restarted the server. I still see doc and xsl in binary.
    Is there some other setting that needs to take place?
    I am using WL6.1 with fixpack 1.
    I can see the doc and excel files in the browser if I don't go through the weblogic
    server. That just confirms it's not my browser.
    Kumar Allamraju <[email protected]> wrote:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    It works fine for me in 6.1 SP1.
    <br><br>
    If the following doesn't work , can you
    <br>try application/winword instead of application/msword?
    <p>--
    <br>Kumar
    <p>Siming Mu wrote:
    <blockquote TYPE=CITE>Hi,
    <p>I setup in my web.xml a mime mapping as follows,
    <p><mime-mapping>
    <br><extension>doc</extension><mime-type>application/msword</mime-type>
    <br></mime-mapping>
    <p>When I specify a test.doc url, the doc file appears in my browser
    as
    binary data
    <br>instead of download.
    <p>Please reference change request 055002, which decribes this problem. 
    According
    <br>to edocs, it has been fixed in wls6.1sp1.
    <p>But I am seeing it fixed.  Am I doing anything wrong? Thanks.
    <p>Siming</blockquote>
    </html>

  • Access custom variable value in web.xml context-param?

    My requirement or need is to access a variable value either in a class in my Model project or a backing bean in my View project. For example, one variable I need to access is an application server I am integrating with - 'testserver' or 'productionserver' - I want to be able to configure this within an external file so that I do not have to re-compile my application to change the variable.
    I was thinking about placing this variable in the web.xml <context-param> section as:
    <context-param>
    <param-name>servername</param-name>
    <param-value>testserver</param-value>
    </context-param>
    I need to access this value within a class (not a servlet) on an Application Module service method, though if needed, I could access it from a backing bean and pass it to the service method (less desirable.) Is this a good approach and how do access this variable from within a Java class including any imports I need to do (code example)?
    Thanks and Happy New Year!
    Hopefully most everyone is out spending time with friends and family versus stuck trying to complete a project like me...

    I found an example from SRDemo that provides what I was looking for:
    String serverhostaddress =
    FacesContext.getCurrentInstance().getExternalContext().getInitParameter("param-name-var-in-webxml");

  • Confuse about the injecting entity in EJB 3.0?

    Hi all,
    I have an customersBean which is inherit from customersRemote and my problem is i' am little confuse about injecting the entity(customer).
    Where can you apply the EntityManagerFactory is it outside on EJB or Inside the EJB? means outside EJB is use the web application or java application. i have and example.
    this is inside on EJB...............
    public class CustomersBean implements com.savingsaccount.session.CustomersRemote {
    @PersistenceContext(unitName="SavingAccounts")
    EntityManagerFactory emf;
    EntityManager em;
    /** Creates a new instance of CustomersBean */
    public CustomersBean() {
    public void create(int id, String name, String address, String telno, String mobileno)
    try{
    //This is the entity.
    Customer _customer = new Customer();
    _customer.setId(id);
    _customer.setName(name.toString());
    _customer.setAddress(address.toString());
    _customer.setTelno(telno.toString());
    _customer.setMobileno(mobileno.toString());
    em = emf.createEntityManager();
    em.persist(_customer);
    emf.close();
    }catch(Exception ex){
    throw new EJBException(ex.toString());
    in web application, i'm using the @EJB in customer servlets.
    public class CustomerProcessServlet extends HttpServlet {
    @EJB
    private CustomersRemote customerBean;
    blah blah inject directly coming request field from jsp.
    }

    Hi all,
    I have an customersBean which is inherit from customersRemote and my problem is i' am little confuse about injecting the entity(customer).
    Where can you apply the EntityManagerFactory is it outside on EJB or Inside the EJB? means outside EJB is use the web application or java application. i have and example.
    this is inside on EJB...............
    public class CustomersBean implements com.savingsaccount.session.CustomersRemote {
    @PersistenceContext(unitName="SavingAccounts")
    EntityManagerFactory emf;
    EntityManager em;
    /** Creates a new instance of CustomersBean */
    public CustomersBean() {
    public void create(int id, String name, String address, String telno, String mobileno)
    try{
    //This is the entity.
    Customer _customer = new Customer();
    _customer.setId(id);
    _customer.setName(name.toString());
    _customer.setAddress(address.toString());
    _customer.setTelno(telno.toString());
    _customer.setMobileno(mobileno.toString());
    em = emf.createEntityManager();
    em.persist(_customer);
    emf.close();
    }catch(Exception ex){
    throw new EJBException(ex.toString());
    in web application, i'm using the @EJB in customer servlets.
    public class CustomerProcessServlet extends HttpServlet {
    @EJB
    private CustomersRemote customerBean;
    blah blah inject directly coming request field from jsp.
    }

  • Need api for changing security role in web.xml !!

    My requirement is to change the value of the deployment descriptor "security-role" (in web.xml) through an api and inturn to persist the new value in web.xml. Also I need to know if this change is automatically redeployed or an explicit redeployment is needed ? In that case how do I redeploy using an api call ?
    I found a lot of apis related to roles like createRole, removeRole etc.. But there are no apis to change the name of the role and inturn persist in web.xml.
    Do I need to provide any more information ? Let me know
    Thanks,
    Karthick

    why and when do you change security-role? try to use ant task (perhaph you need xpath also). it´s the better when you perform task about life´s cycle of application.
    please, describe your problem.
    of course in you change web.xml you must restart the application.

  • Use of jsp-file in web.xml

    hello
    can anybody explain about , when we need <jsp-file> in web.xml
    and why we use this tag in place of <url-pattern>?

    If you want to declare a JSP in your web.xml file you use the jsp-file tag instead of the servlet-class tag. Normally there is no need to declare a JSP in the web.xml file unless you want to use init-params.
    Usually people can access a JSP directly wether it is declared in the web.xml or not. So it is not that the jsp-file tag replaces the url-pattern tag so much as the url-pattern tag is not needed for a JSP. However notthing prevents you from declaring the JSP in the web.xml and then mapping the JSP to a different url that doesn't end in '.jsp'.

  • Web.xml parsing error

    Hello,
    I am a newbie to servlet programming. I am using Tomcat4.1.24. When I
    am trying out some examples, I got a bunch of parsing errors. After double-checking my web.xml, I still do not see why it caused so many parsing errors. I am using NotePad to edit web.xml, does that affect this? These errors are always about the last line and the last column.
    Very weird. Please help.
    web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    <servlet>
         <servlet-name>HelloWorld</servlet-name>
         <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet>
         <servlet-name>Primes</servlet-name>
         <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>
    [ERROR] Digester - -Parse Error at line 29 column 11: The content of element typ
    e "web-app" must match "(icon?,display-name?,description?,distributable?,context
    -param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-conf
    ig?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resou
    rce-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,e
    jb-local-ref*)". <org.xml.sax.SAXParseException: The content of element type "we
    b-app" must match "(icon?,display-name?,description?,distributable?,context-para
    m*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,m
    ime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-r
    ef*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-lo
    cal-ref*)".>

    Hi.
    The answer is rather simple. The file is not valid against the XML v.1.0 standard. That's because all <servlet> elements must come first before all <servlet-mapping> elements. If you change the order of the Primes <servlet> element, the file is valid and Tomcat should not throw an exception.
    This is the correct web deployment descriptor:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>Primes</servlet-name>
    <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>

  • error-page in web.xml not working

    In my web.xml I have
    <error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
    <location>/error.jsp</location>
    </error-page>
    I checked the page works by doing a /context/error.jsp and
    the page displays fine (it is a simple jsp page).
    I hit a struts action that gives me this in the std output.
    06/29 10:48:24 error
    [1]java.lang.NullPointerException
    at
    com.pearson.gs.cms.business.LoginService.verifyPassword(LoginService.java:232)
    at
    com.pearson.gs.cms.action.LoginAction.performCMSAction(LoginAction.java:92)
    at
    com.pearson.gs.cms.action.BaseCMSAction.execute(BaseCMSAction.java:48)
    at
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    at
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
    jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    [0]javax.servlet.ServletException
    at
    org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
    at
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
    at
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
    jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    I get a 500 error page instead of my /error.jsp page.
    I tried adding
    <error-page>
    <error-code>500</error-code>
    <location>/error.jsp</location>
    </error-page>
    but that doesn't work either.
    JRun 4.0
    Updater 6
    JDK 1.4.2
    Struts 1.2.8
    Any ideas what to try?

    a. Override your skeletons error.jsp to forward/redirect to your page.
    or
    b. If you primarily use pageflow portlets Define a shared flow which has an exception handling method and direct it to your page. Reference the shared flow in each of your controllers (i think global.app is deprecated in 10 otherwise you could do this there). this lets you log some additional information, plus gives you the added flexibility of dealing with different exception types
    or
    c. Override the path to error.jsp in your portlets properties (havent tested)
    Note if you are using servlets etc you still need your web.xml java.lang.Exception entry. The reason it doesnt get picked up is because the portal framework is handling the exception
    Edited by: deepshet on Dec 22, 2008 8:12 PM

  • Parse error in web.xml

    hello friends,
    When i implement my project in to tomcat server ..... It raises this exception in web.xml pls help me.........
    i have given below......
    Thanks in advance....
    Sep 6, 2008 10:16:53 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
    SEVERE: Parse error in application web.xml file at jndi:/localhost/hatsunSMS/WEB-INF/web.xml
    java.net.NoRouteToHostException: No route to host
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.Socket.connect(Socket.java:519)
    at java.net.Socket.connect(Socket.java:469)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
    at sun.net.www.http.HttpClient.New(HttpClient.java:306)
    at sun.net.www.http.HttpClient.New(HttpClient.java:323)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:352)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1044)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    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:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Sep 6, 2008 10:16:53 AM org.apache.catalina.startup.ContextConfig start

    Hi.
    Please re-read your stacktrace and then have a look at http://java.sun.com/j2se/1.4.2/docs/api/java/net/NoRouteToHostException.html.
    Then, take your time to think about it again.
    Bye.

Maybe you are looking for

  • Results and a Procedure for SSD Upgrade on T410s

    After finding that my T410s 1.8" hard drive was 35% - 60% slower than the variety of 2.5" SATA Hard Drives in my older Thinkpads, I selected a Kingston SSDNow V+180 128GB for $219 for the SSD upgrade from Amazon because this Kingston model had the be

  • Issue with using Dropdown in Adobe forms

    Hi Gurus, I am facing an issue with dropdown values after binding with a field in a table, The first value in the dropdown is getting replaced by the selected value in dropdown in interactive adobe form. Has any one come across this issue. Please gui

  • I need help with my new LG G2. I dial *611 but it will not recognize my phone number

    I am having trouble setting up my new LG G2. When I dial *611, it will not recognize my number, and the 800 number refers me back to the *611 number. There is no live chat available on the website, so I am lost. Is this any way to run customer suppor

  • Hello , I have iphone 4 , its from austrellia , i have unlocked it using IEMI no.

    Hello , I have iphone 4 , its from austrellia , i have unlocked it using IEMI no. but it shows SOS only. i am not getting whether my iphone is unlocked or not. n also when i inset any sim card it shows message like sim failure. SO, can anyone tell me

  • Error Restoring iPhone

    My iPhone is stuck at the "apple" screen, and I can only turn it on and off by holding down the on/off and select buttons. It won't do anything else. I've read various threads here, and tried Apple's step-by-step help for a stuck iPhone, but I still