Crystal Reports XI & Sun One 6.1 Web Server - Error Finding JNDI


Web tier: servlets, JSP, Web frameworks: Crystal Reports XI & Sun One 6.1 Web Server - Error Finding JNDI

  1. I am trying to create a Crystal Reports XI report in a JSP using Sun One 6.1 Web server sp 5.

    At this point I am getting the error “Error finding JNDI name” on Sun One
    The application will run on Netbeans/Tomcat

    I have done the following:
    I edited CRConfig.xml
    <?xml version="1.0" encoding="utf-8"?>

    <JavaDir>C:\Program Files\Java\j2re1.4.2_10\bin</JavaDir>



    I created a report using JDBC (JNDI) connection and have the JNDI Connection set to the name of DATA.

    The report works just fine in Crystal Reports.

    Then in Netbeans I created an application and it runs in the Tomcat part of Netbeans
    In context.xml I have:
    <Context path="/BOEnterpriseTest3">
         <Resource name="jdbc/dev" auth="Container" type="javax.sql.DataSource"
        driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@"
        username="theuserid" password="thepassword" maxActive="20" maxIdle="10" maxWait="-1"/>

    In web.xml I have


    in web-inf\sun-web.xml I have

    I have copied all of Common Files\Business Objects\3.0\java\lib and Common Files\Business Objects\3.0\java\lib\external to the lib folder

    I have copied crystalreportviewers11 to the root of my web application

    I have tried to load the JNDI information and display the report
    <%@page pageEncoding="UTF-8"

    InitialContext initContext = new InitialContext();
    DataSource source = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    // Look up our data source
      DataSource ds = (DataSource)initCtx.lookup("Data");
      out.println("found ds under jdbc/Data");
    catch ( NamingException e ){
    // Look up our data source
      DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/dev10g");
      initCtx.bind("Data", ds);
     out.println("found ds under java:com/env:jdbc/Data - bound into root initial context for Crystal to find");

    //Use the relative path to the report; the physical or full qualified URL cannot be used.
    String reportName = "useridincluded.rpt";
    //Database username and password
    String userName = "theuserid";
    String password = "thepassword";

    //check to see if the Report Source Session Variable already exist
    Object reportSource = session.getAttribute("Report1");

    // Create a new ConnectionInfos and ConnectionInfo object connectionInfos = new; connectionInfo = new;

    //Set username and password for the report's database

    //Add object to collection

    //---------- Create a ReportClientDocument -------------
        com.crystaldecisions.reports.sdk.ReportClientDocument reportClientDocument = new com.crystaldecisions.reports.sdk.ReportClientDocument();
        //---------- Set the path to the location of the report soruce -------------

        //Open report., 0);

        //Get the report source
        reportSource = reportClientDocument.getReportSource();

    //---------- Create the viewer and render the report -------------

    //create the CrystalReportViewer object crystalReportViewer = new;

    //set the reportsource property of the viewer

    //set the DB logon into the viewer

    //set viewer attributes
    //set the CrystalReportViewer print mode

    //process the report
    crystalReportViewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);


    On the Sun One Web server
    On the Java Tab
    JDBC Connection Pools
    Pool Name = dev10g
    Class name = oracle.jdbc.pool.OracleDataSource
    User id = theuserid
    url =

    JDBC Resources
    JNDI Name=dev10g
    Pool = dev10g

    I get the error finding JNDI name – how do I tell Sun One where the JNDI is to make Crystal Reports work?
  2. Hi;

    If you don't get this working please take a look at Windward Reports as it is very easy to use.

    thanks - dave