Beginner Q: Which context.xml to place the DataSource setup?

I am following this tutorial to use DataSource to access the database. http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
I originally place the Resource specificaiton in TOMCAT_HOME/conf/context.xml. My demo app works fine. I then experiment to move that section to My_App/Meta-inf/context.xml. Later, I need to uninstall and re-install Java and Tomcat. Then I run into to the problem in my demo http://forum.java.sun.com/thread.jspa?threadID=5299262
I finally restore the resource section in TOMCAT_HOME/conf/context.xml to make my demo working again. From this explaination of Context (http://tomcat.apache.org/tomcat-6.0-doc/config/context.html), my understanding is that placing the resource in My_App/Meta-inf/context.xml should be better for deployment purpose. I am not understanding the need to placing resource in conf/context.xml.
Is there any tutorial that will explain this context concept? I would like to see different setup in the path and docbase.

eventhough it's working fine. I may have deployment problem. Anyway thanks for the reply.
Regards,
Ram

Similar Messages

  • Tomcat 5.x, context.xml and the caseSensitive attribute.

    Hi,
    I have already configured a context.xml file in the CATALINA_HOME/conf/Catalina/localhost with the following content:
    <Context path="/mysite" docBase="${catalina.home}/webapps/mysite" reloadable="true"/>
    It is working, because the servlets can be reloaded after a modification. My goal is to make the URL recognition of the server for may web application case-insensitive. There is an attribute caseSensitive in the <Context> element? Is that right? And this can turn off case-sensitivity of this web application. This means it should also affect the URL recognition. But wen I change the line in the context.xml to
    <Context path="/mysite" docBase="${catalina.home}/webapps/mysite" reloadable="true" caseSensitive="false"/>
    and try to access the URL with different case then the original it does not find the page. Is this the right place to put the caseSensitive attribute?

    i am posting the Car.xml which i created in
    /conf/catalina/localhost directory in Tomcat 5.5.7
    ?xml version='1.0' encoding='utf-8'?>
    <Context path ="/Car" docBase="C:\Program
    Files\Apache Software Foundation\Tomcat
    5.5\webapps\Car" debug="0" />Rather than have you working directory under webapps, you can have it elsewhere in your system and refer to it using the docBase attribute. For example, say you have your work directory in d:\work\car,
    then
    <?xml version='1.0' encoding='utf-8'?>
    <Context  path ="/Car" docBase="d:/work/car"  />would suffice.
    cheers,
    ram.

  • Tomcat 5.5 context.xml, how to configure the Host element

    [Probably this question should be asked elsewhere, if so please advise]
    Dear all,
    I understand that Tomcat 5.5 prefers that your web application comes with a context.xml file under the META-INF folder.
    So I added a context.xml file under the META-INF folder of my web application,
    please have a look below.
    context.xml
    <Context path="" docBase="C://Program Files//Apache Software Foundation//Tomcat 5.5//webapps//test">
         <Resource
              name="jdbc/testDB"
              factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
              auth="Container"
              type="javax.sql.DataSource"
              maxActive="10"
              maxIdle="5"
              maxWait="10000"
              removeAbandoned="true"
              removeAbandonedTimeout="60"
              logAbandoned="true"
              username="username"
              password="password"
              driverClassName="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost:3306/test" />
    </Context> Ok, that is good so far, but how do I configure the Host element.
    I mean how do you link a specific Host to a specific Context?
    Before, the Context element was a sub element of the Host element,
    now it is completely separated.
    Host in server.xml
    <Host name="www.test.com" deployOnStartup="true" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
         <Valve
              className="org.apache.catalina.valves.FastCommonAccessLogValve"
              prefix="test_access_log."
              suffix=".txt"
              pattern="common"
              directory="C://Program Files//Apache Software Foundation//Tomcat 5.5//webapps//test//logs"/>
    </Host> I assume that if I modify the appBase of the Host element from webapps to webapps/test then it would work, but if I have several
    Contexts for the specific Host, how should I configure it then?
    Please help by giving examples!

    OK, I have changed the Host's appbase to webapps/mytestapplication.
    I want to deploy a test.war under the appbase:
    webapps/mytestapplication/test.war
    The name of the host is www.test.com
    Because the war file is not named ROOT.war (instead it is named test.war),
    the URL to the test application would be www.test.com/test.
    Now I have several relative anchor links in the test application
    Say for example the test application is deployed and accessed through www.test.com/test.
    Clicking on the aboutus link would change to URL to www.test.com/aboutus.html.
    Instead, for this to work, the URL must be www.test.com/test/aboutus.html.
    Obviously, the easiest solution is to add /test before each anchor link:
    But the there must a different solution.
    Adding a path to Context element did not work:
    <Context path="/test" ...>
    </Context>
    Question:
    1. what is the solution for the anchor scenario above, should I add /test before each link?
    2. Is my configuration (can be seen at the bottom) correct?
    Basically, I have removed the path and docBase attributes from the Context element.
    I have also set autoDeploy to false in the Host element.
    Here are a few paragraphs from the docs:
    autoDeploy attribute of Host element:
    "Finally, note that if you are defining contexts explicitly,
    you should probably turn off automatic application deployment.
    Otherwise, your context will be deployed twice each, and that may cause problems for your app."
    OK, so I set autoDeploy to false since I am defining contexts explicitly, (META-INF/context.xml)
    docBase attribute of Context element:
    The value of this field must not be set when the Context
    is configured using a META-INF/context.xml file as it will be inferred by the automatic deployment process.
    So, I remove the docBase attribute eventhough I am confused a bit.
    This is the part that confuses me:
    If autoDeploy is set to false since I am defining contexts explicitly,
    how can then anything be inferred by the automatic
    deployment process? (please answer!)
    There should not be any automatic deployment process when autoDeploy is set to false.
    path attribute of Context element:
    The value of this field must not be set except when statically defining a Context in server.xml,
    as it will be inferred from the filenames used for either the .xml context file or the docBase.
    Same as the Context element.
    Thanks!
    <Context>
         <Resource
              name="jdbc/testDB"
              factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
              auth="Container"
              type="javax.sql.DataSource"
              maxActive="10"
              maxIdle="5"
              maxWait="10000"
              removeAbandoned="true"
              removeAbandonedTimeout="60"
              logAbandoned="true"
              username="username"
              password="password"
              driverClassName="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost:3306/test" />
    </Context>
    <Host name="www.test.com" deployOnStartup="true" debug="0" appBase="webapps/mytestapplication" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
         <Valve
              className="org.apache.catalina.valves.FastCommonAccessLogValve"
              prefix="test_access_log."
              suffix=".txt"
              pattern="common"
              directory="C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/mytestapplication/test/logs"/>
    </Host>

  • 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

  • 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.

  • Field in the table but not in the datasource

    I have a datasource 0co_pc_act_05 based on mbew table . I need a field from that table , which is not present in the datasource , what should i do .?
    How can i get the field from the table into the datasource?
    Thanks

    hi Mike,
    try following steps
    - in r/3 transaction rsa6 choose the datasource, click enhance strucutre, then append structure, system will propose z..., confirm it, in the next screen, type in the field name e.g abcd
    - activate the append structure
    - back to rsa6 choose the datasource, click edit, remove mark in column 'hidden' field for that field, save the datasource.
    - in this case you no need to do user exit since that field exist in the origin table where the data extracted.
    - recheck with rsa3
    later in bw side
    - create new infoobject, then right click the datasource and 'replicate datasource', change transfer rules, move the new field from right side to left (to be included in transfer structure), then assign the field by type in the new created infoobject name, activate the transfer rules. include also this new object in infocube etc.
    hope this helps.

  • Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?

    Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?
    �Unflatten From XML� is of little use in parsing because it requires the data type. So it seems that the user has to parse each data value, and then �Unflatten From XML� can help a little.
    I would like to see NI provide a VI for parsing it�s own schema.

    LabVIEW's XML functions are another way of saving data from controls and indicators that is in a more standardized format. If you look at the Unflatten From XML shipping example, it shows taking the data that you would normally send to a Digital Wveform Graph and converting it to XML instead. This data is then unflattend from XML and wired to the graph. Since you know what you wrote to the file, this is an easy thing to do. If what you are looking for is a way to look at any data in any LabVIEW XML file, then you are right, there is not a VI for that. However, I do not believe that that was the intention of the XML functions in the first place.
    By wiriting data in XML, this allows other applications outside of LabVIEW to parse and recognize the dat
    a. In LabVIEW, you would already know the types and can place a generic item of that type. The issue of knowing the type is that you need to know the type of the wire that comes out of the Unflatten function so that the VI will compile correctly. You could always choose a variant value to unflatten and then do some parsing to take the variant a part. Maybe this will help you out.
    See this example for using the Microsoft parser for XML. (http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CB9FE111EE034080020E74861&p_node=DZ52050&p_submitted=N&p_rank=&p_answer=)
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • To Place the XML file from one folder to another folder in AL11

    Hi All,
      Here my requirement is to create the quotes using XML document. The XML document will come from the Application server. this one is fine.
    Now my prob is after processing the XML file, we have to place the XML file into another folder.
    Please let me know how to move the data inot XML file.
    Now iam reading the data into one variable V_string(it will contains the total XML file). From this variable how to move the data into APplication server.
    Please do the needful.
    Regards,
    Sreehari

    Hi,
    Use FM WS_FILE_COPY To FIrst Copy the File to some Location
    and Next Use FM TMP_GUI_DELETE_FILE To Delete the File from Old LOcation.
    Regards
    Bala.M

  • In which place the  MDM Iviews resides in portal

    help me understand the MDM Java architecture and In which place the  MDM Iviews resides in portal. Can any one Help me on this

    Hi Pandian,
    please follow the below useful links about MDM ivews.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/bebdb8c4-0801-0010-aa81-a9b8d14e8415?QuickLink=events…
    Creating and Managing iViews (SAP Library - MDM Portal Content Development Guide)
    https://scn.sap.com/thread/968936
    Thank you
    Rahul

  • Is it possible to create a Webservice in BI which takes XML as an input and gives PDF as output with an additional requirement that Siebel expecting the XSD from BI to send data in the BI requested format

    Is it possible to create a Webservice in BI which takes XML as an input and gives PDF as output with an additional requirement that Siebel expecting the XSD from BI to send data in the BI requested format. Siebel wants to send the data as xml to BI but not sure of the BI capabilities on giving WSDL embedded with XSD (input is a hierarchical)

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • 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());

  • How to place the images in Indesign xml file by Javascript?

    How to place the images in Indesign xml file by Javascript?
    We got the Indesign xml file, how to give the image placement link by Indesign javascript? Please help me its urgent.

    Hi,
    You can pass the image url as a href attribute=> file:///Users/me/Documents/my_pic.jpg directly within your xml. It just needs that you pass a local, static and valid url.
    If you want to add image later once the xml is flowed and so target specific nodes and inject images, it's a bit more complex. If the node is not part of the layout, you may try to reach the XMLElement objet and such an attribute, then layout the element.
    var x = some XMLElement
    x.xmlAttributes.add("href","file:///Users/m/Documents/my_pic.jpg" );
    If already placed, then you have to get the associated pageItem, then place your file into it.
    pagItm.place ( File ( "/Users/m/Documents/my_pic.jpg" ) );
    Hope that helps,
    Loic
    http://www.loicaigon.com

  • How to edit bitmap which is imported in flash using xml and save the edited bitmap back to xml in flash.

    hi all
    It would be appreciated if any one let me know how to edit
    bitmap which is imported in flash using xml and save the edited
    bitmap back to xml in flash.
    Is it posible to save the bitmap data in flash?
    thanks in advance

    Yes you can... but like I said before you need to upload the
    data from the changes you make to a server.
    In terms of the solution... its unlikely that you'll find one
    specifically for your needs. You will have to learn whatever you
    don't know how already and maybe adapt some existing examples to
    your needs.
    To change the visual state of a movie clip... you just do all
    the regular things that you want to do to it using flash... scale,
    rotation, drawing API , textfields etc in actionscript. If you
    don't know how to how to do that stuff, then you need to learn that
    first. That's basic actionscript.
    You can capture the visual state of a movieclip using the
    BitmapData class. That includes a loaded jpeg. You can also
    manipulate bimatp data using the same class. You should read up on
    that if you don't know how to use it or check out the examples
    below for uploading info.
    For uploading to the server:
    Here's an as2 solution that took 15 secs to find using
    google:
    http://www.quasimondo.com/archives/000645.php
    If you're using as3, google search for "jpeg encoder as3" and
    look through that info. There are also historical answers in the
    forums here related to this type of thing that might help as
    well.

  • How to place the xml contents into textframe?(cs2_js)

    after flow the xml into indesign document,i able to get the particular xml element and its contents in a variable.
    i want to know how to get certain range of xml element's contents and how to place that in textframe?
    //for get content
    app.activeDocument.xmlElements.item("header1").contents
    if i place the particular element's contents in xml structure extra tags added at edge
    i want to avoid that duplication also
    thanks in advance
    by
    subha

    Hi,
    Use FM WS_FILE_COPY To FIrst Copy the File to some Location
    and Next Use FM TMP_GUI_DELETE_FILE To Delete the File from Old LOcation.
    Regards
    Bala.M

  • 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.

