Undo undeploying in Tomcat?

hi,
is it possible to undo the undeploying of applications in Tomcat? I mean, is the application still stored somewhere in the server after undeploying it?
thanks.

AzulInNorway wrote:
hi,
is it possible to undo the undeploying of applications in Tomcat? I mean, is the application still stored somewhere in the server after undeploying it?
thanks.I sincerely doubt it, and would absolutely hope undeploying means what the word says. A true undeployment, not leaving some clutter lying around indefinitely.

Similar Messages

  • Deploying servlet on Tomcat using "ant install" not working. Please help.

    Hello. Normally I can find answers by using search, but I can't today for some reason. So please bare with me if this has been mentioned before. I will try to provide as much info as possible so that helping me isn't too much a chore. Thank you.
    I have downloaded and installed the JWSDP 1.3. and Tomcat is running. I am also using Ant 1.5.4 (previous installation - not one included with JWSDP) and modeled my build.xml file after the template provided here:
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt.
    When I run ant on my respository, everything builds fine. But when I run Ant with the install target, I get the following error:
    BUILD FAILED
    file:C:/owl/build.xml:366: java.io.IOException: Server returned HTTP response co
    de: 401 for URL: http://localhost:8080/manager/deploy?path=%2Fowl&war=file%3A%2F
    %2FC%3A%5Cowl%2Fbuild
    Here is line 366 build.xml:
    localWar="file://${build.home}"/>
    ...which is included in this block for the target "install":
    <target name="install" depends="compile"
    description="Install application to servlet container">
    <deploy url="${manager.url}"
    username="${manager.username}"
    password="${manager.password}"
    path="${app.path}"
    localWar="file://${build.home}"/>
    </target>
    When I point my brower to the url located in the error verbose, I get the following:
    FAIL - Encountered exception java.lang.NullPointerException
    I am trying to get my environment set up correctly before I start spending time developing servlets, but I am getting tempted to just develop to servlets and "manually" installing/deploying them either by copying and pasting or by using the Tomcat manager. I would really like to do everything from Ant though if possible. Please help.

    I don't think this is at all correct:
    localWar="file://${build.home}"/>You've got to create a real WAR file - a JAR file with WEB-INF and all its minions inside it:
    http://access1.sun.com/techarticles/simple.WAR.html
    That's the file you need to refer to there. You can manage that with Ant too, of course.
    Here's what my Ant build.xml looks like for Web apps (there's a build-web.properties file that follows):
    build-web.xml
    <project name="Tomcat Build Tasks" default="clean" basedir=".">
        <target name="init-props">
            <tstamp>
                <format property="touch.time" pattern="MM/dd/yyyy hh:mm aa" />
            </tstamp>
            <filterset id="ant.filters">
                <filter token="DATE" value="${TODAY}" />
                <filter token="TIME" value="${TSTAMP}" />
            </filterset>
            <!-- Load in all the settings in the properties file -->
            <property file="build.properties" />
            <!-- Load in all Tomcat settings in the properties file -->
            <property file="build-web.properties" />
        </target>
        <target name="prepare" depends="init-props">
            <mkdir dir="${war.classes}"/>
            <mkdir dir="${war.lib}"/>       
            <mkdir dir="${manifest}" />
        </target>
        <target name="clean" depends="init-props" description="clean up temporary files">
            <delete file="${project}.war" />   
            <delete dir="${war.root}"/>
            <delete dir="${manifest}" />
        </target>
        <target name="set-tomcat-classpath" depends="prepare">
            <path id="tomcat.class.path">                  
                <fileset dir="${tomcat.home}/bin">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${tomcat.home}/shared/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${tomcat.home}/common/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${tomcat.home}/server/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${ant.home}/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
            </path>              
        </target>
        <target name="create" depends="set-tomcat-classpath" description="create the war file">
            <!-- All files at root level -->       
            <!-- Temporarily put the JSPs at root until you figure this out -->
            <copy todir="${war.root}">
                <fileset dir="${src.jsp}"/>
            </copy>
    <!--
            <copy todir="${war.root}">
                <fileset dir="${src.html}" includes="*.html"/>
            </copy>
    -->
            <copy todir="${war.root}/css">
                <fileset dir="${src.css}"/>
            </copy>
            <copy todir="${war.root}/images">
                <fileset dir="${src.images}"/>
            </copy>
            <copy todir="${war.root}/js">
                <fileset dir="${src.js}"/>
            </copy>
            <!-- All files at the WEB-INF level and below -->       
            <copy todir="${war.web}">
                <fileset dir="${src.etc}" includes="web.xml"/>
            </copy>
            <!-- All files in the CLASSPATH lib -->
            <copy todir="${war.web}/lib">
                <fileset dir="${src.lib}" includes="**/*.jar" excludes="**/*-tests.jar, **/junit.jar"/>
            </copy>
            <!-- Put the dispatcher XML in WEB-INF/config -->
            <copy todir="${war.web}/config">
                <fileset dir="${src.etc}" includes="${project}-config.xml"/>
            </copy>
            <!-- Put XSL stylesheets in WEB-INF/xsl -->
            <copy todir="${war.web}/xsl">
                <fileset dir="${src.xsl}" includes="**/*.xsl"/>
            </copy>
            <!-- Put the project JAR file in WEB-INF/lib -->
            <copy todir="${war.web}/lib">
                <fileset dir="${deploy}" includes="**/${project}.jar"/>
            </copy>
            <!-- Create the manifest -->
            <buildnumber />
            <manifest file="${manifest}/manifest.mf">
                <attribute name="Implementation-Title"      value="${project}" />
                <attribute name="Built-By"                  value="${user.name}"/>
                <attribute name="Build-Date"                value="${TODAY}" />
                <attribute name="Major-Version"             value="${major}" />
                <attribute name="Minor-Version"             value="${minor}" />
                <attribute name="Build-Number"              value="${build.number}" />
            </manifest>
            <!-- Create the WAR file -->
            <jar jarfile="${project}.war"
                 manifest="${manifest}/manifest.mf">
                <fileset dir="${war.root}"/>
                <metainf dir="${src.etc}" includes="context.xml"/>
            </jar>
        </target>
        <target name="create-tomcat-admin-tasks" depends="set-tomcat-classpath">
    <!--
            <pathconvert targetos="windows" refid="tomcat.class.path" property="converted.class.path" />
            <echo message="CLASSPATH: ${converted.class.path}" />
    -->       
            <taskdef name="install"     classname="org.apache.catalina.ant.InstallTask"     classpath="tomcat.class.path"/>
            <taskdef name="remove"      classname="org.apache.catalina.ant.RemoveTask"      classpath="tomcat.class.path"/>       
            <taskdef name="reload"      classname="org.apache.catalina.ant.ReloadTask"      classpath="tomcat.class.path"/>
            <taskdef name="deploy"      classname="org.apache.catalina.ant.DeployTask"      classpath="tomcat.class.path"/>       
            <taskdef name="undeploy"    classname="org.apache.catalina.ant.UndeployTask"    classpath="tomcat.class.path"/>       
            <taskdef name="start"       classname="org.apache.catalina.ant.StartTask"       classpath="tomcat.class.path"/>       
            <taskdef name="stop"        classname="org.apache.catalina.ant.StopTask"        classpath="tomcat.class.path"/>       
            <taskdef name="list"        classname="org.apache.catalina.ant.ListTask"        classpath="tomcat.class.path"/>       
            <taskdef name="resources"   classname="org.apache.catalina.ant.ResourcesTask"   classpath="tomcat.class.path"/>       
            <taskdef name="roles"       classname="org.apache.catalina.ant.RolesTask"       classpath="tomcat.class.path"/>
        </target>
        <target name="install" depends="create-tomcat-admin-tasks" description="install the war file on Tomcat">
            <install    url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}"
                        config="file:/${basedir}/${src.etc}/context.xml"
                        war="file:/${basedir}/${project}.war" />
        </target>
        <target name="remove" depends="create-tomcat-admin-tasks" description="remove the war file on Tomcat">
            <remove     url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="reload" depends="create-tomcat-admin-tasks" description="reload the war file on Tomcat">
            <reload     url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="deploy" depends="create-tomcat-admin-tasks" description="deploy the war file on Tomcat">
            <deploy    url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}"
                        config="file:/${basedir}/${src.etc}/context.xml"
                        war="file:/${basedir}/${project}.war" />
        </target>
        <target name="undeploy" depends="create-tomcat-admin-tasks" description="undeploy the war file on Tomcat">
            <undeploy   url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="start" depends="create-tomcat-admin-tasks" description="start an application on Tomcat">
            <start      url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}"/>
        </target>
        <target name="stop" depends="create-tomcat-admin-tasks" description="stop an application on Tomcat">
            <stop       url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="list" depends="create-tomcat-admin-tasks" description="list all applications running on Tomcat">
            <list       url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"/>
        </target>
        <target name="resources" depends="create-tomcat-admin-tasks" description="list all resources on Tomcat">
            <resources  url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"/>
        </target>
        <target name="data-sources" depends="create-tomcat-admin-tasks" description="list all data sources on Tomcat">
            <resources  url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        type="javax.sql.DataSource"/>
        </target>
        <target name="roles" depends="create-tomcat-admin-tasks" description="list all user roles on Tomcat">
            <roles      url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"/>
        </target>
    </project>
    build.properties
    # Properties file for setting up an Ant build.xml
    # Project specific items that change each time
    project=api-prototype
    major=1
    minor=0
    version=${major}.${minor}
    jar.name=${project}
    versiondate=${TODAY}
    # Directory structure (these should never change)
    bin=bin
    deploy=deploy
    doc=doc
    manifest=META-INF
    xml=xml
    # Everything under src should come out of a repository
    src=src
    src.bin=${src}/bin
    src.config=${src}/config
    src.data=${src}/data
    src.dtd=${src}/dtd
    src.java=${src}/java
    src.lib=${src}/lib
    src.profile=${src}/profile
    src.properties=${src}/properties
    src.schema=${src}/schema
    src.sql=${src}/sql
    src.templates=${src}/templates
    src.testdata=${src}/testdata
    src.xml=${src}/xml
    src.xsl=${src}/xsl
    # These are created and deleted by Ant each time
    javadocs=javadocs
    reports=reports
    output=output
    output.classes=${output}/classes
    output.lib=${output}/lib
    # Required for proper use of XDoclet
    xdoclet.home = C:/Tools/xdoclet-1.2b3
    build-web.properties
    war.root=war-root
    war.pages=${war.root}/pages
    war.web=${war.root}/WEB-INF
    war.classes=${war.web}/classes
    war.css=${war.web}/css
    war.js=${war.web}/js
    war.lib=${war.web}/lib
    war.tld=${war.web}/tld
    # Properties needed by Tomcat tasks
    ant.home =
    tomcat.home         =
    tomcat.manager.url  = http://localhost:8080/manager
    tomcat.username     =
    tomcat.password     = MOD

  • Memory leak on application undeploy.

    We're creating a Spring-based web app that is using a Tomcat 7.0.33 managed Oracle database pool. We're using the ojdbc6.jar to connect (Oracle 10g but migrating to 11g later).
    When our application is undeployed in Tomcat we get probable memory leak warnings (see below). After several re-deploys we inevitably run out of PermGen space. I've tried using the ojdbc14 drivers and they didn't seem to have this problem. But we're moving to 11g so we can't use them. I have tried adding a ContextListener that closes the DBCP pool on destroy but that didn't help any. Is this a bug in the Oracle drivers? Is there any way we can mitigate this?
    17505 INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'myManager'
    17515 INFO org.apache.tiles.access.TilesAccess - Removing TilesContext for context: org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory$SpringWildcardServletTilesApplicationContext
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1468544]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@d73b31]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@13aae39]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:29 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
    SEVERE: The web application [myApp] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@18443b1]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
    Dec 06, 2012 6:41:34 PM org.apache.catalina.startup.HostConfig deleteRedeployResources
    INFO: Undeploying context [myApp]

    Nevermind - It figures just after I post this I find the solution. And naturally it's not a bug in the ojdbc6.jar drivers. :-)
    It turns out our application was also including ojdbc6.jar in WEB-INF/lib. This caused Tomcat to use our jar for connections and thus the leak was formed. So not deploying ojdbc6.jar with our application (marking it as "provided" in pom.xml) lets Tomcat manage the connections and clean-up our app.

  • Need help finding whats wrong with my servlet

    I've been trying to create a simple login page following the tutorial found http://www.roseindia.net/mysql/loginauthentication.shtml
    There is a single JSP (AuthenticateLogin.jsp) and a servlet (LoginAuthentication.java). Basically what has to happen is the user enters the login information in the JSP which sends these info to the servlet. The servlet checks whether the username and password exist in the table and if they do it displays the user if not it says to that the username and/or password is invalid. I'm using IntelliJ IDEA as the IDE, Tomcat as the application server and MySQL 5.0.18 for the database. I'm also using Ant as a build tool.
    The following are my code:
    AuthenticateLogin.jsp
    <head>
         <title>Login Page</title>
         <script type="text/javascript">
              function validate() {
                   var user = document.frm.user
                   var pass = document.frm.pass
                   if ((user == null) || (user == "")) {
                        alert("Please enter a username")
                        user.focus()
                        return false
                   if ((pass == null) || (pass == "")) {
                        alert("Please enter a password")
                        pass.focus()
                        return false
         </script>
    </head>
    <body>
    <form name="frm" action="LoginAuthentication" method="post" onsubmit="return validate()">
         Name:       <input type="text" name="user"/>
         <br/>
         Password:   <input type="text" name="pass" />
         <br />
         <input type="submit" value="Sign in"/>     
         <input type="reset" value="Reset"/>
    </form>
    </body>
    </html>{code}
    LoginAuthentication.java
    {code:java}import java.io.*;*
    *import java.sql.*;
    import javax.servlet.*;*
    *import javax.servlet.http.*;
    public class LoginAuthentication extends HttpServlet {
         private ServletConfig config;
         public void init (ServletConfig config) throws ServletException {
              this.config = config;
         public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
              PrintWriter out = response.getWriter();
              String connectionUrl = "jdbc:mysql://192.168.0.95:3306/loginTester";
              Connection connection = null;
              ResultSet rs;
              String userName = new String("");
              String passwrd = new String("");
              response.setContentType("text/html");
              try {
                   Class.forName("com.mysql.jdbc.Driver");
                   connection = DriverManager.getConnection(connectionUrl, "root", "");
                   String sql = "select user, password from user";
                   Statement s = connection.createStatement();
                   s.executeQuery(sql);
                   rs = s.getResultSet();
                   while (rs.next()) {
                        userName = rs.getString("user");
                        passwrd = rs.getString("password");
                   rs.close();
                   s.close();
              } catch (Exception e){
                   System.out.println("Exception thrown: ["+e+"}");
              if (userName.equals(request.getParameter("user")) && passwrd.equals(request.getParameter("pass"))) {
    //               response.sendRedirect("http://localhost:8080/xplanner_reports/");
                   out.println("Hello"+userName);
              } else {
                   out.println("Please enter a valid username and password");
                   out.println("<a href='AuthenticateLogin.jsp'><br/>Login again</a>");
    }{code}
    web.xml
    {code:java}<?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                 version="2.5">
         <welcome-file-list>
              <welcome-file>AuthenticateLogin.jsp</welcome-file>
         </welcome-file-list>
         <servlet>
              <servlet-name>LoginAuthentication</servlet-name>
              <servlet-class>LoginAuthentication</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>LoginAuthentication</servlet-name>
              <url-pattern>/LoginAuthentication</url-pattern>
         </servlet-mapping>
    </web-app>
    </web-app>{code}
    The problem I'm facing is the validation (checking whether the username and password match to those in the database) isn't working properly. No matter what I enter as the username and password (even if it is the correct pair) it always shows as my username and/or password is invalid. When I check the tomcat (catalina) log the following entry was found:
    {code:java}Exception thrown: [java.lang.ClassNotFoundException: com.mysql.jdbc.Driver}{code}
    Could someone please show me what I could be doing wrong here? It would be a great help.  Spent a day trying to figure this out :no:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    How could I add it to my classpath from Idea?
    By the way the following is my build.xml (ant build file)
    <project name="LoginForm" basedir=".">
        <property name="app.name" value="LoginForm"/>
        <property name="src.dir" location="src"/>
        <property name="build.dir" location="build"/>
        <property name="build.webinf.classes.dir" location="${build.dir}/WEB-INF/classes"/>
        <property name="web.dir" location="web"/>
        <property name="dist.dir" location="dist"/>
        <property name="lib.dir" location="lib"/>
        <property name="tomcat.home" location="/home/ruzaik/software/tomcat/apache-tomcat-5.5.20"/>
        <property name="tomcat.url" value="http://localhost:8080/manager"></property>
        <property name="tomcat.username" value="tomcat"/>
        <property name="tomcat.passward" value="tomcat"/>
        <property name="appserver.deploy.dir" location="${tomcat.url}/webapps"></property>
        <property name="war.file" value="${app.name}.war"/>
        <import file="${tomcat.home}/bin/catalina-tasks.xml"/>
        <path id="project.classpath">
            <dirset dir="${build.dir}"/>
            <fileset dir="${lib.dir}">
                <include name="**/*.jar"/>
            </fileset>
        </path>
        <target name="clean" description="Cleans directories">
            <delete dir="${build.dir}"/>
            <delete dir="${dist.dir}"/>
        </target>
        <target name="init" depends="clean" description="Creates directories">
            <mkdir dir="${build.dir}"/>
            <mkdir dir="${build.webinf.classes.dir}"/>
            <mkdir dir="${dist.dir}" />
        </target>
        <target name="compile" depends="init">
            <javac srcdir="${src.dir}" destdir="${build.webinf.classes.dir}">
                <classpath refid="project.classpath"/>
            </javac>
        </target>
        <target name="copy" description=" : Copy the content of web in to build directoy">
            <copy todir="${build.dir}" preservelastmodified="yes" overwrite="yes">
                <fileset dir="${web.dir}">
                    <include name="**/*"/>
                    <exclude name="**/*.bak"/>
                </fileset>
            </copy>
        </target>
        <target name="war" depends="compile, copy" description=" : Create a war file for deploying">
            <jar destfile="${dist.dir}/${app.name}.war" update="false" compress="true">
                <fileset dir="${build.dir}">
                    <include name="**/*"/>
                </fileset>
            </jar>
        </target>
        <target name="install">
            <deploy url="${tomcat.url}" username="tomcat" password="tomcat" path="/LoginForm"
                    war="${dist.dir}/${war.file}">
            </deploy>
        </target>
        <target name="uninstall">
            <undeploy url="${tomcat.url}" username="tomcat" password="tomcat" path="/LoginForm">
            </undeploy>
        </target>
    </project>and my directory structure could be found here http://img407.imageshack.us/img407/1594/tempf.png
    I think I"ve added it to the classpath.

  • Weblogic tunning garbage collection

    Hi
    I have found some issues with weblogic it unable to GC some objects on undeployment of web app where as tomcat 6 GC ' all these class when i undeploy on tomcat 6 can i know if i can configure weblogic for different behaviour in gc

    Hi,
    Can you post ,what exactly you see.
    Regards,
    Rohit Jaiswal

  • Tomcat application undeploy problem

    Hi all,
    I have a problem using JavaMail in a web application using Tomcat 5.5.9 under Windows XP SP2. I can correctly send mails, both with and without attachments, but when I try to undeploy the app the mail.jar library remains "occupied" and Tomcat is unable to delete the app folder and undeploy it cleanly. The result is that I can't deploy new versions of the app until I stop the web server, delete the folder manually, and restart the server.
    The library is located in the WEB-INF/lib folder of the application (togheter with the activation.jar library).
    Doing some tests I noticed the problem is when I call the saveChanges() on a MimeMessage object, but only when I call the setText() method or the setContent() method adding a Multipart content to the message. If I only set recipients, subject and from field of the MimeMessage all goes well. I also tried to call the writeTo() method and save the message to a file instead of sending it, but the behaviour is the same.
    Here is the piece of code I use to send e-mails...if anyone has any suggestion or solution it is very appreciated :) Thanks for any help!
    Properties props = System.getProperties();
    props.put("mail.smtp.host", smtp);
    if(smtpAuth) props.put("mail.smtp.auth","true");
    Session session;
    Authenticator pwdAuth = null;
    if(smtpAuth)
         pwdAuth = new SMTPAuthenticator(user,pwd);
    session = Session.getInstance(props, pwdAuth);               
    Address[] rec = new Address[recipients.size()];
    int i = 0;
    for(Iterator it = recipients.iterator();it.hasNext();) {
         String d = (String)it.next();
         try {
              rec[i++] = new InternetAddress(d);                         
         } catch(AddressException e) {
    try {
         Transport tran = session.getTransport("smtp");
         if(smtpAuth)
              tran.connect(smtp,user,pwd);
         else
              tran.connect();
         MimeMessage message = new MimeMessage(session);
         String mitt = this.emailAddress;
         if(nick!=null)
              message.setFrom(new InternetAddress(sender,nick));
         else
              message.setFrom(new InternetAddress(sender,senderAddress));
         message.addRecipients(MimeMessage.RecipientType.TO,dest);
         message.addHeader("X-Mailer","RT E-Mailer");
         message.addHeader("X-Priority",priority);
         message.setSubject(subject);
         if(attach == null) {
              message.setText(text);
         } else {
              Multipart multipart = new MimeMultipart();
              MimeBodyPart messageBodyPart = new MimeBodyPart();
              messageBodyPart.setText(text);
              multipart.addBodyPart(messageBodyPart);
              for(int j = 0; j < attach.length; j++) {
                   Attachment a = attach[j];
                   messageBodyPart = new MimeBodyPart();
                   DataSource source = new FileDataSource(a.getFilename());
                   messageBodyPart.setDataHandler(new DataHandler(source));
                   messageBodyPart.setFileName(new File(a.getFilename()).getName());
                   multipart.addBodyPart(messageBodyPart);
              message.setContent(multipart);
         message.saveChanges();
         tran.sendMessage(message,dest);
         tran.close();
         ret = true;
    } catch(SendFailedException e) {
         ret = false;
    } catch (Exception e) {
         ret = false;
    }

    Hi,
    I have also the same problem. please help me if you find any way to resolve this issue.
    Thanks,
    Prasad.N

  • Undeploy and redeploy in tomcat without tomcat manager

    My host is running Tomcat 4.1.24 on an Apache 1.3.29 server, and tomcat (supposedly) refreshes its servlets every twelve hours. If I upload a new .war file it will deploy it to a folder of the same name almost instantly, however if I then make changes to that .war file it will not deploy it over the old installation. This would lead me to believe I need to undeploy the old version of my webapp before the updated .war file can be deployed.
    It doesn't even deploy the updated .war file when tomcat refreshes, as I've waited over 12 hours without the updated .war file being deployed.
    Bearing in mind that I do not have access to my host's tomcat config files and, to make matters worse, they say they don't run the tomcat manager tool on their servers, how can I undeploy my old version of my webapp so that I can deploy the new one?
    Thanks,
    Andrew.

    Hmm, the crude way won't work, as the server won't let
    me overwrite the files, just as it won't let me delete
    them, and I can't get into my host's server.xml!
    You'd think they'd have servlet reloading on already.
    Don't think I'll be using them again.You can define your own Context fro each WAR without editing the server.xml
    For Tomcat 4, this means creating an XML that contains the <Context ...> element as defined HERE. You would make that context reloadable. The XML file will have to have the same name as the WAR. For existance, you want to make a Web App called MyCalendar. The War would be called MyCalendar.war and the XML file called MyCalendar.xml. The Contents of the MyCalendar.xml migh be as simple as:
    <Context docBase="MyCalendar" path="MyCalendar" reloadable="tru"></Context>

  • URgent !!!!!!!!! How do i add information to server.xml of tomcat

    Hi ,
    I want to add the conext information to my server.xml of tomcat for my hibernate configuration.....
    the conext information is as follows ....
    <Context path="/quickstart" docBase="quickstart">
    <Resource name="jdbc/quickstart" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/quickstart">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <!-- DBCP database connection settings -->
    <parameter>
    <name>url</name>
    <value>jdbc:postgresql://localhost/quickstart</value>
    </parameter>
    <parameter>
    <name>driverClassName</name><value>org.postgresql.Driver</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>quickstart</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>secret</value>
    </parameter>
    <!-- DBCP connection pooling options -->
    <parameter>
    <name>maxWait</name>
    <value>3000</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>100</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>10</value>
    </parameter>
    </ResourceParams>
    </Context>
    Where in my server.xml should i put
    the server.xml looks like this :
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN">
    <!-- Comment these entries out to disable JMX MBeans support used for the
    administration web application -->
    <Listener className="org.apache.catalina.core.AprLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 5 documentation bundle for more detailed
    instructions):
    * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
    later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
    port="8080" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
         <!-- Note : To use gzip compression you could set the following properties :
                   compression="on"
                   compressionMinSize="2048"
                   noCompressionUserAgents="gozilla, traviata"
                   compressableMimeType="text/html,text/xml"
         -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector port="8443" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    -->
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector port="8082"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" acceptCount="100" connectionTimeout="20000"
    proxyPort="80" disableUploadTimeout="true" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.4
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- Defines a cluster for this node,
    By defining this element, means that every manager will be changed.
    So when running a cluster, only make sure that you have webapps in there
    that need to be clustered and remove the other ones.
    A cluster has the following parameters:
    className = the fully qualified name of the cluster class
    name = a descriptive name for your cluster, can be anything
    mcastAddr = the multicast address, has to be the same for all the nodes
    mcastPort = the multicast port, has to be the same for all the nodes
    mcastBindAddr = bind the multicast socket to a specific address
    mcastTTL = the multicast TTL if you want to limit your broadcast
    mcastSoTimeout = the multicast readtimeout
    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
    in case of multiple ethernet cards.
    auto means that address becomes
    InetAddress.getLocalHost().getHostAddress()
    tcpListenPort = the tcp listen port
    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
    has a wakup bug in java.nio. Set to 0 for no timeout
    printToScreen = true means that managers will also print to std.out
    expireSessionsOnShutdown = true means that
    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
    false means to replicate the session after each request.
    false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
    <%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
    %>
    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
    * Synchronous means that the thread that executes the request, is also the
    thread the replicates the data to the other nodes, and will not return until all
    nodes have received the information.
    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
    so the request thread will queue the replication request into a "smart" queue,
    and then return to the client.
    The "smart" queue is a queue where when a session is added to the queue, and the same session
    already exists in the queue from a previous request, that session will be replaced
    in the queue instead of replicating two requests. This almost never happens, unless there is a
    large network delay.
    -->
    <!--
    When configuring for clustering, you also add in a valve to catch all the requests
    coming in, at the end of the request, the session may or may not be replicated.
    A session is replicated if and only if all the conditions are met:
    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
    2. a session exists (has been created)
    3. the request is not trapped by the "filter" attribute
    The filter attribute is to filter out requests that could not modify the session,
    hence we don't replicate the session after the end of this request.
    The filter is negative, ie, anything you put in the filter, you mean to filter out,
    ie, no replication will be done on requests that match one of the filters.
    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
    ending with .gif and .js are intercepted.
    The deployer element can be used to deploy apps cluster wide.
    Currently the deployment only deploys/undeploys to working members in the cluster
    so no WARs are copied upons startup of a broken node.
    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
    When a new war file is added the war gets deployed to the local instance,
    and then deployed to the other instances in the cluster.
    When a war file is deleted from the watchDir the war is undeployed locally
    and cluster wide
    -->
    <!--
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true"
    notifyListenersOnReplication="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <Receiver
    className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"
    ackTimeout="15000"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>
    </Cluster>
    -->
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    This access log implementation is optimized for maximum performance,
    but is hardcoded to support only the "common" and "combined" patterns.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    </Host>
    </Engine>
    </Service>
    </Server>
    Can Some one Help me pleaseeeeee

    Please don't cross-post in multiple forums. I have answered
    this in your other thread.

  • Problem with Configuring Tomcat for running jsp web applications..Plz HELP

    I am using Tomcat 5.5 and Jdk 1.5.0_12 and Oracle 10g. I am using jdbc-odbc bridge connection
    to connect to the database. I have placed my project folder called
    tdm under the webapps folder in Tomcat. This 'tdm' folder consists of
    a collection of html pages,jsp pages and images of my project. Also I created a
    WEB-INF folderand in that I have lib folder which contains catalina-root.jar
    , classes12.jar and nls_charset.jar files. And also in the WEB-INF folder I have the web.xml
    file which looks like this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--
    Copyright 2004 The Apache Software Foundation
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    -->
    <web-app>
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/gdn</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    My Server.xml file in Tomcat\conf folder is as follows
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN">
    <!-- Comment these entries out to disable JMX MBeans support used for the
    administration web application -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    <Resource name="jdbc/gdn" auth="Container"
    type="javax.sql.DataSource" driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
    url="jdbc:odbc:gdn"
    username="system" password="tiger" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 5 documentation bundle for more detailed
    instructions):
    * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
    later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
    port="5050" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
         <!-- Note : To use gzip compression you could set the following properties :
                   compression="on"
                   compressionMinSize="2048"
                   noCompressionUserAgents="gozilla, traviata"
                   compressableMimeType="text/html,text/xml"
         -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector port="8443"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    -->
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector port="8082"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" acceptCount="100" connectionTimeout="20000"
    proxyPort="80" disableUploadTimeout="true" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.4
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- Defines a cluster for this node,
    By defining this element, means that every manager will be changed.
    So when running a cluster, only make sure that you have webapps in there
    that need to be clustered and remove the other ones.
    A cluster has the following parameters:
    className = the fully qualified name of the cluster class
    name = a descriptive name for your cluster, can be anything
    mcastAddr = the multicast address, has to be the same for all the nodes
    mcastPort = the multicast port, has to be the same for all the nodes
    mcastBindAddr = bind the multicast socket to a specific address
    mcastTTL = the multicast TTL if you want to limit your broadcast
    mcastSoTimeout = the multicast readtimeout
    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
    in case of multiple ethernet cards.
    auto means that address becomes
    InetAddress.getLocalHost().getHostAddress()
    tcpListenPort = the tcp listen port
    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
    has a wakup bug in java.nio. Set to 0 for no timeout
    printToScreen = true means that managers will also print to std.out
    expireSessionsOnShutdown = true means that
    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
    false means to replicate the session after each request.
    false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
    <%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
    %>
    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
    * Synchronous means that the thread that executes the request, is also the
    thread the replicates the data to the other nodes, and will not return until all
    nodes have received the information.
    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
    so the request thread will queue the replication request into a "smart" queue,
    and then return to the client.
    The "smart" queue is a queue where when a session is added to the queue, and the same session
    already exists in the queue from a previous request, that session will be replaced
    in the queue instead of replicating two requests. This almost never happens, unless there is a
    large network delay.
    -->
    <!--
    When configuring for clustering, you also add in a valve to catch all the requests
    coming in, at the end of the request, the session may or may not be replicated.
    A session is replicated if and only if all the conditions are met:
    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
    2. a session exists (has been created)
    3. the request is not trapped by the "filter" attribute
    The filter attribute is to filter out requests that could not modify the session,
    hence we don't replicate the session after the end of this request.
    The filter is negative, ie, anything you put in the filter, you mean to filter out,
    ie, no replication will be done on requests that match one of the filters.
    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
    ending with .gif and .js are intercepted.
    The deployer element can be used to deploy apps cluster wide.
    Currently the deployment only deploys/undeploys to working members in the cluster
    so no WARs are copied upons startup of a broken node.
    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
    When a new war file is added the war gets deployed to the local instance,
    and then deployed to the other instances in the cluster.
    When a war file is deleted from the watchDir the war is undeployed locally
    and cluster wide
    -->
    <!--
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true"
    notifyListenersOnReplication="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <Receiver
    className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"
    ackTimeout="15000"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>
    </Cluster>
    -->
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    This access log implementation is optimized for maximum performance,
    but is hardcoded to support only the "common" and "combined" patterns.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <Context path="/tdm" docBase="tdm" debug="0" reloadable="true" />
    </Host>
    </Engine>
    </Service>
    </Server>
    I have set the context path to /tdm in the server.xml file. Should this be placed in context.xml?
    My first page in the project is called Homepage.html. To start my project I give http://localhost:5050/tdm/homepage.html
    in a browser. Here I accept a username and password from the user and then do the validation in
    a valid.jsp file, where I connect to the database and check and use jsp:forward to go to next pages
    accordingly. However when I enter the username and password and click Go in the homepage, nothing is
    displayed on the next page. The URL in the browser says valid.jsp but a blank screen appears.
    WHY DOES IT HAPPEN SO? DOES IT MEAN THAT TOMCAT IS NOT RECOGNIZING JAVA IN MY SYSTEM OR IS IT A PROBLEM
    WITH THE DATABASE CONNECTION OR SOMETHING ELSE? I FEEL THAT TOMCAT IS NOT EXECUTING JSP COMMANDS?
    IS IT POSSIBLE?WHY WILL THIS HAPPEN?
    I set the JAVA_HOME and CATALINA_HOME environment to the jdk and tomcat folders resp.
    Is there any other thing that I need to set in classpath? Should I have my project as a
    WAR file in the webapps of TOMCAT or just a folder i.e. directory structure will fine?

    I am using Tomcat 5.5 and Jdk 1.5.0_12 and Oracle 10g. I am using jdbc-odbc bridge connection
    to connect to the database. I have placed my project folder called
    tdm under the webapps folder in Tomcat. This 'tdm' folder consists of
    a collection of html pages,jsp pages and images of my project. Also I created a
    WEB-INF folderand in that I have lib folder which contains catalina-root.jar
    , classes12.jar and nls_charset.jar files. And also in the WEB-INF folder I have the web.xml
    file which looks like this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--
    Copyright 2004 The Apache Software Foundation
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    -->
    <web-app>
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/gdn</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    My Server.xml file in Tomcat\conf folder is as follows
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN">
    <!-- Comment these entries out to disable JMX MBeans support used for the
    administration web application -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    <Resource name="jdbc/gdn" auth="Container"
    type="javax.sql.DataSource" driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
    url="jdbc:odbc:gdn"
    username="system" password="tiger" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 5 documentation bundle for more detailed
    instructions):
    * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
    later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
    port="5050" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
         <!-- Note : To use gzip compression you could set the following properties :
                   compression="on"
                   compressionMinSize="2048"
                   noCompressionUserAgents="gozilla, traviata"
                   compressableMimeType="text/html,text/xml"
         -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector port="8443"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    -->
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector port="8082"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" acceptCount="100" connectionTimeout="20000"
    proxyPort="80" disableUploadTimeout="true" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.4
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- Defines a cluster for this node,
    By defining this element, means that every manager will be changed.
    So when running a cluster, only make sure that you have webapps in there
    that need to be clustered and remove the other ones.
    A cluster has the following parameters:
    className = the fully qualified name of the cluster class
    name = a descriptive name for your cluster, can be anything
    mcastAddr = the multicast address, has to be the same for all the nodes
    mcastPort = the multicast port, has to be the same for all the nodes
    mcastBindAddr = bind the multicast socket to a specific address
    mcastTTL = the multicast TTL if you want to limit your broadcast
    mcastSoTimeout = the multicast readtimeout
    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
    in case of multiple ethernet cards.
    auto means that address becomes
    InetAddress.getLocalHost().getHostAddress()
    tcpListenPort = the tcp listen port
    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
    has a wakup bug in java.nio. Set to 0 for no timeout
    printToScreen = true means that managers will also print to std.out
    expireSessionsOnShutdown = true means that
    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
    false means to replicate the session after each request.
    false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
    <%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
    %>
    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
    * Synchronous means that the thread that executes the request, is also the
    thread the replicates the data to the other nodes, and will not return until all
    nodes have received the information.
    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
    so the request thread will queue the replication request into a "smart" queue,
    and then return to the client.
    The "smart" queue is a queue where when a session is added to the queue, and the same session
    already exists in the queue from a previous request, that session will be replaced
    in the queue instead of replicating two requests. This almost never happens, unless there is a
    large network delay.
    -->
    <!--
    When configuring for clustering, you also add in a valve to catch all the requests
    coming in, at the end of the request, the session may or may not be replicated.
    A session is replicated if and only if all the conditions are met:
    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
    2. a session exists (has been created)
    3. the request is not trapped by the "filter" attribute
    The filter attribute is to filter out requests that could not modify the session,
    hence we don't replicate the session after the end of this request.
    The filter is negative, ie, anything you put in the filter, you mean to filter out,
    ie, no replication will be done on requests that match one of the filters.
    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
    ending with .gif and .js are intercepted.
    The deployer element can be used to deploy apps cluster wide.
    Currently the deployment only deploys/undeploys to working members in the cluster
    so no WARs are copied upons startup of a broken node.
    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
    When a new war file is added the war gets deployed to the local instance,
    and then deployed to the other instances in the cluster.
    When a war file is deleted from the watchDir the war is undeployed locally
    and cluster wide
    -->
    <!--
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true"
    notifyListenersOnReplication="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <Receiver
    className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"
    ackTimeout="15000"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>
    </Cluster>
    -->
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    This access log implementation is optimized for maximum performance,
    but is hardcoded to support only the "common" and "combined" patterns.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <Context path="/tdm" docBase="tdm" debug="0" reloadable="true" />
    </Host>
    </Engine>
    </Service>
    </Server>
    I have set the context path to /tdm in the server.xml file. Should this be placed in context.xml?
    My first page in the project is called Homepage.html. To start my project I give http://localhost:5050/tdm/homepage.html
    in a browser. Here I accept a username and password from the user and then do the validation in
    a valid.jsp file, where I connect to the database and check and use jsp:forward to go to next pages
    accordingly. However when I enter the username and password and click Go in the homepage, nothing is
    displayed on the next page. The URL in the browser says valid.jsp but a blank screen appears.
    WHY DOES IT HAPPEN SO? DOES IT MEAN THAT TOMCAT IS NOT RECOGNIZING JAVA IN MY SYSTEM OR IS IT A PROBLEM
    WITH THE DATABASE CONNECTION OR SOMETHING ELSE? I FEEL THAT TOMCAT IS NOT EXECUTING JSP COMMANDS?
    IS IT POSSIBLE?WHY WILL THIS HAPPEN?
    I set the JAVA_HOME and CATALINA_HOME environment to the jdk and tomcat folders resp.
    Is there any other thing that I need to set in classpath? Should I have my project as a
    WAR file in the webapps of TOMCAT or just a folder i.e. directory structure will fine?

  • Exception report when using tomcat 5 with JDBC

    i followed this guide to setup the JDBC with my TOMCAT 5
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
    but i seem to get this error
    exception
    javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
         org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:81)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
         org.apache.jsp.SID.test_jsp._jspx_meth_sql_query_0(test_jsp.java:100)
         org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:58)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    i can compile *.java and run them when they need the jdbc drivers to interact with mysql 5 database.
    This is my server.xml
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
    <!-- Comment these entries out to disable JMX MBeans support -->
    <!-- You may also configure custom components (e.g. Valves/Realms) by
    including your own mbean-descriptor file(s), and setting the
    "descriptors" attribute to point to a ';' seperated list of paths
    (in the ClassLoader sense) of files to add to the default list.
    e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
    -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
    debug="0"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
    debug="0"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 5 documentation bundle for more detailed
    instructions):
    * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
    later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    debug="0" connectionTimeout="20000"
    disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
         <!-- Note : To use gzip compression you could set the following properties :
                   compression="on"
                   compressionMinSize="2048"
                   noCompressionUserAgents="gozilla, traviata"
                   compressableMimeType="text/html,text/xml"
         -->
    <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector port="8443"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" debug="0" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    -->
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" debug="0"
    protocol="AJP/1.3" />
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector port="8082"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false"
    acceptCount="100" debug="0" connectionTimeout="20000"
    proxyPort="80" disableUploadTimeout="true" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
    <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
    -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost" debug="0">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.4
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="catalina_log." suffix=".txt"
    timestamp="true"/>
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    debug="0" resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" debug="0" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- Defines a cluster for this node,
    By defining this element, means that every manager will be changed.
    So when running a cluster, only make sure that you have webapps in there
    that need to be clustered and remove the other ones.
    A cluster has the following parameters:
    className = the fully qualified name of the cluster class
    name = a descriptive name for your cluster, can be anything
    debug = the debug level, higher means more output
    mcastAddr = the multicast address, has to be the same for all the nodes
    mcastPort = the multicast port, has to be the same for all the nodes
    mcastBindAddr = bind the multicast socket to a specific address
    mcastTTL = the multicast TTL if you want to limit your broadcast
    mcastSoTimeout = the multicast readtimeout
    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
    in case of multiple ethernet cards.
    auto means that address becomes
    InetAddress.getLocalHost().getHostAddress()
    tcpListenPort = the tcp listen port
    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
    has a wakup bug in java.nio. Set to 0 for no timeout
    printToScreen = true means that managers will also print to std.out
    expireSessionsOnShutdown = true means that
    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
    false means to replicate the session after each request.
    false means that replication would work for the following piece of code:
    <%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
    %>
    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
    * Synchronous means that the thread that executes the request, is also the
    thread the replicates the data to the other nodes, and will not return until all
    nodes have received the information.
    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
    so the request thread will queue the replication request into a "smart" queue,
    and then return to the client.
    The "smart" queue is a queue where when a session is added to the queue, and the same session
    already exists in the queue from a previous request, that session will be replaced
    in the queue instead of replicating two requests. This almost never happens, unless there is a
    large network delay.
    -->
    <!--
    When configuring for clustering, you also add in a valve to catch all the requests
    coming in, at the end of the request, the session may or may not be replicated.
    A session is replicated if and only if all the conditions are met:
    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
    2. a session exists (has been created)
    3. the request is not trapped by the "filter" attribute
    The filter attribute is to filter out requests that could not modify the session,
    hence we don't replicate the session after the end of this request.
    The filter is negative, ie, anything you put in the filter, you mean to filter out,
    ie, no replication will be done on requests that match one of the filters.
    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
    ending with .gif and .js are intercepted.
    The deployer element can be used to deploy apps cluster wide.
    Currently the deployment only deploys/undeploys to working members in the cluster
    so no WARs are copied upons startup of a broken node.
    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
    When a new war file is added the war gets deployed to the local instance,
    and then deployed to the other instances in the cluster.
    When a war file is deleted from the watchDir the war is undeployed locally
    and cluster wide
    -->
    <!--
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <Receiver
    className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>
    </Cluster>
    -->
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn"
    debug="0"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Logger shared by all Contexts related to this virtual host. By
    default (when using FileLogger), log files are created in the "logs"
    directory relative to $CATALINA_HOME. If you wish, you can specify
    a different directory with the "directory" attribute. Specify either a
    relative (to $CATALINA_HOME) or absolute path to the desired
    directory.-->
    <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
    timestamp="true"/>
              <Context path="/testdb" docBase="APACHE_DIR/htdocs/testdb"
    debug="5" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/TestDB"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <!-- Maximum number of dB connections in pool. Make sure you
    configure your mysqld max_connections large enough to handle
    all of your db connections. Set to 0 for no limit.
    -->
    <parameter>
    <name>maxActive</name>
    <value>10</value>
    </parameter>
    <!-- Maximum number of idle dB connections to retain in pool.
    Set to 0 for no limit.
    -->
    <parameter>
    <name>maxIdle</name>
    <value>5</value>
    </parameter>
    <!-- Maximum time to wait for a dB connection to become available
    in ms, in this example 10 seconds. An Exception is thrown if
    this timeout is exceeded. Set to -1 to wait indefinitely.
    -->
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>username</name>
    <value>test</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>testpwd</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
    The autoReconnect=true argument to the url makes sure that the
    mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
    connection. mysqld by default closes idle connections after 8 hours.
    -->
    <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost/testdb?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
         </Context>
    </Host>
    </Engine>
    </Service>
    </Server>

    You haven't added a resource reference for your web application that gives the application a local name for the global resource "UserDatabase".

  • Deploying a web service to tomcat

    Hello
    I've had a problem deploying a web app that includes a web service. The application runs with no problems on the development computer using netbean6's built in tomcat 6 but when I drop the war file on to the test server the following catalina error occurs
    INFO: Deploying web application archive Temdox.war
    +[GC 20492K->3737K(63424K), 0.0010350 secs]+
    +[GC 20761K->4377K(63424K), 0.0012390 secs]+
    +01-Jul-2008 11:11:04 org.apache.catalina.core.StandardContext addApplicationListener+
    INFO: The listener "com.sun.xml.ws.transport.http.servlet.WSServletContextListener" is already configured for this context. The duplicate definition has been ignored.
    +01-Jul-2008 11:11:04 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized+
    INFO: WSSERVLET12: JAX-WS context listener initializing
    +01-Jul-2008 11:11:04 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized+
    SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.ExceptionInInitializerError
    java.lang.ExceptionInInitializerError
    +     at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:144)+
    +     at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)+
    +     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)+
    +     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)+
    +     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)+
    +     at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)+
    +     at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)+
    +     at java.security.AccessController.doPrivileged(Native Method)+
    +     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)+
    +     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)+
    +     at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)+
    +     at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)+
    +     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)+
    +     at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215)+
    +     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)+
    +     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)+
    +     at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)+
    +     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)+
    +     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)+
    +     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)+
    +     at java.lang.Thread.run(Thread.java:619)+
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.woodstox read)
    +     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)+
    +     at java.security.AccessController.checkPermission(AccessController.java:546)+
    +     at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)+
    +     at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)+
    +     at java.lang.System.getProperty(System.java:652)+
    +     at java.lang.Boolean.getBoolean(Boolean.java:221)+
    +     at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.<clinit>(XMLStreamReaderFactory.java:78)+
    +     ... 21 more+
    +01-Jul-2008 11:11:04 org.apache.catalina.core.StandardContext start+
    SEVERE: Error listenerStart
    +01-Jul-2008 11:11:04 org.apache.catalina.core.StandardContext start+
    +SEVERE: Context [Temdox] startup failed due to previous errors+
    +01-Jul-2008 11:11:04 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed+
    INFO: WSSERVLET13: JAX-WS context listener destroyed
    +[GC 21401K->4600K(63424K), 0.0018230 secs]+
    +01-Jul-2008 13:41:46 org.apache.catalina.startup.HostConfig checkResources+
    +INFO: Undeploying context [Temdox]+
    +01-Jul-2008 13:41:46 org.apache.catalina.startup.HostConfig deployWAR+
    The web service is using jax-ws and is an soap rpc service. I have noticed that the log refers to XMLStreamReaderFactory.woodstox
    which should be XMLStreamReaderFactory.Woodstox (upper case W), but i dont know if this is significant, and if it is I dont know where i can change this.
    Any help would be much appreciated.
    Jon Doveston

    The access denied message was caused by restrictive security settings in the tomcat configuration. In this case the test server being used is a managed server provided by a third party so at our request they allowed the actions and now the web app deploys successfully.

  • Error in deploying the java studio creator application to tomcat

    Hi,
    I'm trying to deploy my Sun Java Studio application to Apache Tomcat 5.0.28.
    A simple JSF web application built using the creator works fine after deploying the war file under tomcat/weapps directory.
    In case of a application with databse connection I'm getting the
    " com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' "
    above error. My application connects to Oracle database using the Oracle Server type provided by the Studio Creator.
    I have copied
    jstl.jar
    standard.jar
    to webapps\%app%\WEB-INF\lib
    The below url is currently not available ( Page not Found )stated as a solution in most of the querries regarding the deplyment to tomcat.
    http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/deploy_to_tomcat.html
    Thanks for any help
    abhi

    I had similar problems.
    I used mysql with tomcat and have mysql in my Creator environment as well but still had the driver message you experienced.
    I found that simply copying the WAR file into the webapp directory in tomcat caused a faulty deployment (it was creating /etc/tomcat5/localhost/YourProject.xml as a directory, not as a file)
    I updated my Projects/MyProject/build.xml to include a deploy target and I manually execute the ant deploy step (having not figured out how to tweak the internal ant within Creator)
    Note that this requires two jar files (see comments in the ant definition)
    <project name="YourRoster" default="default" basedir=".">
        <description>Builds, tests, and runs the project YourProject.</description>
        <import file="nbproject/build-impl.xml"/>
       <property file="build.properties"/>
       <property name="appdir" value="."/>
       <property name="distdir" value="${appdir}/dist"/>
       <property name="warfile" value="${distdir}/${app}.war"/>
       <property name="builddir" value="${appdir}/build"/>
       <path id="classpath">
          <pathelement location="${servlet.api.jar}"/>
          <pathelement location="${jsp.api.jar}"/>
          <fileset dir="${builddir}/WEB-INF/lib">
             <include name="*.jar"/>
          </fileset>  
       </path>
       <!-- requires tomcat/server/lib/catalina-ant.jar -->
       <target name="lrp-init">
          <tstamp/>
          <fail unless="app" message="Run ant -Dapp=... or update 'build.properties'"/>
       </target>
       <target name="deploy-tomcat" depends="dist"
          description="Deploy web application.">
          <echo message="Deploying ${app} ..."/>
          <taskdef name="deploy"  
             classname="org.apache.catalina.ant.DeployTask"/>
          <deploy url="${manager.url}" username="${username}"
             password="${password}" path="/${app}"
             war="file:${warfile}"/>
       </target>
       <target name="undeploy-tomcat" depends="lrp-init"
          description="Undeploy web application.">
          <echo message="Undeploying ${app} ..."/>
          <taskdef name="undeploy"   
             classname="org.apache.catalina.ant.UndeployTask"/>
          <undeploy url="${manager.url}" username="${username}"
             password="${password}" path="/${app}"/>
       </target>
       <!-- requires ant-contrib (http://ant-contrib.sourceforge.net) -->
       <target name="try.undeploy-tomcat" depends="lrp-init"
          description="Call the undeploy task (which may fail).">
          <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> 
          <trycatch>
             <try>
                <ant target="undeploy-tomcat"/>
             </try>
             <catch/>
          </trycatch>
       </target>
       <target name="redeploy-tomcat" depends="try.undeploy-tomcat,deploy-tomcat"
          description="Undeploy and deploy web application.">
       </target>
    </project>In addition, the build.properties...
    jsf.dir=/opt/jsf-1_1_01
    tomcat.dir=/opt/tomcat5
    app=YourProject
    username=tomcatAdminUser
    password=tomcatPassword
    manager.url=http://localhost:8080/manager
    servlet.api.jar=${tomcat.dir}/common/lib/servlet-api.jar
    jsp.api.jar=${tomcat.dir}/common/lib/jsp-api.jar
    jsf.lib.dir=${jsf.dir}/lib
    jstl.lib.dir=${tomcat.dir}/webapps/jsp-examples/WEB-INF/lib
    commons.lib.dir=${tomcat.dir}/server/lib
    jsf.libs=jsf-api.jar,jsf-impl.jar
    jstl.libs=jstl.jar,standard.jar
    commons.libs=commons-beanutils.jar,commons-digester.jarHope this helps.
    ...Lyall

  • Problem in jdbc-tomcat-mysql connection

    hi everybody
    i m in serious problem since last 15-20 days. i m trying hard to make the connection jdbc-mysql using tomcat with the help of a jsp test page but every time i am facing almost the similar probems listed below in detail:
    to make sure that the jdrivers's .jar (mysql-connector-java-3.1.7-bin.jar) available for such connections working fine i have tried the above said connection without using tomcat....which is working fine...for this i have created a dummy database with a dummy table ..and written some queries in the .java file of my code which upon running inserts the specified values in the defined(dummy) database.
    this is the confirmation that the classpath etc..are ok in regard to the mysql-connector-java-3.1.7-bin.jar
    now i have placed a copy of this .jar file in to the commons/lib directory of the tomcat web server(which is suppossed to be the place for such external jars)
    after doing so i have followed 2 methods :
    method 1st:........
    i have made aone more jar file from the following .java file....
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class TestSQLLoad
    String user = "Not Connected";
    String pwd = "no pwd";
    int id = -1;
    public void init() {
    try{
    Context ctx = new InitialContext();
    if(ctx == null ) {
    throw new Exception("Boom - No Context");
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
    if (ds != null) {
    Connection conn = ds.getConnection();
    if(conn != null) {
    user = "Got Connection "+conn.toString();
    Statement stmt = conn.createStatement();
    String q = "select name, password, id from user";
    ResultSet rst = stmt.executeQuery(q);
    if(rst.next()) {
    user=rst.getString(1);
    pwd=rst.getString(2);
    id = rst.getInt(3);
    conn.close();
    }catch(Exception e) {
    e.printStackTrace();
    public String getUser() {
    return user;
    public String getPassword() {
    return pwd;
    public int getID()
    return id;
    after compiling it at the cmd prompt i made a .jar file from the .class of it and named it MySQLLoad.jar...then i placed it also in to the commons/lib directory where the mysql-connector-java-3.1.7-bin.jar was already placed.
    then i have changed the server.xml and web.xml files from the conf directory of the tomcat as given here:
    server.xml
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN">
    <!-- Comment these entries out to disable JMX MBeans support used for the
    administration web application -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
    pathname="conf/tomcat-users.xml" />
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 5 documentation bundle for more detailed
    instructions):
    * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
    later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
    port="80" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
         <!-- Note : To use gzip compression you could set the following properties :
                   compression="on"
                   compressionMinSize="2048"
                   noCompressionUserAgents="gozilla, traviata"
                   compressableMimeType="text/html,text/xml"
         -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector port="8443"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    -->
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector port="8082"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" acceptCount="100" connectionTimeout="20000"
    proxyPort="80" disableUploadTimeout="true" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.4
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- Defines a cluster for this node,
    By defining this element, means that every manager will be changed.
    So when running a cluster, only make sure that you have webapps in there
    that need to be clustered and remove the other ones.
    A cluster has the following parameters:
    className = the fully qualified name of the cluster class
    name = a descriptive name for your cluster, can be anything
    mcastAddr = the multicast address, has to be the same for all the nodes
    mcastPort = the multicast port, has to be the same for all the nodes
    mcastBindAddr = bind the multicast socket to a specific address
    mcastTTL = the multicast TTL if you want to limit your broadcast
    mcastSoTimeout = the multicast readtimeout
    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
    in case of multiple ethernet cards.
    auto means that address becomes
    InetAddress.getLocalHost().getHostAddress()
    tcpListenPort = the tcp listen port
    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
    has a wakup bug in java.nio. Set to 0 for no timeout
    printToScreen = true means that managers will also print to std.out
    expireSessionsOnShutdown = true means that
    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
    false means to replicate the session after each request.
    false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
    <%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
    %>
    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
    * Synchronous means that the thread that executes the request, is also the
    thread the replicates the data to the other nodes, and will not return until all
    nodes have received the information.
    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
    so the request thread will queue the replication request into a "smart" queue,
    and then return to the client.
    The "smart" queue is a queue where when a session is added to the queue, and the same session
    already exists in the queue from a previous request, that session will be replaced
    in the queue instead of replicating two requests. This almost never happens, unless there is a
    large network delay.
    -->
    <!--
    When configuring for clustering, you also add in a valve to catch all the requests
    coming in, at the end of the request, the session may or may not be replicated.
    A session is replicated if and only if all the conditions are met:
    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
    2. a session exists (has been created)
    3. the request is not trapped by the "filter" attribute
    The filter attribute is to filter out requests that could not modify the session,
    hence we don't replicate the session after the end of this request.
    The filter is negative, ie, anything you put in the filter, you mean to filter out,
    ie, no replication will be done on requests that match one of the filters.
    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
    ending with .gif and .js are intercepted.
    The deployer element can be used to deploy apps cluster wide.
    Currently the deployment only deploys/undeploys to working members in the cluster
    so no WARs are copied upons startup of a broken node.
    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
    When a new war file is added the war gets deployed to the local instance,
    and then deployed to the other instances in the cluster.
    When a war file is deleted from the watchDir the war is undeployed locally
    and cluster wide
    -->
    <!--
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true"
    notifyListenersOnReplication="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <Receiver
    className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"
    ackTimeout="15000"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>
    </Cluster>
    -->
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    This access log implementation is optimized for maximum performance,
    but is hardcoded to support only the "common" and "combined" patterns.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <Context path="/testdb" docBase="TOMCAT_HOME/webapps/tomcat-docs/testdb"
    debug="5" reloadable="true" crossContext="true" >
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/TestDB"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <!-- Maximum number of dB connections in pool. Make sure you
    configure your mysqld max_connections large enough to handle
    all of your db connections. Set to 0 for no limit.
    -->
    <parameter>
    <name>maxActive</name>
    <value>10</value>
    </parameter>
    <!-- Maximum number of idle dB connections to retain in pool.
    Set to 0 for no limit.
    -->
    <parameter>
    <name>maxIdle</name>
    <value>5</value>
    </parameter>
    <!-- Maximum time to wait for a dB connection to become available
    in ms, in this example 10 seconds. An Exception is thrown if
    this timeout is exceeded. Set to -1 to wait indefinitely.
    -->
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>mysql</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
    The autoReconnect=true argument to the url makes sure that the
    mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
    connection. mysqld by default closes idle connections after 8 hours.
    -->
    <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost/testdb?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
    </Context>
    </Host>
    </Engine>
    </Service>
    </Server>
    and the other xml file i.e
    web.xml is here:
    <?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">
    <!-- ======================== Introduction ============================== -->
    <!-- This document defines default values for all web applications -->
    <!-- loaded into this instance of Tomcat. As each application is -->
    <!-- deployed, this file is processed, followed by the -->
    <!-- "/WEB-INF/web.xml" deployment descriptor from your own -->
    <!-- applications. -->
    <!-- -->
    <!-- WARNING: Do not configure application-specific resources here! -->
    <!-- They should go in the "/WEB-INF/web.xml" file in your application. -->
    <!-- ================== Built In Servlet Definitions ==================== -->
    <!-- The default servlet for all web applications, that serves static -->
    <!-- resources. It processes all requests that are not mapped to other -->
    <!-- servlets with servlet mappings (defined either here or in your own -->
    <!-- web.xml file. This servlet supports the following initialization -->
    <!-- parameters (default values are in square brackets): -->
    <!-- -->
    <!-- debug Debugging detail level for messages logged -->
    <!-- by this servlet. [0] -->
    <!-- -->
    <!-- input Input buffer size (in bytes) when reading -->
    <!-- resources to be served. [2048] -->
    <!-- -->
    <!-- listings Should directory listings be produced if there -->
    <!-- is no welcome file in this directory? [true] -->
    <!-- -->
    <!-- output Output buffer size (in bytes) when writing -->
    <!-- resources to be served. [2048] -->
    <!-- -->
    <!-- readonly Is this context "read only", so HTTP -->
    <!-- commands like PUT and DELETE are -->
    <!-- rejected? [true] -->
    <!-- -->
    <!-- readmeFile File name to display with the directory -->
    <!-- contents. [null] -->
    <!-- -->
    <!-- For directory listing customization. Checks localXsltFile, then -->
    <!-- globalXsltFile, then defaults to original behavior. -->
    <!-- -->
    <!-- localXsltFile Make directory listings an XML doc and -->
    <!-- pass the result to this style sheet residing -->
    <!-- in that directory. This overrides -->
    <!-- globalXsltFile[null] -->
    <!-- -->
    <!-- globalXsltFile Site wide configuration version of -->
    <!-- localXsltFile This argument is expected -->
    <!-- to be a physical file. [null] -->
    <!-- -->
    <!-- -->
    <servlet>
    <servlet-name>default</servlet-name>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
    <param-name>debug</param-name>
    <param-value>0</param-value>
    </init-param>
    <init-param>
    <param-name>listings</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- The "invoker" servlet, which executes anonymous servlet classes -->
    <!-- that have not been defined in a web.xml file. Traditionally, this -->
    <!-- servlet is mapped to the URL pattern "/servlet/*", but you can map -->
    <!-- it to other patterns as well. The extra path info portion of such a -->
    <!-- request must be the fully qualified class name of a Java class that -->
    <!-- implements Servlet (or extends HttpServlet), or the servlet name -->
    <!-- of an existing servlet definition. This servlet supports the -->
    <!-- following initialization parameters (default values are in square -->
    <!-- brackets): -->
    <!-- -->
    <!-- debug Debugging detail level for messages logged -->
    <!-- by this servlet. [0] -->
    <servlet>
    <servlet-name>invoker</servlet-name>
    <servlet-class>
    org.apache.catalina.servlets.InvokerServlet
    </servlet-class>
    <init-param>
    <param-name>debug</param-name>
    <param-value>0</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- The JSP page compiler and execution servlet, which is the mechanism -->
    <!-- used by Tomcat to support JSP pages. Traditionally, this servlet -->
    <!-- is mapped to the URL pattern "*.jsp". This servlet supports the -->
    <!-- following initialization parameters (default values are in square -->
    <!-- brackets): -->
    <!-- -->
    <!-- checkInterval If development is false and checkInterval is -->
    <!-- greater than zero, background compilations are -->
    <!-- enabled. checkInterval is the time in seconds -->
    <!-- between checks to see if a JSP page needs to -->
    <!--

    Look at the URl below:
    How to connect to Microsoft SQL server with Type 4 JDBC driver
    http://www.java-tips.org/content/view/615/29/

  • Tomcat JDBC Realm Database Connection Error

    Hello all,
    I am trying to edit the server.xml file on Tomcat so I can use the JDBC Realm instead of the MemoryRealm. Hence, I will be able to read users, passwords and roles from a relational database instead of from the tomcat-users.xml.
    I have tried following all the guides on the net I can find, my server.xml looks as follows (after making changes to allow it to use JDBC realm). The only problem is, when I try to run the application the server outputs the following: (after all of these errors have been kicked up a pop-up box then appears titled "Tomcat Manager Application", it asks for a User Name and Password. I have tried the standard user name of "ide" and the password next to it in tomcat-users.xml but it won't accept it. (I am using the netbeans IDE)).
    Please could someone suggest any ideas of how I can get the server.xml to work with JDBC realm?
    Using CATALINA_BASE:   C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base
    Using CATALINA_HOME:   C:\Program Files\netbeans-5.0beta\enterprise2\jakarta-tomcat-5.5.7
    Using CATALINA_TMPDIR: C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base\temp
    Using JAVA_HOME:       C:\j2sdk1.4.2_08
    Created MBeanServer with ID: 1f934ad:107444b1d2b:-8000:ravinder-rdnzoa:1
    31-Oct-2005 01:29:33 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8084
    31-Oct-2005 01:29:34 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8443
    31-Oct-2005 01:29:34 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2174 ms
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
    31-Oct-2005 01:29:34 org.apache.catalina.realm.JDBCRealm start
    SEVERE: Exception opening database connection
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:720)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
            at org.apache.catalina.core.StandardService.start(StandardService.java:450)
            at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
            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:271)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name Auditor used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:37 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    31-Oct-2005 01:29:38 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:38 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8084
    31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8443
    31-Oct-2005 01:29:40 org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    31-Oct-2005 01:29:40 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/60  config=null
    31-Oct-2005 01:29:40 org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    31-Oct-2005 01:29:40 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 5738 ms
    31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
    SEVERE: Exception performing authentication
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
            at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:534)
    31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
    SEVERE: Exception performing authentication
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
            at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:534)The server.xml looks as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
         parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
         which may contain one or more "Service" instances.  The Server
         listens for a shutdown command on the indicated port.
         Note:  A "Server" is not itself a "Container", so you may not
         define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8025" shutdown="SHUTDOWN">
        <!-- Comment these entries out to disable JMX MBeans support used for the
        administration web application -->
        <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
        <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
        <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
        <!-- Global JNDI resources -->
        <GlobalNamingResources>
            <!-- Test entry for demonstration purposes -->
            <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
            <!-- Editable user database that can also be used by
            UserDatabaseRealm to authenticate users -->
       <!-- RAV
            <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml"/>
          -->
        </GlobalNamingResources>
        <!-- A "Service" is a collection of one or more "Connectors" that share
        a single "Container" (and therefore the web applications visible
        within that Container).  Normally, that Container is an "Engine",
        but this is not required.
        Note:  A "Service" is not itself a "Container", so you may not
        define subcomponents such as "Valves" or "Loggers" at this level.
        -->
        <!-- Define the Tomcat Stand-Alone Service -->
        <Service name="Catalina">
            <!-- A "Connector" represents an endpoint by which requests are received
            and responses are returned.  Each Connector passes requests on to the
            associated "Container" (normally an Engine) for processing.
            By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
            You can also enable an SSL HTTP/1.1 Connector on port 8443 by
            following the instructions below and uncommenting the second Connector
            entry.  SSL support requires the following steps (see the SSL Config
            HOWTO in the Tomcat 5 documentation bundle for more detailed
            instructions):
            * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
            later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
            * Execute:
            %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
            $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
            with a password value of "changeit" for both the certificate and
            the keystore itself.
            By default, DNS lookups are enabled when a web application calls
            request.getRemoteHost().  This can have an adverse impact on
            performance, so you can disable it by setting the
            "enableLookups" attribute to "false".  When DNS lookups are disabled,
            request.getRemoteHost() will return the String version of the
            IP address of the remote client.
            -->
            <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
            <Connector port="8084" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>
            <!-- Note : To disable connection timeouts, set connectionTimeout value
            to 0 -->
            <!-- Note : To use gzip compression you could set the following properties :
            compression="on"
            compressionMinSize="2048"
            noCompressionUserAgents="gozilla, traviata"
            compressableMimeType="text/html,text/xml"
            -->
            <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
            <Connector port="8443"
            maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
            enableLookups="false" disableUploadTimeout="true"
            acceptCount="100" scheme="https" secure="true"
            clientAuth="false" sslProtocol="TLS" />
            <!-- Define an AJP 1.3 Connector on port 8009 -->
            <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3"/>
            <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
            <!-- See proxy documentation for more information about using this. -->
            <!--
            <Connector port="8082"
            maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
            enableLookups="false" acceptCount="100" connectionTimeout="20000"
            proxyPort="80" disableUploadTimeout="true" />
            -->
            <!-- An Engine represents the entry point (within Catalina) that processes
            every request.  The Engine implementation for Tomcat stand alone
            analyzes the HTTP headers included with the request, and passes them
            on to the appropriate Host (virtual host). -->
            <!-- You should set jvmRoute to support load-balancing via AJP ie :
            <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">        
            -->
            <!-- Define the top level container in our container hierarchy -->
            <Engine name="Catalina" defaultHost="localhost">
                <!-- The request dumper valve dumps useful debugging information about
                the request headers and cookies that were received, and the response
                headers and cookies that were sent, for all requests received by
                this instance of Tomcat.  If you care only about requests to a
                particular virtual host, or a particular application, nest this
                element inside the corresponding <Host> or <Context> entry instead.
                For a similar mechanism that is portable to all Servlet 2.4
                containers, check out the "RequestDumperFilter" Filter in the
                example application (the source for this filter may be found in
                "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
                Request dumping is disabled by default.  Uncomment the following
                element to enable it. -->
                <!--
                <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
                -->
                <!-- Because this Realm is here, an instance will be shared globally -->
                <!-- This Realm uses the UserDatabase configured in the global JNDI
                resources under the key "UserDatabase".  Any edits
                that are performed against this UserDatabase are immediately
                available for use by the Realm.  -->
                <!-- RAV
               <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
               -->
                <!-- Comment out the old realm but leave here for now in case we
                need to go back quickly -->
                <!--
                <Realm className="org.apache.catalina.realm.MemoryRealm" />
                -->
                <!-- Replace the above Realm with one of the following to get a Realm
                stored in a database and accessed via JDBC -->
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="org.gjt.mm.mysql.Driver"
                connectionURL="jdbc:mysql://localhost:3306/tomcatusers"
                connectionName="root" connectionPassword="sikhism1"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                <!--
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="oracle.jdbc.driver.OracleDriver"
                connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
                connectionName="scott" connectionPassword="tiger"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                -->
                <!--
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="sun.jdbc.odbc.JdbcOdbcDriver"
                connectionURL="jdbc:odbc:CATALINA"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                -->
                <!-- Define the default virtual host
                Note: XML Schema validation will not work with Xerces 2.2.
                -->
                <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
                    <!-- Defines a cluster for this node,
                    By defining this element, means that every manager will be changed.
                    So when running a cluster, only make sure that you have webapps in there
                    that need to be clustered and remove the other ones.
                    A cluster has the following parameters:
                    className = the fully qualified name of the cluster class
                    name = a descriptive name for your cluster, can be anything
                    mcastAddr = the multicast address, has to be the same for all the nodes
                    mcastPort = the multicast port, has to be the same for all the nodes
                    mcastBindAddr = bind the multicast socket to a specific address
                    mcastTTL = the multicast TTL if you want to limit your broadcast
                    mcastSoTimeout = the multicast readtimeout
                    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
                    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
                    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
                    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
                    in case of multiple ethernet cards.
                    auto means that address becomes
                    InetAddress.getLocalHost().getHostAddress()
                    tcpListenPort = the tcp listen port
                    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
                    has a wakup bug in java.nio. Set to 0 for no timeout
                    printToScreen = true means that managers will also print to std.out
                    expireSessionsOnShutdown = true means that
                    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
                    false means to replicate the session after each request.
                    false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
                    <%
                    HashMap map = (HashMap)session.getAttribute("map");
                    map.put("key","value");
                    %>
                    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
                    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
                    * Synchronous means that the thread that executes the request, is also the
                    thread the replicates the data to the other nodes, and will not return until all
                    nodes have received the information.
                    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
                    so the request thread will queue the replication request into a "smart" queue,
                    and then return to the client.
                    The "smart" queue is a queue where when a session is added to the queue, and the same session
                    already exists in the queue from a previous request, that session will be replaced
                    in the queue instead of replicating two requests. This almost never happens, unless there is a
                    large network delay.
                    -->
                    <!--
                    When configuring for clustering, you also add in a valve to catch all the requests
                    coming in, at the end of the request, the session may or may not be replicated.
                    A session is replicated if and only if all the conditions are met:
                    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
                    2. a session exists (has been created)
                    3. the request is not trapped by the "filter" attribute
                    The filter attribute is to filter out requests that could not modify the session,
                    hence we don't replicate the session after the end of this request.
                    The filter is negative, ie, anything you put in the filter, you mean to filter out,
                    ie, no replication will be done on requests that match one of the filters.
                    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
                    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
                    ending with .gif and .js are intercepted.
                    The deployer element can be used to deploy apps cluster wide.
                    Currently the deployment only deploys/undeploys to working members in the cluster
                    so no WARs are copied upons startup of a broken node.
                    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
                    When a new war file is added the war gets deployed to the local instance,
                    and then deployed to the other instances in the cluster.
                    When a war file is deleted from the watchDir the war is undeployed locally
                    and cluster wide
                    -->
                    <!--
                    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                    expireSessionsOnShutdown="false"
                    useDirtyFlag="true"
                    notifyListenersOnReplication="true">
                    <Membership
                    className="org.apache.catalina.cluster.mcast.McastService"
                    mcastAddr="228.0.0.4"
                    mcastPort="45564"
                    mcastFrequency="500"
                    mcastDropTime="3000"/>
                    <Receiver
                    className="org.apache.catalina.cluster.tcp.ReplicationListener"
                    tcpListenAddress="auto"
                    tcpListenPort="4001"
                    tcpSelectorTimeout="100"
                    tcpThreadCount="6"/>
                    <Sender
                    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                    replicationMode="pooled"
                    ackTimeout="15000"/>
                    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
                    filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
                    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>
                    </Cluster>
                    -->
                    <!-- Normally, users must authenticate themselves to each web app
                    individually.  Uncomment the following entry if you would like
                    a user to be authenticated the first time they encounter a
                    resource protected by a security constraint, and then have that
                    user identity maintained across *all* web applications contained
                    in this virtual host. -->
                    <!--
                    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.AccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    This access log implementation is optimized for maximum performance,
                    but is hardcoded to support only the "common" and "combined" patterns.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    This access log implementation is optimized for maximum performance,
                    but is hardcoded to support only the "common" and "combined" patterns.
                    This valve use NIO direct Byte Buffer to asynchornously store the
                    log.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.ByteBufferAccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                </Host>
            </Engine>
        </Service>
    </Server>Many thanks, and apologies for "dumping" all of the code here.

    So looking through the java api docs, I found that the tcUtilJDBCOperations has a connect string for the database. Below is the info it outlines. The questions I have it this. How do you specify the psdriver and URL along with do I need to do this as a persistent instance then add my selectstatement as a part of this or can I just specify this and the select statement will use this connection? Any help you can give would be appreciated.
    tcUtilJDBCOperations
    public tcUtilJDBCOperations(java.lang.String psDriver,
    java.lang.String psUrl,
    java.lang.String psUsername,
    java.lang.String psPassword)Contructor that sets the parameters for connecting to a database
    Parameters:
    psDriver - The class name of the jdbc driver
    psUrl - The URL of the database
    psUsername - The username required to access the database
    psPassword - The password for the above username
    Nick

  • Strange Error when starting tomcat 5.5.7

    Hello,
    on WinXP SP2 I am using JavaStudio Enterprise 8, with J2SE 1.5 update 9. I am trying to run the tomcat-servlet-example. The project compile properly, but when i run the project i get the error below. Since i have no clue how to overtake this, i ask assistance on fixing it.
    TIA,
    Luca
    Using CATALINA_BASE: C:\Documents and Settings\luca.C64\.jstudio\Ent8\jakarta-tomcat-5.5.7_base
    Using CATALINA_HOME: D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7
    Using CATALINA_TMPDIR: C:\Documents and Settings\luca.C64\.jstudio\Ent8\jakarta-tomcat-5.5.7_base\temp
    Using JAVA_HOME: C:\Programmi\Java\jdk1.5.0_09
    13-ott-2006 18.56.05 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    13-ott-2006 18.56.05 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1297 ms
    13-ott-2006 18.56.05 org.apache.tomcat.util.digester.Digester fatalError
    GRAVE: Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.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.tomcat.util.digester.Digester.parse(Digester.java:1580)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:370)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:97)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:129)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:792)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:138)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:108)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:80)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:676)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.naming.NamingContext lookup
    AVVERTENZA: Unexpected exception resolving reference
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1580)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:370)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:97)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:129)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:792)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:138)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:108)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:80)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:676)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans
    GRAVE: Exception processing Global JNDI Resources
    javax.naming.NamingException: Content is not allowed in prolog.
    at org.apache.naming.NamingContext.lookup(NamingContext.java:804)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:138)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:108)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:80)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:676)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    13-ott-2006 18.56.05 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
    13-ott-2006 18.56.05 org.apache.tomcat.util.digester.Digester fatalError
    GRAVE: Parse Fatal Error at line 1 column 1: Content is not allowed in prolog.
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.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.tomcat.util.digester.Digester.parse(Digester.java:1580)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:370)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:97)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:129)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:792)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:222)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.naming.NamingContext lookup
    AVVERTENZA: Unexpected exception resolving reference
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1580)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:370)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:97)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:129)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:792)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:222)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.catalina.realm.UserDatabaseRealm start
    GRAVE: Exception looking up UserDatabase under key UserDatabase
    javax.naming.NamingException: Content is not allowed in prolog.
    at org.apache.naming.NamingContext.lookup(NamingContext.java:804)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:222)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.catalina.startup.Catalina start
    GRAVE: Catalina.start:
    LifecycleException: No UserDatabase component found under key UserDatabase
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:228)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(StandardService.java:450)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 391 ms
    13-ott-2006 18.56.05 org.apache.catalina.core.StandardServer await
    GRAVE: StandardServer.await: create[8025]:
    java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
    at java.net.ServerSocket.bind(ServerSocket.java:319)
    at java.net.ServerSocket.<init>(ServerSocket.java:185)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:346)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:600)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:560)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    13-ott-2006 18.56.05 org.apache.coyote.http11.Http11Protocol pause
    INFO: Pausing Coyote HTTP/1.1 on http-8080

    Hello,
    I have set the verbosity of Ant to Debug, and the resulting log after clicking on the Run Main Project button is here below. The same error happens in Debug Maing Project.
    It seems to be difficult to get it working, and i cant understand why. After all, i used it for 1 year without problems, and now i m struggling...
    See you,
    Luca
    Adding reference: ant.PropertyHelper
    Detected Java version: 1.5 in: C:\Programmi\Java\jdk1.5.0_09\jre
    Detected OS: Windows XP
    Adding reference: ant.ComponentHelper
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml
    +Datatype nbbrowse org.netbeans.modules.ant.browsetask.NbBrowse
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml
    +Datatype antlib:org.netbeans.modules.ant.browsetask:nbbrowse org.netbeans.modules.ant.browsetask.NbBrowse
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml
    +Datatype nbjpdaconnect org.netbeans.modules.debugger.jpda.ant.JPDAConnect
    +Datatype nbjpdastart org.netbeans.modules.debugger.jpda.ant.JPDAStart
    +Datatype nbjpdareload org.netbeans.modules.debugger.jpda.ant.JPDAReload
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/ide5/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml
    +Datatype antlib:org.netbeans.modules.debugger.jpda.ant:nbjpdaconnect org.netbeans.modules.debugger.jpda.ant.JPDAConnect
    +Datatype antlib:org.netbeans.modules.debugger.jpda.ant:nbjpdastart org.netbeans.modules.debugger.jpda.ant.JPDAStart
    +Datatype antlib:org.netbeans.modules.debugger.jpda.ant:nbjpdareload org.netbeans.modules.debugger.jpda.ant.JPDAReload
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml
    +Datatype nbdeploy org.netbeans.modules.j2ee.ant.Deploy
    +Datatype nbverify org.netbeans.modules.j2ee.ant.Verify
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml
    +Datatype antlib:org.netbeans.modules.j2ee.ant:nbdeploy org.netbeans.modules.j2ee.ant.Deploy
    +Datatype antlib:org.netbeans.modules.j2ee.ant:nbverify org.netbeans.modules.j2ee.ant.Verify
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-sun-ide.jar!/org/netbeans/modules/j2ee/sun/ide/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-sun-ide.jar!/org/netbeans/modules/j2ee/sun/ide/antlib.xml
    +Datatype sun-appserv-deploy org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask
    +Datatype sun-appserv-undeploy org.apache.tools.ant.taskdefs.optional.sun.appserv.UndeployTask
    +Datatype sun-appserv-instance org.apache.tools.ant.taskdefs.optional.sun.appserv.InstanceTask
    +Datatype sun-appserv-component org.apache.tools.ant.taskdefs.optional.sun.appserv.ComponentTask
    +Datatype sun-appserv-admin org.apache.tools.ant.taskdefs.optional.sun.appserv.AdminTask
    +Datatype sun-appserv-input org.apache.tools.ant.taskdefs.Input
    +Datatype sun-appserv-jspc org.apache.tools.ant.taskdefs.optional.sun.appserv.SunJspc
    +Datatype sun-appserv-update org.apache.tools.ant.taskdefs.optional.sun.appserv.UpdateTask
    parsing buildfile jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-sun-ide.jar!/org/netbeans/modules/j2ee/sun/ide/antlib.xml with URI = jar:file:/D:/Programmi/Sun/jstudio_ent8/ide/enterprise1/ant/nblib/org-netbeans-modules-j2ee-sun-ide.jar!/org/netbeans/modules/j2ee/sun/ide/antlib.xml
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-deploy org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-undeploy org.apache.tools.ant.taskdefs.optional.sun.appserv.UndeployTask
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-instance org.apache.tools.ant.taskdefs.optional.sun.appserv.InstanceTask
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-component org.apache.tools.ant.taskdefs.optional.sun.appserv.ComponentTask
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-admin org.apache.tools.ant.taskdefs.optional.sun.appserv.AdminTask
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-input org.apache.tools.ant.taskdefs.Input
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-jspc org.apache.tools.ant.taskdefs.optional.sun.appserv.SunJspc
    +Datatype antlib:org.netbeans.modules.j2ee.sun.ide:sun-appserv-update org.apache.tools.ant.taskdefs.optional.sun.appserv.UpdateTask
    Setting ro project property: ant.file -> C:\Documents and Settings\luca.C64\TomcatServletExample1\build.xml
    Setting ro project property: ant.version -> Apache Ant version 1.6.2 compiled on July 16 2004
    Setting ro project property: ant.home -> D:\Programmi\Sun\jstudio_ent8\ide\ide5\ant
    Setting ro project property: forceRedeploy -> false
    Setting ro project property: build.compiler.emacs -> true
    Adding reference: ant.projectHelper
    Adding reference: ant.parsing.context
    Adding reference: ant.targets
    parsing buildfile C:\Documents and Settings\luca.C64\TomcatServletExample1\build.xml with URI = file:///C:/Documents%20and%20Settings/luca.C64/TomcatServletExample1/build.xml
    Setting ro project property: ant.project.name -> TomcatServletExample
    Adding reference: TomcatServletExample
    Setting ro project property: ant.file.TomcatServletExample -> C:\Documents and Settings\luca.C64\TomcatServletExample1\build.xml
    Project base dir set to: C:\Documents and Settings\luca.C64\TomcatServletExample1
    +Target:
    Importing file nbproject/build-impl.xml from C:\Documents and Settings\luca.C64\TomcatServletExample1\build.xml
    parsing buildfile C:\Documents and Settings\luca.C64\TomcatServletExample1\nbproject\build-impl.xml with URI = file:///C:/Documents%20and%20Settings/luca.C64/TomcatServletExample1/nbproject/build-impl.xml
    Setting ro project property: ant.file.TomcatServletExample-impl -> C:\Documents and Settings\luca.C64\TomcatServletExample1\nbproject\build-impl.xml
    +Target: default
    +Target: -pre-init
    +Target: -init-private
    +Target: -init-user
    +Target: -init-project
    +Target: -do-ear-init
    +Target: -do-init
    +Target: -post-init
    +Target: -init-check
    +Target: -init-macrodef-property
    +Target: -init-macrodef-javac
    +Target: -init-macrodef-junit
    +Target: -init-macrodef-java
    +Target: -init-macrodef-nbjpda
    +Target: -init-macrodef-debug
    +Target: init
    +Target: deps-module-jar
    +Target: deps-ear-jar
    +Target: deps-jar
    +Target: -pre-pre-compile
    +Target: -pre-compile
    +Target: -do-compile
    +Target: -copy-manifest
    +Target: -post-compile
    +Target: compile
    +Target: -pre-compile-single
    +Target: -do-compile-single
    +Target: -post-compile-single
    +Target: compile-single
    +Target: compile-jsps
    +Target: -do-compile-single-jsp
    +Target: compile-single-jsp
    +Target: -pre-dist
    +Target: -do-dist-without-manifest
    +Target: -do-dist-with-manifest
    +Target: do-dist
    +Target: library-inclusion-in-manifest
    +Target: library-inclusion-in-archive
    +Target: do-ear-dist
    +Target: -post-dist
    +Target: dist
    +Target: dist-ear
    +Target: run
    +Target: run-deploy
    +Target: verify
    +Target: run-display-browser
    +Target: run-main
    +Target: debug
    +Target: debug-display-browser
    +Target: debug-single
    +Target: -debug-start-debugger
    +Target: -debug-start-debuggee-single
    +Target: debug-single-main
    +Target: -pre-debug-fix
    +Target: -do-debug-fix
    +Target: debug-fix
    +Target: javadoc-build
    +Target: javadoc-browse
    +Target: javadoc
    +Target: -pre-pre-compile-test
    +Target: -pre-compile-test
    +Target: -do-compile-test
    +Target: -post-compile-test
    +Target: compile-test
    +Target: -pre-compile-test-single
    +Target: -do-compile-test-single
    +Target: -post-compile-test-single
    +Target: compile-test-single
    +Target: -pre-test-run
    +Target: -do-test-run
    +Target: -post-test-run
    +Target: test-report
    +Target: -test-browse
    +Target: test
    +Target: -pre-test-run-single
    +Target: -do-test-run-single
    +Target: -post-test-run-single
    +Target: test-single
    +Target: -debug-start-debuggee-test
    +Target: -debug-start-debugger-test
    +Target: debug-test
    +Target: -do-debug-fix-test
    +Target: debug-fix-test
    +Target: deps-clean
    +Target: do-clean
    +Target: check-clean
    +Target: -post-clean
    +Target: clean
    +Target: clean-ear
    Build sequence for target `run' is [-pre-init, -init-private, -init-user, -init-project, -init-macrodef-property, -do-ear-init, -do-init, -post-init, -init-check, -init-macrodef-javac, -init-macrodef-junit, -init-macrodef-java, -init-macrodef-nbjpda, -init-macrodef-debug, init, deps-module-jar, deps-ear-jar, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, library-inclusion-in-archive, library-inclusion-in-manifest, -do-compile, -post-compile, compile, compile-jsps, -do-compile-single-jsp, -pre-dist, -do-dist-with-manifest, -do-dist-without-manifest, do-dist, -post-dist, dist, run-deploy, run-display-browser, run]
    Complete build sequence is [-pre-init, -init-private, -init-user, -init-project, -init-macrodef-property, -do-ear-init, -do-init, -post-init, -init-check, -init-macrodef-javac, -init-macrodef-junit, -init-macrodef-java, -init-macrodef-nbjpda, -init-macrodef-debug, init, deps-module-jar, deps-ear-jar, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, library-inclusion-in-archive, library-inclusion-in-manifest, -do-compile, -post-compile, compile, compile-jsps, -do-compile-single-jsp, -pre-dist, -do-dist-with-manifest, -do-dist-without-manifest, do-dist, -post-dist, dist, run-deploy, run-display-browser, run, debug-display-browser, -post-compile-test-single, -pre-test-run, -pre-compile-single, -do-compile-single, -post-compile-single, compile-single, run-main, -pre-pre-compile-test, -pre-compile-test, -do-compile-test, -post-compile-test, compile-test, debug, javadoc-build, compile-single-jsp, -debug-start-debugger-test, -debug-start-debuggee-test, debug-test, -do-test-run, test-report, debug-single, do-clean, check-clean, -pre-test-run-single, javadoc-browse, javadoc, default, -pre-compile-test-single, -do-compile-test-single, compile-test-single, -do-test-run-single, do-ear-dist, -post-test-run-single, -post-test-run, -test-browse, test, dist-ear, deps-clean, -post-clean, clean, -pre-debug-fix, -do-debug-fix, debug-fix, -do-debug-fix-test, -debug-start-debuggee-single, clean-ear, -debug-start-debugger, verify, debug-fix-test, test-single, debug-single-main, ]
    -pre-init:
    -init-private:
    Loading C:\Documents and Settings\luca.C64\TomcatServletExample1\nbproject\private\private.properties
    Setting project property: javac.debug -> true
    Setting project property: javadoc.preview -> true
    Setting project property: j2ee.platform.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7\common\lib\jsp-api.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7\common\lib\servlet-api.jar
    Setting project property: j2ee.server.instance -> tomcat55:home=$bundled_home:base=$bundled_base
    Setting project property: user.properties.file -> C:\Documents and Settings\luca.C64\.jstudio\Ent8\build.properties
    -init-user:
    Loading C:\Documents and Settings\luca.C64\.jstudio\Ent8\build.properties
    Setting project property: libs.absolutelayout.src ->
    Setting project property: libs.absolutelayout.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\ide5\modules\ext\AbsoluteLayout.jar
    Setting project property: wsclientuptodate.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\ant\extra\wsclientuptodate.jar
    Setting project property: default.javac.target -> 1.5
    Setting project property: libs.jstl11.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\config\TagLibraries\JSTL11\standard.jar;D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\config\TagLibraries\JSTL11\jstl.jar
    Setting project property: libs.jstl11.src ->
    Setting project property: libs.absolutelayout.javadoc ->
    Setting project property: libs.PortletBuilder.src ->
    Setting project property: copyfiles.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\ant\extra\copyfiles.jar
    Setting project property: libs.PortletBuilder.javadoc ->
    Setting project property: libs.junit.src ->
    Setting project property: default.javac.source -> 1.5
    Setting project property: libs.junit.javadoc -> D:\Programmi\Sun\jstudio_ent8\ide\ide5\docs\junit-3.8.1-api.zip
    Setting project property: libs.junit.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\ide5\modules\ext\junit-3.8.1.jar
    Setting project property: libs.jstl11.javadoc -> D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\docs\jstl-1.1.2-javadoc.zip
    Setting project property: jspc.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\ide5\ant\lib\ant.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7\common\lib\jsp-api.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7\common\lib\servlet-api.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\modules\autoload\ext\jasper-compiler-5.5.7.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\modules\autoload\ext\jasper-runtime-5.5.7.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\modules\autoload\ext\commons-el.jar:D:\Programmi\Sun\jstudio_ent8\ide\ide5\modules\ext\commons-logging-1.0.4.jar
    Setting project property: libs.PortletBuilder.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\common.jar;D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\container.jar;D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\jdom.jar;D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\portlet.jar;D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\portletappengine.jar;D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\portletcontainercommon.jar;D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\portlettl.jar;D:\Programmi\Sun\jstudio_ent8\ide\portletbuilder1\modules\ext\psrun.jar
    Override ignored for property default.javac.source
    Override ignored for property default.javac.target
    -init-project:
    Loading C:\Documents and Settings\luca.C64\TomcatServletExample1\nbproject\project.properties
    Setting project property: javac.deprecation -> true
    Setting project property: build.test.results.dir -> build/test/results
    Setting project property: javadoc.nonavbar -> false
    Setting project property: war.name -> TomcatServletExample.war
    Setting project property: run.test.classpath -> :build/web/WEB-INF/classes:D:\Programmi\Sun\jstudio_ent8\ide\ide5\modules\ext\junit-3.8.1.jar:build/test/classes
    Setting project property: javac.target -> 1.5
    Setting project property: j2ee.server.type -> Tomcat55
    Setting project property: client.urlPart ->
    Setting project property: display.browser -> true
    Setting project property: javadoc.noindex -> false
    Setting project property: web.docbase.dir -> web
    Setting project property: source.root -> src
    Setting project property: build.classes.dir -> build/web/WEB-INF/classes
    Setting project property: javadoc.author -> false
    Setting project property: test.src.dir -> test
    Setting project property: build.dir -> build
    Setting project property: build.ear.web.dir -> build/ear-module
    Setting project property: resource.dir -> setup
    Setting project property: war.ear.name -> TomcatServletExample.war
    Setting project property: build.test.classes.dir -> build/test/classes
    Setting project property: platform.active -> default_platform
    Setting project property: javac.compilerargs ->
    Setting project property: javadoc.use -> true
    Setting project property: lib.dir -> web/WEB-INF/lib
    Setting project property: build.web.excludes -> **/*.java,**/*.form
    Setting project property: debug.test.classpath -> :build/web/WEB-INF/classes:D:\Programmi\Sun\jstudio_ent8\ide\ide5\modules\ext\junit-3.8.1.jar:build/test/classes
    Setting project property: dist.dir -> dist
    Setting project property: build.classes.excludes -> **/*.java,**/*.form
    Setting project property: javadoc.splitindex -> true
    Setting project property: javadoc.encoding ->
    Setting project property: javac.source -> 1.5
    Override ignored for property javadoc.preview
    Setting project property: debug.classpath -> :build/web/WEB-INF/classes
    Setting project property: compile.jsps -> false
    Setting project property: build.web.dir -> build/web
    Setting project property: runmain.jvmargs ->
    Setting project property: conf.dir -> src/conf
    Setting project property: build.generated.dir -> build/generated
    Setting project property: jar.compress -> false
    Setting project property: javac.test.classpath -> :build/web/WEB-INF/classes:D:\Programmi\Sun\jstudio_ent8\ide\ide5\modules\ext\junit-3.8.1.jar
    Setting project property: javadoc.private -> false
    Override ignored for property javac.debug
    Setting project property: war.content.additional ->
    Setting project property: jspcompilation.classpath -> D:\Programmi\Sun\jstudio_ent8\ide\ide5\ant\lib\ant.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7\common\lib\jsp-api.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7\common\lib\servlet-api.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\modules\autoload\ext\jasper-compiler-5.5.7.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\modules\autoload\ext\jasper-runtime-5.5.7.jar:D:\Programmi\Sun\jstudio_ent8\ide\enterprise1\modules\autoload\ext\commons-el.jar:D:\Programmi\Sun\jstudio_ent8\ide\ide5\modules\ext\commons-logging-1.0.4.jar:
    Setting project property: build.ear.classes.dir -> build/ear-module/WEB-INF/classes
    Setting project property: dist.javadoc.dir -> dist/javadoc
    Setting project property: src.dir -> src
    Setting project property: javac.classpath ->
    Setting project property: j2ee.platform -> 1.4
    Setting project property: javadoc.version -> false
    Setting project property: javadoc.windowtitle ->
    Setting project property: dist.war -> dist/TomcatServletExample.war
    Setting project property: javadoc.notree -> false
    Setting project property: dist.ear.war -> dist/TomcatServletExample.war
    -init-macrodef-property:
    +Datatype http://www.netbeans.org/ns/web-project/1:property org.apache.tools.ant.taskdefs.MacroInstance
    -do-ear-init:
    Skipped because property 'dist.ear.dir' not set.
    -do-init:
    Unable to find test
    Condition false; not setting have.tests
    Condition false; not setting netbeans.home+have.tests
    Condition false; not setting no.javadoc.preview
    Override ignored for property javac.compilerargs
    Property ${no.dependencies} has not been set
    Condition false; not setting no.deps
    Condition true; setting no.dist.ear.dir to true
    Setting project property: no.dist.ear.dir -> true
    Override ignored for property build.web.excludes
    Condition false; not setting do.compile.jsps
    Condition true; setting do.display.browser to true
    Setting project property: do.display.browser -> true
    Unable to find src\conf\MANIFEST.MF to set property has.custom.manifest
    Setting project property: build.meta.inf.dir -> build/web/META-INF
    Setting project property: build.classes.dir.real -> build/web/WEB-INF/classes
    Setting project property: build.web.dir.real -> build/web
    -post-init:
    -init-check:
    -init-macrodef-javac:
    +Datatype http://www.netbeans.org/ns/web-project/2:javac org.apache.tools.ant.taskdefs.MacroInstance
    -init-macrodef-junit:
    +Datatype http://www.netbeans.org/ns/web-project/2:junit org.apache.tools.ant.taskdefs.MacroInstance
    -init-macrodef-java:
    Property ${main.class} has not been set
    +Datatype http://www.netbeans.org/ns/web-project/1:java org.apache.tools.ant.taskdefs.MacroInstance
    -init-macrodef-nbjpda:
    Property ${main.class} has not been set
    +Datatype http://www.netbeans.org/ns/web-project/1:nbjpdastart org.apache.tools.ant.taskdefs.MacroInstance
    +Datatype http://www.netbeans.org/ns/web-project/1:nbjpdareload org.apache.tools.ant.taskdefs.MacroInstance
    -init-macrodef-debug:
    Property ${main.class} has not been set
    Property ${application.args} has not been set
    +Datatype http://www.netbeans.org/ns/web-project/1:debug org.apache.tools.ant.taskdefs.MacroInstance
    init:
    deps-module-jar:
    deps-ear-jar:
    Skipped because property 'dist.ear.dir' not set.
    deps-jar:
    -pre-pre-compile:
    -pre-compile:
    -copy-manifest:
    Skipped because property 'has.custom.manifest' not set.
    library-inclusion-in-archive:
    library-inclusion-in-manifest:
    Skipped because property 'dist.ear.dir' not set.
    -do-compile:
    Could not load a dependent class (com/sun/media/jai/codec/FileSeekableStream) for type image
    Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
    Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
    Could not load class (org.apache.tools.ant.tasksdefs.cvslib.CvsVersion) for type cvsversion
    Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
    fileset: Setup scanner in dir C:\Documents and Settings\luca.C64\TomcatServletExample1\src with patternSet{ includes: [] excludes: [] }
    CookieExample.java omitted as CookieExample.class is up to date.
    HelloWorldExample.java omitted as HelloWorldExample.class is up to date.
    LocalStrings.properties skipped - don't know how to handle it
    LocalStrings_en.properties skipped - don't know how to handle it
    LocalStrings_es.properties skipped - don't know how to handle it
    LocalStrings_fr.properties skipped - don't know how to handle it
    RequestHeaderExample.java omitted as RequestHeaderExample.class is up to date.
    RequestInfoExample.java omitted as RequestInfoExample.class is up to date.
    RequestParamExample.java omitted as RequestParamExample.class is up to date.
    SessionExample.java omitted as SessionExample.class is up to date.
    compressionFilters\CompressionFilter.java omitted as compressionFilters/CompressionFilter.class is up to date.
    compressionFilters\CompressionFilterTestServlet.java omitted as compressionFilters/CompressionFilterTestServlet.class is up to date.
    compressionFilters\CompressionResponseStream.java omitted as compressionFilters/CompressionResponseStream.class is up to date.
    compressionFilters\CompressionServletResponseWrapper.java omitted as compressionFilters/CompressionServletResponseWrapper.class is up to date.
    filters\ExampleFilter.java omitted as filters/ExampleFilter.class is up to date.
    filters\RequestDumperFilter.java omitted as filters/RequestDumperFilter.class is up to date.
    filters\SetCharacterEncodingFilter.java omitted as filters/SetCharacterEncodingFilter.class is up to date.
    listeners\ContextListener.java omitted as listeners/ContextListener.class is up to date.
    listeners\SessionListener.java omitted as listeners/SessionListener.class is up to date.
    util\HTMLFilter.java omitted as util/HTMLFilter.class is up to date.
    fileset: Setup scanner in dir C:\Documents and Settings\luca.C64\TomcatServletExample1\src with patternSet{ includes: [] excludes: [**/*.java, **/*.form] }
    LocalStrings.properties omitted as LocalStrings.properties is up to date.
    LocalStrings_en.properties omitted as LocalStrings_en.properties is up to date.
    LocalStrings_es.properties omitted as LocalStrings_es.properties is up to date.
    LocalStrings_fr.properties omitted as LocalStrings_fr.properties is up to date.
    omitted as is up to date.
    compressionFilters omitted as compressionFilters is up to date.
    filters omitted as filters is up to date.
    listeners omitted as listeners is up to date.
    util omitted as util is up to date.
    fileset: Setup scanner in dir C:\Documents and Settings\luca.C64\TomcatServletExample1\web with patternSet{ includes: [] excludes: [**/*.java, **/*.form] }
    META-INF\context.xml omitted as META-INF/context.xml is up to date.
    WEB-INF\web.xml omitted as WEB-INF/web.xml is up to date.
    cookies.html omitted as cookies.html is up to date.
    helloworld.html omitted as helloworld.html is up to date.
    images\code.gif omitted as images/code.gif is up to date.
    images\execute.gif omitted as images/execute.gif is up to date.
    images\return.gif omitted as images/return.gif is up to date.
    index.html omitted as index.html is up to date.
    reqheaders.html omitted as reqheaders.html is up to date.
    reqinfo.html omitted as reqinfo.html is up to date.
    reqparams.html omitted as reqparams.html is up to date.
    sessions.html omitted as sessions.html is up to date.
    omitted as is up to date.
    META-INF omitted as META-INF is up to date.
    WEB-INF omitted as WEB-INF is up to date.
    images omitted as images is up to date.
    -post-compile:
    compile:
    compile-jsps:
    Skipped because property 'do.compile.jsps' not set.
    -do-compile-single-jsp:
    Skipped because property 'jsp.includes' not set.
    -pre-dist:
    -do-dist-with-manifest:
    Skipped because property 'has.custom.manifest' not set.
    -do-dist-without-manifest:
    Setting project property: dist.jar.dir -> C:\Documents and Settings\luca.C64\TomcatServletExample1\dist
    fileset: Setup scanner in dir C:\Documents and Settings\luca.C64\TomcatServletExample1\build\web with patternSet{ includes: [] excludes: [] }
    META-INF\context.xml omitted as META-INF/context.xml is up to date.
    WEB-INF\classes\CookieExample.class omitted as WEB-INF/classes/CookieExample.class is up to date.
    WEB-INF\classes\HelloWorldExample.class omitted as WEB-INF/classes/HelloWorldExample.class is up to date.
    WEB-INF\classes\LocalStrings.properties omitted as WEB-INF/classes/LocalStrings.properties is up to date.
    WEB-INF\classes\LocalStrings_en.properties omitted as WEB-INF/classes/LocalStrings_en.properties is up to date.
    WEB-INF\classes\LocalStrings_es.properties omitted as WEB-INF/classes/LocalStrings_es.properties is up to date.
    WEB-INF\classes\LocalStrings_fr.properties omitted as WEB-INF/classes/LocalStrings_fr.properties is up to date.
    WEB-INF\classes\RequestHeaderExample.class omitted as WEB-INF/classes/RequestHeaderExample.class is up to date.
    WEB-INF\classes\RequestInfoExample.class omitted as WEB-INF/classes/RequestInfoExample.class is up to date.
    WEB-INF\classes\RequestParamExample.class omitted as WEB-INF/classes/RequestParamExample.class is up to date.
    WEB-INF\classes\SessionExample.class omitted as WEB-INF/classes/SessionExample.class is up to date.
    WEB-INF\classes\compressionFilters\CompressionFilter.class omitted as WEB-INF/classes/compressionFilters/CompressionFilter.class is up to date.
    WEB-INF\classes\compressionFilters\CompressionFilterTestServlet.class omitted as WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.class is up to date.
    WEB-INF\classes\compressionFilters\CompressionResponseStream.class omitted as WEB-INF/classes/compressionFilters/CompressionResponseStream.class is up to date.
    WEB-INF\classes\compressionFilters\CompressionServletResponseWrapper.class omitted as WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.class is up to date.
    WEB-INF\classes\filters\ExampleFilter.class omitted as WEB-INF/classes/filters/ExampleFilter.class is up to date.
    WEB-INF\classes\filters\RequestDumperFilter.class omitted as WEB-INF/classes/filters/RequestDumperFilter.class is up to date.
    WEB-INF\classes\filters\SetCharacterEncodingFilter.class omitted as WEB-INF/classes/filters/SetCharacterEncodingFilter.class is up to date.
    WEB-INF\classes\listeners\ContextListener.class omitted as WEB-INF/classes/listeners/ContextListener.class is up to date.
    WEB-INF\classes\listeners\SessionListener.class omitted as WEB-INF/classes/listeners/SessionListener.class is up to date.
    WEB-INF\classes\util\HTMLFilter.class omitted as WEB-INF/classes/util/HTMLFilter.class is up to date.
    WEB-INF\web.xml omitted as WEB-INF/web.xml is up to date.
    cookies.html omitted as cookies.html is up to date.
    helloworld.html omitted as helloworld.html is up to date.
    images\code.gif omitted as images/code.gif is up to date.
    images\execute.gif omitted as images/execute.gif is up to date.
    images\return.gif omitted as images/return.gif is up to date.
    index.html omitted as index.html is up to date.
    reqheaders.html omitted as reqheaders.html is up to date.
    reqinfo.html omitted as reqinfo.html is up to date.
    reqparams.html omitted as reqparams.html is up to date.
    sessions.html omitted as sessions.html is up to date.
    do-dist:
    -post-dist:
    dist:
    run-deploy:
    In-place deployment at C:\Documents and Settings\luca.C64\TomcatServletExample1\build\web
    Server returned HTTP response code: 403 for URL: http://localhost:8080/manager/deploy?config=file:/C:/DOCUME~1/luca.C64/IMPOST~1/Temp/context33857.xml&path=/TomcatServletExample1
    C:\Documents and Settings\luca.C64\TomcatServletExample1\nbproject\build-impl.xml:355: Deployment failed.
    at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:85)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    at org.apache.tools.ant.Target.execute(Target.java:341)
    at org.apache.tools.ant.Target.performTasks(Target.java:369)
    at org.apache.tools.ant.Project.e

Maybe you are looking for