Context.xml questin

Hello!
Where the context.xml (tomcat) file should be, in catalina_home or in catalina_base?
Thanks.

Both, but wrong forum and off topic for the site. Try the Tomcat documentation.

Similar Messages

  • In ColdFusion 10 Java integration, app-context.xml cannot be found in the classpath

    I have jars and dependencies from a vendor Java library that I wanted to use in my new CF10 environment, however the Hibernate/Spring dependencies of the library conflict with those within CF10 itself.  To work around that, I had hoped to use javasettings in an Application.cfc to prioritize the library with the classloader, but the Spring classpath resolver seems to be unable to find a META-INF/spring/app-context.xml in the classpath even though it is within the jar.
    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/spring/app-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/spring/app-context.xml] cannot be opened because it does not exist
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBean DefinitionReader.java:341)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBean DefinitionReader.java:302)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinition s(AbstractBeanDefinitionReader.java:143)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinition s(AbstractBeanDefinitionReader.java:178)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinition s(AbstractBeanDefinitionReader.java:149)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinition s(AbstractBeanDefinitionReader.java:212)
            at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(Abs tractXmlApplicationContext.java:126)
            at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(Abs tractXmlApplicationContext.java:92)
            at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFact ory(AbstractRefreshableApplicationContext.java:130)
            at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(Abs tractApplicationContext.java:467)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicatio nContext.java:397)
            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApp licationContext.java:139)
            at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApp licationContext.java:83)
    Can anyone shed some light on why CF can't find this resource?
    Thanks,
    Dave

    ReadPDF rPDF = new ReadPDF();
    Class myClass = rPDF.getClass();
    ClassLoader loader = myClass.getClassLoader();
    URL myURL = loader.getResource("PreviewForm1210.pdf");
    String path = myURL.getPath();
    path = path.replaceAll("%20", " ");
    // Create a PdfReader instance
    PdfReader r = PdfReader.fileReader(path);
    // Create a PdfDocument instance with the reader
    PdfDocument d = new PdfDocument(r);
    // Get page count and display on console
    System.out.println("Number of pages in PreviewForm1210.pdf is " + d.getPageCount());

  • Problem in loading Context.xml file

    Hi,
    I just tried to create datasource from context.xml. i did the following steps
    1. i added context.xml file in webapps/META-INF/
    2. I added the below values to that xml file.
    <?xml version="1.0" encoding="UTF-8"?>
    <Context antiJARLocking="true" path="/myApp" >
        <Resource name="jdbc/dbtest" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" password="test_dev" minIdle="1" maxIdle="1" maxActive="10" maxWait="5000" username="test_dev" url="jdbc:oracle:thin:@22.4.55.6:1521:TEST"/>
    </Context>3.
    public class TestDB {
         private static Logger log = Logger.getLogger(TestDB.class.getName());
         private final static String JNDI_PATH_DB            = "java:comp/env/jdbc/dbtest";
         public javax.sql.DataSource getCatalogDS() throws NamingException
              try
                   InitialContext initCtx = new InitialContext();
                   return (DataSource)initCtx.lookup(JNDI_PATH_DB);
              catch (NamingException ex)
                   log.info("NamingException: " + ex.getMessage());
                   throw ex;
         public Connection getConnection() throws Exception
              try
                  DataSource catalogDS = getCatalogDS();
                   return catalogDS.getConnection();
              catch(Exception ex)
                   log.info(ex.getMessage());
                   throw ex;
         public static void main (String args[]){
                   try {
                        TestDB obj = new TestDB();
                        System.out.println("before lookup");
                        System.out.println("Datasource is "+obj.getConnection());
                   } catch( NamingException ne ) {
                        throw new RuntimeException( "Unable to aquire data source", ne );
         catch (Exception e)
              String st = StringUtils.StackTraceToString( e );
    }4. i run this class to get connection.
    i am getting an error
    Exception in thread "main" java.lang.RuntimeException: Unable to aquire data source
         at it.sscenter.escape.admintools.TestDB.main(TestDB.java:51)
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at it.sscenter.escape.admintools.TestDB.getCatalogDS(TestDB.java:22)
         at it.sscenter.escape.admintools.TestDB.getConnection(TestDB.java:35)
         at it.sscenter.escape.admintools.TestDB.main(TestDB.java:49)Is that right way or do i need to configure the context file in somewhere OR do i need to create an properties file?
    Kindly help to resolve this issue.
    Thanks
    Jasmin

    EJP wrote:
    You need to give the InitialContext some properties, there's no magical way it'll configure itself (outside of a Java EE container).If you lookup a URL with a known protocol, e.g. ldap: or in this case java:, it will configure itself in any environment that has a factory for the protocol.Is this a recent change? Last time I was accessing Ldap, it did require me to specify the com.sun.jndi.ldap.LdapCtxFactory separately.

  • META-INF/context.xml, Tomcat, META-INF/services

    I presently have a Netbeans project laid out like this:
    src
    src\java
    web
    web\META-INF
    web\META-INF\context.xml
    etc. Tomcat finds that META-INF/context.xml OK and does what I expect with it.
    I have recently added something that is loaded by java.util.ServiceLoader, which requires a META-INF/services/x.y.z file containing the name(s) of the classes that implement x.y.z. After deployment, my webapp's ServiceLoader doesn't find it, because in the target it isn't in WEB-INF/classes/META-INF/services/x.y.z. If I put it into src/java/META-INF/services/x.y.z it works correctly, as it then ends up in the right place. However I'm now concerned that either Tomcat won't find the context.xml if I put it in the same place under src, because it would then not be in /META-INF/context.xml but rather /WEB-INF/classes/META-INF/context.xml, which in turn would mean that I would then need two META-INF directories. I'm about to test that conjecture about Tomcat finding it under WEB-INF/classes/META-INF, but I'm wondering whether I'm doing something basically wrong in the first place here.

    You seem to think that you can have only one META-INF directory; this is simply not true. Keep both your META-INF directories and put the files where they are expected. Yay for using overlapping names :/

  • Data source needs to be specified in context.xml instead of web.xml - why?

    Hi,
    I'm using a Spring JndiObjectFactoryBean to create my JNDI data source in my code:
    <bean id="jndiDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="true">
              <property name="jndiName" value="java:comp/env/jdbc/DS_OURDB_DB2" />
              <property name="lookupOnStartup" value="false"/>
              <property name="proxyInterface" value="javax.sql.DataSource"/>
         </bean>I have the necessary Resource added to my Tomcat's server.xml:
    <Resource accessToUnderlyingConnectionAllowed="false"
                defaultAutoCommit="true" defaultReadOnly="false"
                driverClassName="com.ibm.db2.jcc.DB2Driver"
                factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
                initialSize="0" logAbandoned="false" maxActive="8"
                maxIdle="8" maxOpenPreparedStatements="0" maxWait="-1"
                minEvictableIdleTimeMillis="1800000" minIdle="0"
                name="jdbc/DS_OURDB_DB2" numTestsPerEvictionRun="3"
                password="ourpass" poolPreparedStatements="false"
                removeAbandoned="false" removeAbandonedTimeout="300"
                testOnBorrow="true" testOnReturn="false"
                testWhileIdle="false" timeBetweenEvictionRunsMillis="-1"
                type="javax.sql.DataSource"
                url="jdbc:db2://machine1:60056/DBD1" username="ouruser"
                   validationQuery="SELECT current date FROM sysibm.sysdummy1"/>I then have the resource referenced in my web.xml:
    <resource-ref>
              <res-ref-name>jdbc/DS_OURDB_DB2</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>However, I'm getting JndiLookupFailureExceptions when I attempt to use this JNDI resource.
    I can resolve it by specifying the following in my META-INF/context.xml:
    <Context>
         <ResourceLink global="jdbc/DS_OURDB_DB2" name="jdbc/DS_OURDB_DB2" type="javax.sql.Datasource"/>
    </Context>I've read some of the JNDI/Tomcat documentation. However, I still do not understand why it doesn't work with the web.xml. Can anyone explain please? Thanks

    Can answer this myself after some more investigation. The reason I required the entry in the META-INF/context.xml was because I had specified the Resource as a Global Reference in the server.xml. By adding this Resource to my application's Context in the server.xml the configuration in the web.xml worked as expected.

  • Context.xml configuration for database connetion in struts

    here is the content of context.xml
    <Context antiJARLocking="true" path="/WebApplication5">
        <!-- Specify a JDBC datasource -->
        <Resource name="jdbc/aaa"
                  auth="Container"
                  type="javax.sql.DataSource"
                  username="campus"
                  password="camp123"
                  driverClassName="com.mysql.jdbc.Driver"
                  url="jdbc:mysql://192.168.0.226:3306/training"/>
    </Context>here is the usage
    public boolean query(empform f)throws NamingException,SQLException {
            //Connection conn=null;
    //        String url = "jdbc:mysql://192.168.0.226:3306/";
    //        String dbname = "training";
    //Connection c=null;
            ResultSet rs = null;
            System.out.println("resultset out of try");
            try {
                // Get DataSource
                System.out.println("resultset 1");
                Context ctx = new InitialContext();
                System.out.println("resultset2 ");
                DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/aaa");
    // Get Connection and Statement
                System.out.println(ds);
                Connection c = ds.getConnection();
                System.out.println("resultset4");
    //                 Class.forName("com.mysql.jdbc.Driver");
    //                 conn = DriverManager.getConnection(url+dbname,"campus","camp123");
                PreparedStatement ps;
                String query = "select * from loginemp where username=? and password=?";
                ps = c.prepareStatement(query);
                ps.setString(1, f.getUsername());
                ps.setString(2, f.getPassword());
                rs = ps.executeQuery();
                System.out.println("resultset" + rs);
               if(rs.next()) {
                   System.out.println(rs.getString("username"));
                   return true;
               else
                   return false;
            } catch (Exception e) {
                // conn.close();
                System.out.println("in catch of login dao" + e);
            return false;
        }Im getting error
    resultset out of try
    resultset 1
    resultset2
    org.apache.tomcat.dbcp.dbcp.BasicDataSource@a5c9f1
    in catch of login dao
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at com.myapp.struts.LoginDao.query(LoginDao.java:40)
    at com.myapp.struts.Business.login(Business.java:20)
    at com.myapp.struts.empAction.execute(empAction.java:25)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
    ... 25 more
    can anyone help...

    Bhararrajverma wrote:
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'Looks like it can't find the JDBC driver. The MySQL JDBC driver jar must be available either in your web app or in the shared tomcat library directory. Is it there?

  • Tomcat application context.xml

    This is my problem:
    I've been programming my own implementation of a Realm.
    within I want to access a <Environment>-Entry situated in
    a customized Context.xml :
    <Context docBase="${catalina.home}/webapps/slide"
    privileged="true" antiResourceLocking="false"
    antiJARLocking="false" useNaming="true">
    <Environment name="test" type="java.lang.String"
    value="C:/user.xml"/>
              <Realm className="MyRealm"/>
    </Context>
    What do I need to do to gain access.
    When I declare the variable in <GlobalNamingResources> there is no problem accessing it.

    To clarify I add portions of my configuration files:
    <b>hibernate.cfg.xml</b> fragment:
    <property name="connection.datasource">
      java:comp/env/jdbc/cname
    </property>
    <property name="dialect">
      net.sf.hibernate.dialect.OracleDialect
    </property>
    <property name="connection.driver_class">
      oracle.jdbc.driver.OracleDriver
    </property>
    <property name="transaction.factory_class">
      net.sf.hibernate.transaction.JDBCTransactionFactory
    </property> <b>web.xml</b> fragment:
    <resource-ref>
      <description>DataSource</description>
      <res-ref-name>jdbc/cname</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>What I want to put inside <b>tomcat context application definition</b>:
    <Resource name="jdbc/cname" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/cname">
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:oracle:thin:@server:1521:SID</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>oracle.jdbc.driver.OracleDriver</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>name</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>pass</value>
      </parameter>
      <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>
    <Realm className="org.apache.catalina.realm.DataSourceRealm"
       dataSourceName="jdbc/cname"
       localDataSource="true"
       digest="MD5"
       userTable="usr" userNameCol="user" userCredCol="passwd"
       userRoleTable="usrrol" roleNameCol="rol" />

  • Error in connecting the database with context.xml resource

    Dear everyone,
    i am trying to connect the application with database...
    i have a table with employee id, name...
    i have given context xml and established connection..
    but i am getting error as
    * " Element type "Resource" must be followed by either attribute specifications, ">" or "/>"."
    * "The context.xml file seems to be broken. Check whether it is well-formed and valid."
    anyone please give ur suggestions....

    the error that i received now was...
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 34 in the jsp file: /index.jsp
    Context cannot be resolved to a type
    31:        int i=0;
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    An error occurred at line: 34 in the jsp file: /index.jsp
    InitialContext cannot be resolved to a type
    31:        int i=0;
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    An error occurred at line: 35 in the jsp file: /index.jsp
    DataSource cannot be resolved to a type
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    38:         {
    An error occurred at line: 35 in the jsp file: /index.jsp
    DataSource cannot be resolved to a type
    32:       
    33:       
    34:        Context ctx = new InitialContext();
    35:        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/employee");
    36:       
    37:        try
    38:         {
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.

  • Where to place /META-INF/context.xml ?

    Hi,
    Apologies, but this is a newbie question. In the tomcat docs, it states that
    "A /META-INF/context.xml file can be used to define Tomcat specific configuration..."
    Could you please tell me where /META-INF/context.xml is placed relative to web application root? In other words, if I have a web application in a directory /MyWebApp, should the /META-INF dir be in /MyWebApp/META-INF or should it be under /WEB-INF?
    Thanks.
    Ben

    You seem to think that you can have only one META-INF directory; this is simply not true. Keep both your META-INF directories and put the files where they are expected. Yay for using overlapping names :/

  • Context.xml for Tomcat using Weblogic JMS

    Hello,
              has anyone succeeded in getting Tomcat to use a queue hosted by Weblogic? If so, could you please post a snippet of your context.xml with the <Resource>... sections appropriate? My last attempt drowned in a sea of bizarre security exceptions and hasn't been seen since.
              Thanks,
              Richard

    Tom,
              I'll see what happens when I move things about, but really, there's a difference here. One of the issues here is that Tomcat needs a class that implements the ReferenceFactory interface for its configuration. I can't find such a class in the Weblogic docs, but I might have it all wrong or be looking in the wrong place. Hence, my question.
              The weblogic jar is not in the Tomcat classpath, it's in the WEB-INF/lib directory of the war file I'm working with.

  • Referencing Database from Context.xml

    In the Context.xml file, I have reference to the database I am using for the application. Here is the Context.xml code.
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="ABATE" reloadable="true" docBase="C:\Documents and Settings\koconnor\EclipseWorkspace\ABATE" workDir="C:\Documents and Settings\koconnor\EclipseWorkspace\ABATE\work" >
         <Resource name="jdbc/ABATE" auth="Container" scope="Shareable" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000"
            username="ccn" password="ccn" driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/abate?autoReconnect=true"/>     
    </Context>Basically; what I need to know is how I can reference the value stored in "url" within a java class.

    The point is that you DON'T access the URL directly. You just look up the datasource by name: jdbc/ABATE, and ask it for a connection. It will use the url to give you a database connection.
    It abstracts the connection details from your code.

  • Workshop 10.1 not deploying custom context.xml

    I have a web project that was converted from Workshop 3.3. The project has a context.xml file in WebContent/META-INF that contains a datasource.
    This setup was working fine with Workshop 3.3, however for some reason Workshop 10.1 is not merging the file into server.xml (Looked at $WORKSPACE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml)
    The old workspace from 3.3 shows the information merged into the file.
    No modifications to the project other than converting to 10.1 have been made. I've tried marking the context.xml as read-only as well and that did not help.
    Any ideas or suggestions?

    I just tried the following steps and it is working for me.
    - Create a new struts project
    - create a new devloader_context.xml under WebContent/META-INF/
    contents:
    <Context docBase="test" path="/test" reloadable="true" source="org.eclipse.jst.j2ee.server:test">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
    </Context>
    - Save & mark the file readonly
    - create a new Tomcat 5.5.x (5.5.23) configuration
    - add the project to tomcat and start the server
    - The contents of devloader_context.xml were merged into server.xml file
    verified @ workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf

  • Cleanup of Context xml file in EBS Database

    Hello Team:
    I recently upgraded my database to 11g and ran autoconfig to reflect the new environment settings. For some reasons when I look at the env set. I am seeing the 9.2.0 instances also listed in it.
    [oradev@brazeau appsutil]$ env | grep 9.2.0
    PERL5LIB=/u02/dev/oradev/devdb/9.2.0/Apache/perl/lib/5.00503:/u02/dev/oradev/devdb/9.2.0/Apache/perl/lib/site_perl/5.005:/u02/dev/oradev/devdb/9.2.0/appsutil/perl:/u02/dev/oradev/devdb/10.2.0/appsutil/perl:/u02/dev/oradev/devdb/11.1.0/appsutil/perl
    TNS_ADMIN=/u02/dev/oradev/devdb/9.2.0/network/admin/SID_host
    PATH=/u02/dev/oradev/devdb/9.2.0/Apache/perl/bin:/u02/dev/oradev/devdb/9.2.0/Apache/perl/bin:/u02/dev/oradev/devdb/9.2.0/Apache/perl/bin:/u02/dev/oradev/devdb/9.2.0/Apache/perl/bin:/u02/dev/oradev/devdb/11.1.0/bin:/usr/bin:/usr/sbin:/u02/dev/oradev/devdb/9.2.0/jre/1.4.2/bin:/usr/ccs/bin:/bin:/usr/bin/X11:/usr/local/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/u02/dev/oradev/bin:.:.:.:.
    ADPERLPRG=/u02/dev/oradev/devdb/9.2.0/Apache/perl/bin/perl
    I need to clean this up. The next thing that I am seeing is this . The Database listener file.It is still using the 9.2.0 listener file instead of the 11g one.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias DEV
    Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
    Start Date 02-JUL-2008 12:43:41
    Uptime 6 days 3 hr. 40 min. 47 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /u02/dev/oradev/devdb/9.2.0/network/admin/DEV_host/listener.ora
    Listener Log File /u02/dev/oradev/devdb/11.1.0/log/diag/tnslsnr/host/dev/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROCDEV)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host.thebrick.com)(PORT=1521)))
    I think i need to change the TNS_ADMIN value so the database will start using the 11g listener right.
    Can I manually update the context.xml to correct values ? How should I proceed in this situation?
    Regards,
    BMP

    I think i need to change the TNS_ADMIN value so the database will start using the 11g listener right.
    Can I manually update the context.xml to correct values ? How should I proceed in this situation?- Make sure the database is up
    - Update the 11g listener.ora file manually and start the listener (using lsnrctl)
    - Edit the Context File and make the necessary changes
    - Run AutoConfig
    - As oracle user, open a new session and source the database env file again
    - Issue the command “env | grep 9.2.0” again to verify that all references to 9.2.0 ORACLE_HOME are no longer exist
    - Shutdown/Startup the listener/database

  • Context.xml question , Thanks

    Hi, developers:
    I would like to connect to another server using context.xml. I did like the following link: < a href="http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html"> link to instruction</a>
    In the "JDBC Data Source" :4 Configure Tomcat's Resource Factory part said a Context.xml tshould be stored in the META-INF directory .
    My problem is:
    1) where is /META-INF so I can find the contect.xml. I using tomcat5.5 and find only at Tomcat5.5\conf\context.xml?
    2) When I restart with my context.xml below, the tomcat can start but application can NOT.
    Error msd: Http status 404 : The requested resource (/account App) is not available.
    code of context.xml is:
    <?xml version='1.0' encoding='utf-8'?>
    <Context displayName="account" path="/accountApp" debug="0" reloadable="true" docBase="serverdb">
    <Resource name="jdbc/dbinstance" auth="Container" type="javax.sql.DataSource"
    factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:oracle:thin:@//dburl:1522/"
    username="accuser"
    password="accpw"
    maxActive="20"
    maxIdle="10"
    maxWait="120000"
    removeAbandoned="true"
    logAbandoned="true"
    removeAbandonedTimeout="300"
    testOnBorrow="true"
    testOnReturn="true"
    validationQuery="select 1 from dual" />
    </Context>
    is some one can give me a help to solve it. Thanks in advance

    The "context" here is an artifact of the way that Tomcat works. It contains deployment information - the path to the application files, the JNDI mappings and various other bits and pieces.
    The "context" of a web application is the path to which it is deployed within the application server. An application deployed to a context called "foo" would probably be accessed by the following URL:
    http://localhost:8080/foo/And the application files would probably be stored somewhere like this:
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\fooTomcat keeps its context information EITHER in a file called server.xml or in a seperate file named after the application's context. So typically it will be in one of these files (for our "foo" application):
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\server.xml
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost\foo.xmlYou can create the entry in one of several ways:
    1. Edit server.xml manually
    2. Edit foo.xml manually
    3. Use an application such as the admin webapp to deploy your application
    4. Include a Context.xml file in the META-INF directory of the application
    The last option allows you to specify the default values that you want the application to take up when you deploy it to Tomcat. This saves time during development, but may cause problems for your clients when they come to deploy the application themselves.
    It is this last file that you seem to be talking about. You would normally create it as a directory and file within the source directory for your application, from which you build and deploy a WAR file. For example, you might build the following files and directories into foo.war:
    C:\dev\foo\index.jsp
    C:\dev\foo\WEB-INF\web.xml
    C:\dev\foo\META-INF\MANIFEST.MF
    C:\dev\foo\META-INF\Context.xml
    This would be built to a WAR file called foo.war that represents a Zip of the contents of the C:\dev\foo directory. Deploying this will cause Tomcat to notice Context.xml and extract its contents into the conf/Catalina/localhost directory as foo.xml

  • Context.xml seems to be not read

    Hello guys,
    I've a strange issue. My application use a connection pool through JNDI.
    Issue is that on production server (linux debian) my application can't connect to db!
    In catalina log I see
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))the issue is that in context.xml of my application (I use local context) user and password are different (i don't pass root user, but a specific user for db!).
    Is it possible tomcat is not able to read context.xml and so try to go with root user?Please help me, my application doesn't see db..
    this is my web.xml
    <resource-ref>
          <description>DB Connection</description>
          <res-ref-name>jdbc/MysqlJNDI</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>and this is my context.xml
    <Context antiJARLocking="true" path="/xxx">
        <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="-1"
          maxIdle="300" maxWait="1000000" name="jdbc/MysqlJNDI" password="yyy" removeAbandoned="true" removeAbandonedTimeout="30" type="javax.sql.DataSource"
          url="jdbc:mysql://ip/geco" username="zzz"/>
    </Context>Is there something I can do? Mysql is listening to this address, I can't access with my user through console...it's my jsf application that can't access and in the log appears root user...
    Please help me

    Hello guys,
    I've a strange issue. My application use a connection pool through JNDI.
    Issue is that on production server (linux debian) my application can't connect to db!
    In catalina log I see
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))the issue is that in context.xml of my application (I use local context) user and password are different (i don't pass root user, but a specific user for db!).
    Is it possible tomcat is not able to read context.xml and so try to go with root user?Please help me, my application doesn't see db..
    this is my web.xml
    <resource-ref>
          <description>DB Connection</description>
          <res-ref-name>jdbc/MysqlJNDI</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref>and this is my context.xml
    <Context antiJARLocking="true" path="/xxx">
        <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="-1"
          maxIdle="300" maxWait="1000000" name="jdbc/MysqlJNDI" password="yyy" removeAbandoned="true" removeAbandonedTimeout="30" type="javax.sql.DataSource"
          url="jdbc:mysql://ip/geco" username="zzz"/>
    </Context>Is there something I can do? Mysql is listening to this address, I can't access with my user through console...it's my jsf application that can't access and in the log appears root user...
    Please help me

Maybe you are looking for

  • I recently upgraded iTunes to 11.1.4.62 and then itunes would no longer recognize my iphone 4s and iPod

    I recently upgraded iTunes to 11.1.4.62 and then itunes would no longer recognize my iphone 4s and iPod although I can see the iphone but NOT the iPod on the computer (windows 8.1 Pro).  I checked everything , cable, services, stop and start and auto

  • IPhoto crashes every time i try to import!!!

    I just finished uninstalling and reinstalling iPhoto and then updating all the software updates because the application was crashing every time I opened it.  Well, now it'll open but crashes when I try to import something.

  • JDK 1.6 update n and compile with JRE

    With the new optimizations of the install of a JRE with java 6 update n, is it possible to compile with jre and just the parts of the jre that you need for your application? That is can we distribute a java application that only have the parts of the

  • Need XML table data out of Oracle Tables

    I have an application running using Java/XML technology. My database source is completely HOST and I communicate with HOST to get the data or to save/update the data through XML only. Here I have a situaion, I have my information in metadata (xml tab

  • Java applet help

    iam trying to put the checkboxes in different line so all the checkbox is alligned what the syntax to do that?? import java.awt.*; import java.applet.*; import java.awt.event.*; import java.text.DecimalFormat; public class Computers extends Applet im