Maybe you are looking for

  • Method not found exception

    Getting exception on javax.net.ssl.SSLsession.getPeerCertificates method not found. The exception is being thrown from sun.net.www.protocol.https.HttpsClient.b Project built with JBuilder version 8. Using Jakarta Tomcat 4.0.4 and J2sdk1.4.0_01 JBuild

  • Is there a way to stop creation of invoice that refers delivery items with

    Dear Friends I have items in delivery with qty 0 ( this is required for IDOC processing ) The Invoice was also created with 0 qty  with refrerence to the Delivery, is there a way to stop creation of invoice that refers delivery items with zero qty. R

  • Questions for compare some tools

    Hello, I'm comparing some storage tools. I want to know these questions about iCloud: 1. Does iCloud has a finder? (I supose yes) Can it find files searching words of the content file? 2. Can you tag a file whit your own words, and retrieve the file

  • Deleting duplicates (filenames) in iPhoto 6 (SIX) ?

    I know there have been other threads on this, but is there a way to find and/or delete duplicates (same filename, same image) from iPhoto 6? (iPhoto Diet is for ver 5 only, for example).

  • MacBook and 17" MacBook Pro Power Cords Interchangable?

    Can I use the adaptor/charger (both are MagSafe) from my MacBook on my 17" MacBook Pro? Is it safe? Will it harm the the battery?