PrintServiceLookup.lookup in Tomcat

Hi Forum,
How could I get javax.print.PrintServiceLookup.lookupPrintServices(null,null) to return the current available services while the program that uses lookupPrintServices is running? In a tomcat servlet, I use the lookupPrintServices(..) to get a list of the printer services available. The class works well and returns the
list but if I install a new printer, the servlet does not list the newly installed service until I restart Tomcat.
Is there a way to unload and reload the PrintServiceLookup class and then call PrintServiceLookup.lookupPrintServices?
It appears that the lookupPrintServices(..) returns the list of services that was available when the instance of the virtual machine was started. Hence, while the instance is running, it allways returns the same list of
services. If I run a program that lists the services and then exits, the program lists the newly added printer on re-run. But if the program never exits (it runs in a loop, re-listing the services every so often), and I add
a new printer while the program is running, the newly added printer is not listed until I terminate the pogram and re-start it.
Thanks in advance for your response

Thank for your response,
It appears that there is a bug in the JDK. A bug reported against the SUN JDK for this problem and it seeems that the bug has not been resolved yet.
A ling to the bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4744405
A brief description of the reported bug:
Bug ID: 4744405
Votes 17
Synopsis RFE: lookupPrintServices() to refresh the printers list dynamically
Category java:classes_2d
Reported Against 1.4 , 1.4.1
Release Fixed
State In progress, request for enhancement
Related Bugs 5028849 , 5033703
Submit Date 10-SEP-2002
Description *This also happened on Windows platform.
java version "1.4.1-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)
When invoke method lookupPrintServices() on class PrinterJob or PrintServiceLookup, the printers list can not refreshed when adding or deleting printers dynamically.
Steps to follow to reproduce the problem:
1. Compile and run the included test case
2. The print dialog shows up and avaible printers information is printed out on screen. Click "cancel" to dismiss the dialog. The test case is pending.
3. Use Printer Selector Tool to add a new printer into selected printers list and save changes.
4. Back to the terminal that run the test case an click "enter" button to continue. Then a new thread will be created to invoke the lookupPrintServices() and pop up the print dialog again.
5. The screen output shows that invoking lookupPrintServices() doesn't reflect the newly added printer information, neither does the print dialog.
//-------- source code begin-----------//
import java.awt.print.*;
import javax.print.*;
public class MTPrinterTest extends Thread {
public static void main(String[] args) {
MTPrinterTest t1 = new MTPrinterTest();
t1.start();
try {
System.in.read();
} catch (Exception e){}
MTPrinterTest t2 = new MTPrinterTest();
t2.start();
public void run() {
PrinterJob printerJob;
PrintService[] printServices;
printerJob = PrinterJob.getPrinterJob();
printServices = printerJob.lookupPrintServices();
System.out.println("Number of servies found: " + printServices.length);
for (int i =0; i< printServices.length; i++)
System.out.println("--> Available Printer " + i + ": " + printServices);
printerJob.printDialog();
//-------- source code end ----------//
Work Around Exit the current running application and run it again, then the printers list get refreshed. Seems the running JVM can not get updated printer information

Similar Messages

  • JNDI lookups on Tomcat 5.5 and Oracle XE

    Hi there!
    I'm using Oracle 10g XE and Tomcat 5.5.9. I just wanna get advice on how to do JNDI lookups. I know XE doesn't have native support for Java and servlets and I noticed the "jndi.jar" file is missing in XE, unlike in Oracle 10g EE. Is "jndi.jar" required for JNDI functionality on XE, or can I just use Tomcat's JNDI functionality to do the lookups? Any input would be appreciated. Tnx!
    Leslie

    Hmmm
    After some search and restart the oracle-xe and checking the "alert_XE.log" file I found some strange!
    Some lib files was missing (no link was made in the /usr/lib path)
    And the dbf file "/usr/lib/oracle/xe/oradata/XE/control.dbf" was missing......
    I remove the installation (rpm -e oracle-xe)
    and then reinstall it.
    Run the config and now I can access the host!
    It seams that the installation scripts is not perfect!
    I hope this will help some other.
    //TEW

  • JNDI lookup from Tomcat to EJB Container

    Hello!
    i am currently trying to use a combination of Catalina and an external EJB Server (running on another machine).
    i am really struggeling with doing the jndi lookup. i have no idea where and how to set the properties in the web server and do the mapping from the ejb-refs to the jndi name? (since tomcat doesnt seem to have a deploymentplan?!)
    maybe someone here knows the problem and can help, please?
    (i am not sure but this might also be the wrong discussion group for that??)
    thanks
    wolfgang

    Hello Wolfgang,
    I solved this problem by setting the proper jndi properties in the startup phase (MyInitServlet) by System.setProperty(...).
    This seems ugly, but it works.
    Tilo

  • EJB lookup from Tomcat deployed on J2ee Engine

    Hello  All,
                            I have a jsf application which runs on tomcat, Now I developed a EJB (stateless) in NWDS and deployed on SAP j2ee engine, when I run a plain java calss I am able to access it but not  through my web-app. Can anybody throw some light on why this is happening?
    Thanks in Advance
    Somil

    Hello  All,
                            I have a jsf application which runs on tomcat, Now I developed a EJB (stateless) in NWDS and deployed on SAP j2ee engine, when I run a plain java calss I am able to access it but not  through my web-app. Can anybody throw some light on why this is happening?
    Thanks in Advance
    Somil

  • JNDI lookup for Crystal Reports at runtime

    How to run a rpt to fetch data from database connection defined in Tomcat's JNDI resources ? We are using JDBC(JNDI) Data source while designing the report in the Crystal Report designer and we want to use 'Connection Name' at runtime for jndi lookup to Tomcats JNDI resources.

    Hi,
    Thanks, this helped in resolving the JNDI lookup problem. But we are not having an issue in connecting to DS as it fails with error "Unsupported JNDI Object".
    Tried suggestions on this link: "http://www.theserverside.com/discussions/thread.tss?thread_id=37430", but no luck.
    Here are the configuration files:
    context.xml:
    <Context>
    <Resource name="jdbc/remedy" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@10.76.85.68:1521:dtv" maxActive="20" maxIdle="10" maxWait="-1" />
    </Context>
    web.xml:
    <resource-ref>
              <description>DB Connection</description>
              <res-ref-name>jdbc/remedy</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
    </resource-ref>
    Log:
    2009-10-30 06:38:05,804 DEBUG [com.crystaldecisions.reports.formatter.a.c] - Export Supervisor: number of destination exporters:1
    2009-10-30 06:38:05,804 DEBUG [com.crystaldecisions.reports.formatter.a.c] - Export Supervisor: number of format exporters:4
    2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 received request: fetchReportPageRequest
    2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 attempting to acquire license
    2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 successfully acquired license
    2009-10-30 06:38:05,867 DEBUG [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - Requesting page 1
    2009-10-30 06:38:05,879 INFO [com.crystaldecisions.reports.queryengine.driverImpl] - Logon: Connecting to database using local JNDI server ...
    2009-10-30 06:38:05,888 DEBUG [com.crystaldecisions.reports.reportdefinition.datainterface] - Failed to open connection (Connection:  databaseType=JDBC (JNDI)  serverName=jdbc:oracle:thin:@10.76.85.68:1521:dtv  state=closed  databaseDriverName=crdb_jdbc.dll).
    com.crystaldecisions.reports.queryengine.al: Unsupported JNDI Object (remedy)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.if(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.i.if(Unknown Source)
         at com.businessobjects.reports.sdk.b.i.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.i.byte(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)
         at com.crystaldecisions.report.web.event.ac.a(Unknown Source)
         at com.crystaldecisions.report.web.event.ac.a(Unknown Source)
         at com.crystaldecisions.report.web.event.b2.a(Unknown Source)
         at com.crystaldecisions.report.web.event.b7.broadcast(Unknown Source)
         at com.crystaldecisions.report.web.event.av.a(Unknown Source)
         at com.crystaldecisions.report.web.WorkflowController.do(Unknown Source)
    Edited by: MuralidharS on Oct 30, 2009 8:46 AM

  • Accessing Tomcat 4.03 JNDI service from JAAS LoginModule

    Hi!
    I have following problem:
    I have custom JAAS LoginModule that uses JNDI to lookup DataSource object.
    My LoginModule and LoginConfiguration implementation classes are located
    in Tomcat's classpath.
    I tried first to put JAAS related classes under [TOMCAT-HOME]/common/lib,
    but that caused exception:"Unable to load LoginConfiguration".
    It looks like Java's core classes have no access/visibility to classes under Tomcat.
    I'm using JAAS authentication directly from a servlet, so I'm using no
    Tomcat specific realms in authentication.
    Servlet just calls:
         LoginContext lc = new LoginContext( jaasApplName,
    customUserPasswordCallbackHandler );
         lc.login( );
    Everything works fine until LoginModule tries to lookup datasource
    after obtaining InitialContext with
              InitialContext initCtx = new InitialContext( );
              DataSource ds = (javax.sql.DataSource) initCtx.lookup(
    dataSourceName );
    I got exception with message : "Name MIPCoreDS is not bound in this
    context.".
    MIPCoreDS is configured in Tomcats configuration file server.xml under
    <GlobalNamingResources> tag.
    Should this be visible for JAAS Login module or not?
    When servlet's make same lookup under Tomcat, datasource is found fine.
    It seems that loginModules have no visibility to JNDI objects configured
    under Tomcat.
    Is this right?
    Is it possible any way to put JAAS working with Tomcat 4.0.3, so
    that LoginModules can access JNDI objects bound to Tomcat's JNDI service?
    Is it possible to call Tomcat's JNDI service outside Tomcat?
    Any help is appreciated.
    Best Regards,
    Aki

    Using JAAS in Servlets is messy - I found a working example at
    http://www.loadedanswers.com
    go to the Documents section and the eg is there.
    Have fun :)

  • JNDI Lookup in OC4J *AND* Tomcat 5 (not either/or)

    I've been struggling to get a web application to deploy and run correctly on Tomcat 5.x. I couldn't ADF to look up the Datasource I'd set up in the Tomcat configs. After reading this forum post:
    Problem deploying BC4J Toy Store app on Tomcat 4
    I was able to run my test app successfully on Tomcat by prepending 'java:comp/env/' to the JNDI name of my Datasource in bc4j.xcfg. Unfortunately, specifying the JNDI name in this way breaks the JNDI lookup in the embedded OC4J container. The impression I got from the above forum post was that OC4J should be able to look up the data source when the name is specified as either jndi/myDataSource or java:comp/env/jndi/myDataSource. I can only get it to work with the former.
    Is there a way to specify the JNDI name of a datasource in bc4j.xcfg such that both Tomcat AND the embedded OC4J container within JDeveloper will be able to look it up?
    Thanks,
    -Matt

    To answer my own question, a fairly straight-forward way of achieving this is to use two configurations for the application module: one for testing locally (the supplied configuration), and another one for deployment that is a copy of the first except for the JNDI name. I can switch between the configurations via the Databindings depending on whether I want to test locally or deploy to Tomcat.
    This is certainly a useable solution, but I'm bothered by the fact that I need to reference the JNDI name in two different ways. Shouldn't this be container-independent?
    -Matt

  • Tomcat 5- dns lookup- jvm params

    Hello Experts,
    I am writing a filter to restrict access to the parts of the web application based on domain name.
    In my doFilter method I added this code:
    HttpServletRequest req = (HttpServletRequest) request;
    String id = req.getSession().getId();
    String ipaddress = req.getRemoteAddr();
    String remoteHost=req.getRemoteHost();
    unfortunately remoteHost contains IP address when the application is accessed via IIS-Tomcat integration. If it is accessed using http://localhost:8080 (without IIS) I get domain name in remoteHost. I have enabled lookups=true in both AJP 1.3 connector also
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="true" redirectPort="8443" debug="0"
    protocol="AJP/1.3" />
    Still I get ip address via req.getRemoteHost(). What am I missing?
    So I thought of using java.net package to do it:
    String hostname = InetAddress.getAllByName( "199.93.4.15" ) .getHostName();
    From java doc:
    InetAddress Caching
    The InetAddress class has a cache to store successful as well as unsuccessful host name resolutions. The positive caching is there to guard against DNS spoofing attacks; while the negative caching is used to improve performance.
    By default, the result of positive host name resolutions are cached forever, because there is no general rule to decide when it is safe to remove cache entries. The result of unsuccessful host name resolution is cached for a very short period of time (10 seconds) to improve performance.
    "host name resolutions are cached forever"--> cached forever
    To rectify this I would like to set a default time period for caching using jvm parameter "networkaddress.cache.ttl (default: -1) "
    but how do I set this parameter for Tomcat 5 started as service in windows 2000. One option is to set the JAVA_OPTS environment variable... which our system admin do not want to use. Is there an alternative way to set the parameter.
    Also, is there an easy way to access jvm parameters in Filter or servlet?
    Thank you in advance for your help!!!

    Actually, I found some settings in registry: HKLM\software\Apache Software Foundation\Tomcat5\Parameters\Java
    Key
    Options
    Value:
    -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.0
    -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\endorsed
    -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.0
    I added -Dnetworkaddress.cache.ttl=100 to the value and restarted Tomcat. I logged the value of "networkaddress.cache.ttl " in my Filter and it works :) I changed the vlaue from 100 to 10 and restarted ... the log shows 10... so this confirms that it is using the value from registry at this location...
    I got this idea from Tomcat Service Manager:
    http://web.bvu.edu/staff/david/index.jsp?section=software&subsection=tcservcfg&page=overview
    I didnt want to install it and change using this tool as I am not sure for what version of Tomcat it is designed for.
    You can also modify service.bat file in bin directory that comes with Tomcat.
    Let me know if anyone needs more help!!

  • Is it possible to set Tomcat Manager to lookup roles from DataSourceRealm?

    I know the Realm Configuration docs say that "Tomcat does not provide any built-in capabilities to maintain users and roles", but manager.xml contains the comment "Link to the user database we will get roles from", so that seems to imply that you can link to a different user database.
    I thought I could do this with JDBCRealm, but after using UserDatabaseRealm, I thought I might set up the dbase as a JNDI Datasource and authenticate and lookup roles via UserDatabaseRealm.
    After getting my database configured as a JNDI DataSource, and failing to authenticate against it via JNDIRealm, I realized that DataSourceRealm is a variation on JDBCRealm where you refer to the dbase via a JNDI DataSource. I have DataSourceRealm working, and I changed my Manager ResourceLink to point to the JNDI DataSource, but Tomcat Manager still can't lookup roles from anything other than the tomcat-users.xml demonstration file.
    The Admin Tool has screens where you can create users and roles, but this only seems to work with MemoryRealm and UserDatabaseRealm (xml files).
    Is this all just for demonstration?
    Is there no possibility of configuring TC Manager and Admintool to interface with an alternate user database (relational)?
    Shouldn't the docs clarify this by stating that you shouldn't bother trying to point the Manager ResourceLink at an alternate user database because it can't be done and the functionality is for demonstration of MemoryRealm and UserDatabaseRealm only?

    Its a 'Yes' or 'No' question.

  • Tomcat 5.5 Session lookup exception

    Hi, could someone please make my newbie day!!
    using Tomcat 5.5.14 and the default JDK is JSE 1.5
    I wanted to try send email from my EmailServlet,
    but since JSE 1.5 does not provide the javax.mail and to be able to write the code needed to send an email you have to to include the Mail.jar provided in my libraries to get " javax.mail , javax.mail.internet and javax.mail.event " etc.
    I configured the web.xml, context.xml as followed and placed the the two jar�s " mail.jar and activation.jar " in the Tomcat /common/lib
    but here is the problem, when deploying the webapplication, the Mail.jar are copied to the webapplication " web/lib " map, since i included it to get the API of javax.mail.. this would reslut in not following the Tomcat configuration process ( do not place the same jar in the application/web/lib and the server common/lib ).
    Iam using James as Smtpserver.
    Getting an exception when reaching the lookup for session in my servlet
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    --> Session session = (Session) envCtx.lookup("mail/Session");
    the Exception does not tell me a jack
    ExceptionMessage =( javax.mail.Session )
    ExceptionStacktrace = ( [Ljava.lang.StackTraceElement;@1c71508 )
    I have a feeling of doing something wrong by having the Mail.jar placed in those meansend dirctories..
    Help me out please                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi
    I also have a similar problem?? whom did u seek help from? can you give me his email...
    I have tomcat 5.5.15 and jdk 1.5 that runs a jsp page to send emails..but i am getting the
    java.lang.NoClassDefFoundError: javax/mail/MessagingException
    i have read your mail. But why is this tomcat 5.5 not distributing mail.jar and activation.jar which are required by javaMail!!
    and what changes i need to make in server.xml??
    Also, i am trying to download the mail.jar from sun..but it's taking me to FATAL EXCEPTION page...
    I need to fix this by end of this day..I need HELP SO DESPERATELY...PLZ HLP..me
    Also for more detail refer this posting that i posted in jsp forum..
    http://forum.java.sun.com/thread.jspa?threadID=708835&tstart=0
    Thanks
    Sri

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

  • Error connecting to an EJB 3.0 Remote on OC4J 10.1.3.2 from Tomcat

    Hi, I want to connect to a Remote Session Bean running on the OC4J 10.1.3 and it doesn´t work.
    I have connected to it from a java standalone application using:
    public static void main(String [] args) {
    try {
    final Context context = getInitialContext();
    SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
    System.out.println(sessionEJB.mergeEntity(""));
    System.out.println( "hola" );
    } catch (Exception ex) {
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException {
    Hashtable env = new Hashtable();
    // Standalone OC4J connection details
    env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.naming.ApplicationClientInitialContextFactory" );
    env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
    env.put( Context.SECURITY_CREDENTIALS, "passw" );
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/ejb3jar");
    return new InitialContext( env );
    with this application-client.xml file:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <application-client 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/application-client_1_4.xsd" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <display-name>Model-app-client</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <remote>ar.com.eds.ejb3.model.SessionEJB</remote>
    <ejb-link>SessionEJB</ejb-link>
    </ejb-ref>
    thats works fine, but when I try to use the same solution from a jsf proyect running on a Tomcat 5.5.20, it fails with this error:
    Caused by: java.lang.RuntimeException: Error while creating home.
         at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:32)
         at ar.com.mcd.fawkes.ui.locator.ServiceLocator$1.get(ServiceLocator.java:12)
         at net.sf.opentranquera.web.jsf.locator.ServiceLocatorBean.get(ServiceLocatorBean.java:42)
         at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
         at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)
         at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:171)
         at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
         at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)
         ... 80 more
    Caused by: javax.naming.NameNotFoundException: Name ejb is not bound in this Context
         at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
         at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at ar.com.mcd.fawkes.ui.locator.EJB3Locator.get(EJB3Locator.java:28)
         ... 87 more
    Could you please help me with any tip?
    Mauricio
    Message was edited by:
    Mauricio

    Hi, Rick
    Thanks for your help.
    I deleted de application-client.xml file, added the following lines to the web.xml file:
         <ejb-ref>
              <ejb-ref-name>ejb/SessionEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <remote>ar.com.eds.ejb3.model.SessionEJB</remote>
         </ejb-ref>
    and now I´m using oracle.j2ee.rmi.RMIInitialContextFactory
    there is no error, and it doesn´t throw any exception but the following line returns null.
    SessionEJB sessionEJB = (SessionEJB)context.lookup("java:comp/env/ejb/SessionEJB");
    Its seems the lookup method finds the remote ejb because it doesn´t fail, but it returns null.
    Any idea what is wrong?
    Mauricio.

  • Error in starting SPLService on Tomcat

    Hi,
    I get an error while starting CC&B v2.1.0 installed at my local machine on Tomcat. Hereunder is the SPL.log :
    - 10:32:37,953 [main] INFO (web.startup.SPLWebStartup) Initializing SPL web application
    - 10:32:37,953 [main] INFO (shared.context.ApplicationMode) Application is running web-based
    - 10:32:37,953 [main] INFO (shared.context.ApplicationMode) Application set to production mode
    - 10:32:38,031 [main] INFO (web.dynamicui.TransformServletHelper) Disable UIPage Compression set to false
    - 10:32:38,968 [main] INFO (support.context.ContextFactory) Creating default context
    - 10:32:39,093 [main] INFO (shared.environ.ApplicationProperties) loaded properties from resource spl.properties: {spl.runtime.service.extraInstallationServices=CILTINCP, spl.runtime.cobol.remote.jvmcommand=D:/CCB_Install/jdk1.5.0_09/bin/java.exe, spl.tools.loaded.applications=base,ccb,cm, spl.runtime.cobol.remote.jvmcount=1, spl.runtime.socket.file.dir=D:/ccbenv/ccbdemo/runtime, spl.runtime.cobol.sql.fetchSize=150, spl.runtime.cobol.cobrcall=false, spl.runtime.cobol.encoding=UTF8, spl.runtime.cobol.sql.disableQueryCache=false, spl.runtime.utf8Database=true, spl.runtime.cobol.remote.jvmoptions=-Xmx156m -server -Dfile.encoding=ISO8859_1 -cp D:/ccbenv/ccbdemo/splapp/standalone/config;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-beanutils-1.6.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-codec-1.3.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-collections-2.1.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-fileupload-1.1.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-httpclient-2.0.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-io-1.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-lang-2.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-logging-1.0.4.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/concurrent-1.3.4.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/dom4j-1.6.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/hibernate-3.1.3.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/icu4j-3.6.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/jaxen-1.1-beta-11.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/jta.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/jtds-1.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/log4j-1.2.11.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/mfcobol.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/spl-base-2.1.0.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/spl-shared-2.1.0.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/spl-xai-2.1.0.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/xstream-1.2.1.jar, spl.runtime.environ.init.dir=D:/ccbenv/ccbdemo/etc, spl.runtime.cobol.sql.cache.maxTotalEntries=1000, spl.runtime.oracle.statementCacheSize=300, spl.runtime.cobol.remote.rmiStartPort=5503, spl.runtime.cobol.sql.cursoredCache.maxRows=10, spl.runtime.cobol.remote.jvm=true, spl.runtime.sql.highValue=}
    - 10:32:47,140 [main] WARN (shared.environ.ContextManagedObjectSet) Could not load resource com/splwg/cm/domain/contextManagedObjects.xml on classpath. This may be harmless but could mean a problem with the classpath. Please verify that the classpath for application cm is correctly configured.
    - 10:33:12,234 [main] INFO (support.context.ContextFactory) Registering lookups
    - 10:33:12,593 [main] INFO (support.context.ContextFactory) 480 lookups registered, time 348.717 ms
    - 10:33:12,593 [main] INFO (support.context.ComponentContainerLookupHelper) Initializing constants on 505 lookup interface classes
    - 10:33:13,187 [main] INFO (support.context.ComponentContainerLookupHelper) Done initializing lookup constants, time 594.028 ms
    - 10:33:13,187 [main] INFO (support.context.ContextFactory) Registering algorithm spots
    - 10:33:13,187 [main] INFO (support.context.ContextFactory) 99 algorithm spots registered, time 0.168 ms
    - 10:33:13,187 [main] INFO (support.context.ContextFactory) Registering algorithm components
    - 10:33:13,187 [main] INFO (support.context.ContextFactory) 46 algorithm components registered, time 0.045 ms
    - 10:33:13,187 [main] INFO (support.context.ContextFactory) Registering batch jobs
    - 10:33:13,187 [main] INFO (support.context.ContextFactory) 13 batch jobs registered, time 0.036 ms
    - 10:33:13,187 [main] INFO (support.context.ContextFactory) Registering Entities
    - 10:33:15,515 [main] INFO (support.context.ContextFactory) 812 entities registered, time 2,320.145 ms
    - 10:33:15,515 [main] INFO (support.context.ContextFactory) Registering Components
    - 10:33:15,515 [main] INFO (support.context.ContextFactory) 227 components registered, time 1.367 ms
    - 10:33:15,515 [main] INFO (support.context.ContextFactory) Registering Change Handlers
    - 10:33:15,515 [main] INFO (support.context.ContextFactory) 200 handlers registered, time 0.386 ms
    - 10:33:15,515 [main] INFO (support.context.ContextFactory) Registering Services
    - 10:33:15,671 [main] INFO (support.context.ContextFactory) 313 services registered, time 158.694 ms
    - 10:33:15,671 [main] INFO (support.context.ContextFactory) Registering Code Description queries
    - 10:33:15,687 [main] INFO (support.context.ContextFactory) 40 code/description queries registered, time 0.060 ms
    - 10:33:15,687 [main] INFO (support.context.ContextFactory) Registering cobol programs
    - 10:33:16,140 [main] INFO (support.context.ContextFactory) 187 cobol copybooks registered, time 455.640 ms
    - 10:33:16,140 [main] INFO (support.context.ContextFactory) Registering cobol programs
    - 10:33:16,140 [main] INFO (support.context.ContextFactory) 39 cobol programs registered, time 0.048 ms
    - 10:33:16,140 [main] INFO (support.context.ApplicationContext) Building hibernate configuration
    - 10:33:16,687 [main] INFO (support.context.ApplicationContext) Adding 812 hibernate mappings
    - 10:33:17,640 [main] INFO (support.context.ApplicationContext) Added 100 mappings
    - 10:33:18,250 [main] INFO (support.context.ApplicationContext) Added 200 mappings
    - 10:33:19,015 [main] INFO (support.context.ApplicationContext) Added 300 mappings
    - 10:33:19,609 [main] INFO (support.context.ApplicationContext) Added 400 mappings
    - 10:33:20,562 [main] INFO (support.context.ApplicationContext) Added 500 mappings
    - 10:33:21,140 [main] INFO (support.context.ApplicationContext) Added 600 mappings
    - 10:33:21,734 [main] INFO (support.context.ApplicationContext) Added 700 mappings
    - 10:33:22,343 [main] INFO (support.context.ApplicationContext) Added 800 mappings
    - 10:33:22,406 [main] INFO (support.context.ApplicationContext) Added 812 mappings
    - 10:33:22,500 [main] INFO (support.context.ApplicationContext) Done building hibernate configuration, time 6,351.886 ms
    - 10:33:22,500 [main] INFO (support.context.ApplicationContext) Building hibernate session factory
    - 10:33:24,218 [main] INFO (hibernate.connection.ConnectionProviderFactory) Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider
    - 10:33:24,218 [main] INFO (hibernate.connection.C3P0ConnectionProvider) C3P0 using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@localhost:1521:etmdemo
    - 10:33:24,218 [main] INFO (hibernate.connection.C3P0ConnectionProvider) Connection properties: {user=ccbuser, password=****}
    - 10:33:24,218 [main] INFO (hibernate.connection.C3P0ConnectionProvider) autocommit mode: false
    - 10:33:24,234 [main] INFO (v2.log.MLog) MLog clients using log4j logging.
    - 10:33:24,640 [main] INFO (v2.c3p0.C3P0Registry) Initializing c3p0-0.9.0.4 [built 23-January-2006 22:20:29 -0500; debug? true; trace: 10]
    - 10:33:24,812 [main] INFO (v2.c3p0.PoolBackedDataSource) Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@215748 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@100269d [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 100269d, idleConnectionTestPeriod -> 0, initialPoolSize -> 1, maxIdleTime -> 300, maxPoolSize -> 150, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@56be4e [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 56be4e, jdbcUrl -> jdbc:oracle:thin:@localhost:1521:etmdemo, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 215748, numHelperThreads -> 3 ]
    - 10:33:26,296 [main] INFO (hibernate.dialect.Dialect) Using dialect: org.hibernate.dialect.Oracle9Dialect
    - 10:33:26,312 [main] INFO (hibernate.transaction.TransactionFactoryFactory) Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
    - 10:33:26,312 [main] INFO (hibernate.transaction.TransactionManagerLookupFactory) No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    - 10:33:26,343 [main] INFO (hibernate.impl.SessionFactoryImpl) building session factory
    - 10:33:36,812 [main] INFO (hibernate.impl.SessionFactoryObjectFactory) Not binding factory to JNDI, no JNDI name configured
    - 10:33:36,812 [main] INFO (support.context.ApplicationContext) Done building hibernate session factory, time 14,318.045 ms
    - 10:33:37,484 [main] INFO (support.sql.OracleFunctionReplacer) Oracle driver statement cache enabled with size of 300
    - 10:33:37,531 [main] INFO (support.context.ApplicationContext) Database: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    - 10:33:37,531 [main] INFO (support.context.ApplicationContext) JDBC driver: Oracle JDBC driver, version: 10.2.0.1.0
    - 10:33:38,828 [main] INFO (support.context.ApplicationContext) System owner is: 'CM '
    - 10:33:39,328 [main] INFO (cobol.host.CobolHostStartup) Using provided java command for remote cobol execution: D:/CCB_Install/jdk1.5.0_09/bin/java.exe
    - 10:33:39,328 [main] INFO (cobol.host.CobolHostStartup) Using provided java command options for remote cobol execution: -Xmx156m -server -Dfile.encoding=ISO8859_1 -cp D:/ccbenv/ccbdemo/splapp/standalone/config;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-beanutils-1.6.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-codec-1.3.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-collections-2.1.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-fileupload-1.1.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-httpclient-2.0.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-io-1.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-lang-2.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/commons-logging-1.0.4.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/concurrent-1.3.4.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/dom4j-1.6.1.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/hibernate-3.1.3.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/icu4j-3.6.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/jaxen-1.1-beta-11.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/jta.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/jtds-1.2.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/log4j-1.2.11.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/mfcobol.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/spl-base-2.1.0.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/spl-shared-2.1.0.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/spl-xai-2.1.0.jar;D:/ccbenv/ccbdemo/splapp/standalone/lib/xstream-1.2.1.jar
    - 10:33:39,343 [main] INFO (cobol.host.CobolHostStartup) Using starting port number 5503 for remote cobol execution.
    - 10:33:40,031 [main] INFO (cobol.host.SocketStrategy) Socket strategy set to com.splwg.base.support.cobol.host.sockets.WindowsPipeSocketStrategy
    - 10:33:41,171 [main] INFO (cobol.host.CobolHostStartup) Using active JVM count of 1 for remote cobol execution.
    *-  10:34:03,203 [main] ERROR (cobol.host.SocketStrategy) Unable to establish connection on port 5506 after waiting 20 seconds.*
    java.net.ConnectException: Error: Could not open pipe
    caused by system error: The system cannot find the file specified.
         at com.splwg.base.support.cobol.host.sockets.WindowsPipeSocket.connectToPipe(Native Method)
         at com.splwg.base.support.cobol.host.sockets.WindowsPipeSocket.<init>(WindowsPipeSocket.java:63)
         at com.splwg.base.support.cobol.host.sockets.WindowsPipeSocket.createSocket(WindowsPipeSocket.java:100)
         at com.splwg.base.support.cobol.host.sockets.WindowsPipeSocket.connect(WindowsPipeSocket.java:95)
         at com.splwg.base.support.cobol.host.sockets.WindowsPipeSocketStrategy.openSocket(WindowsPipeSocketStrategy.java:32)
         at com.splwg.base.support.cobol.host.SocketStrategy.unsafeOpen(SocketStrategy.java:118)
         at com.splwg.base.support.cobol.host.SocketStrategy.open(SocketStrategy.java:103)
         at com.splwg.base.support.cobol.host.OptimizedRemoteExecuterStub.createNewHolder(OptimizedRemoteExecuterStub.java:162)
         at com.splwg.base.support.cobol.host.OptimizedRemoteExecuterStub.getStreamHolder(OptimizedRemoteExecuterStub.java:125)
         at com.splwg.base.support.cobol.host.OptimizedRemoteExecuterStub.invoke(OptimizedRemoteExecuterStub.java:46)
         at com.splwg.base.support.cobol.host.RemoteRunnerImpl.invoke(RemoteRunnerImpl.java:89)
         at com.splwg.base.support.cobol.host.RemoteJVMConnectionImpl.createRemoteRunner(RemoteJVMConnectionImpl.java:148)
         at com.splwg.base.support.cobol.host.RemoteJVMConnectionImpl.<init>(RemoteJVMConnectionImpl.java:67)
         at com.splwg.base.support.cobol.host.RemoteJVMFactoryImpl.addConnection(RemoteJVMFactoryImpl.java:83)
         at com.splwg.base.support.cobol.host.RotatingCommandRunnerProvider.addNewConnection(RotatingCommandRunnerProvider.java:135)
         at com.splwg.base.support.cobol.host.RotatingCommandRunnerProvider.addNecessaryConnections(RotatingCommandRunnerProvider.java:121)
         at com.splwg.base.support.cobol.host.RotatingCommandRunnerProvider.<init>(RotatingCommandRunnerProvider.java:61)
         at com.splwg.base.support.cobol.host.CobolHostStartup.startup(CobolHostStartup.java:41)
         at com.splwg.base.support.context.ApplicationContext.initializeCobolRuntime(ApplicationContext.java:178)
         at com.splwg.base.support.context.ApplicationContext.initialize(ApplicationContext.java:158)
         at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:144)
         at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:65)
         at com.splwg.base.support.context.ContextFactory.createDefaultContext(ContextFactory.java:426)
         at com.splwg.base.web.startup.SPLWebStartup.initializeApplicationContext(SPLWebStartup.java:175)
         at com.splwg.base.web.startup.SPLWebStartup.contextInitialized(SPLWebStartup.java:63)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
         at org.apache.catalina.core.StandardService.start(StandardService.java:450)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
         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:294)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
    - 10:34:03,234 [main] ERROR (cobol.host.SocketStrategy) Unable to create socket for inter JVM communication on port 5506
    - 10:34:03,250 [main] INFO (cobol.host.RemoteJVMConnectionImpl) Connection to JVM 1 being shunned
    *-  10:34:03,250 [main] ERROR (cobol.host.RemoteJVMConnectionImpl) An exception has occurred calling the remote JVM*
    *-  10:34:03,250 [main] FATAL (support.context.ApplicationContext) Error initializing ApplicationContext*
    *-  10:34:03,250 [main] ERROR ([Catalina].[localhost].[]) Exception sending context initialized event to listener instance of class com.splwg.base.web.startup.SPLWebStartup*com.splwg.shared.common.LoggedException:
    The following stacked messages were reported as the LoggedException was rethrown:
    com.splwg.base.support.context.ApplicationContext.initialize(ApplicationContext.java:158): Error initializing ApplicationContext
    com.splwg.base.support.cobol.host.OptimizedRemoteExecuterStub.getStreamHolder(OptimizedRemoteExecuterStub.java:125): An exception has occurred calling the remote JVM
    com.splwg.base.support.cobol.host.SocketStrategy.unsafeOpen(SocketStrategy.java:123): Unable to create socket for inter JVM communication on port 5506
    The root LoggedException was: Unable to establish connection on port 5506 after waiting 20 seconds.
         at com.splwg.shared.common.LoggedException.wrap(LoggedException.java:197)
         at com.splwg.shared.common.LoggedException.wrap(LoggedException.java:85)
         at com.splwg.base.support.cobol.host.SocketStrategy.handleConnectionException(SocketStrategy.java:134)
         at com.splwg.base.support.cobol.host.SocketStrategy.unsafeOpen(SocketStrategy.java:123)
         at com.splwg.base.support.cobol.host.SocketStrategy.open(SocketStrategy.java:103)
         at com.splwg.base.support.cobol.host.OptimizedRemoteExecuterStub.createNewHolder(OptimizedRemoteExecuterStub.java:162)
         at com.splwg.base.support.cobol.host.OptimizedRemoteExecuterStub.getStreamHolder(OptimizedRemoteExecuterStub.java:125)
         at com.splwg.base.support.cobol.host.OptimizedRemoteExecuterStub.invoke(OptimizedRemoteExecuterStub.java:46)
         at com.splwg.base.support.cobol.host.RemoteRunnerImpl.invoke(RemoteRunnerImpl.java:89)
         at com.splwg.base.support.cobol.host.RemoteJVMConnectionImpl.createRemoteRunner(RemoteJVMConnectionImpl.java:148)
         at com.splwg.base.support.cobol.host.RemoteJVMConnectionImpl.<init>(RemoteJVMConnectionImpl.java:67)
         at com.splwg.base.support.cobol.host.RemoteJVMFactoryImpl.addConnection(RemoteJVMFactoryImpl.java:83)
         at com.splwg.base.support.cobol.host.RotatingCommandRunnerProvider.addNewConnection(RotatingCommandRunnerProvider.java:135)
         at com.splwg.base.support.cobol.host.RotatingCommandRunnerProvider.addNecessaryConnections(RotatingCommandRunnerProvider.java:121)
         at com.splwg.base.support.cobol.host.RotatingCommandRunnerProvider.<init>(RotatingCommandRunnerProvider.java:61)
         at com.splwg.base.support.cobol.host.CobolHostStartup.startup(CobolHostStartup.java:41)
         at com.splwg.base.support.context.ApplicationContext.initializeCobolRuntime(ApplicationContext.java:178)
         at com.splwg.base.support.context.ApplicationContext.initialize(ApplicationContext.java:158)
         at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:144)
         at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:65)
         at com.splwg.base.support.context.ContextFactory.createDefaultContext(ContextFactory.java:426)
         at com.splwg.base.web.startup.SPLWebStartup.initializeApplicationContext(SPLWebStartup.java:175)
         at com.splwg.base.web.startup.SPLWebStartup.contextInitialized(SPLWebStartup.java:63)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
         at org.apache.catalina.core.StandardService.start(StandardService.java:450)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
         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:294)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
    Caused by: java.net.ConnectException: Error: Could not open pipe
    caused by system error: The system cannot find the file specified.
         at com.splwg.base.support.cobol.host.sockets.WindowsPipeSocket.connectToPipe(Native Method)
    can anyone please help me out to resolve this issue.
    Thanks,
    Fawaz

    Hi,
    Have you tried to restart the SPL service again and again? And sometime i use to get these OptimizedRemoteExecuterStub.getStreamHolder(OptimizedRemoteExecuterStub.java:125): An exception has occurred calling the remote JVM exception if the machine is occupying more memory....
    Try to restart it again.

  • Streaming CSV via Apache/ Tomcat  with Mod Proxy

    I have Apache hooked up to Tomcat using mod_proxy and attempts to stream a CSV file from a Struts action via tomcat fails.
    Using the tomcat port localhost:8080/testappp the streaming works fine but for some reason it does not work via the apache url
    Build is Red Hat Enterprise Linux AS release 4 on Apache 2.0.52-25 and Tomcat 5.5
    Below are pastes of the apache conf file and tomcat server.xml
    Thanks
    # httpd.conf
    # Based upon the NCSA server configuration files originally by Rob McCool.
    # This is the main Apache server configuration file. It contains the
    # configuration directives that give the server its instructions.
    # See <URL:http://httpd.apache.org/docs-2.0/> for detailed information about
    # the directives.
    # Do NOT simply read the instructions in here without understanding
    # what they do. They're here only as hints or reminders. If you are unsure
    # consult the online docs. You have been warned.
    # The configuration directives are grouped into three basic sections:
    # 1. Directives that control the operation of the Apache server process as a
    # whole (the 'global environment').
    # 2. Directives that define the parameters of the 'main' or 'default' server,
    # which responds to requests that aren't handled by a virtual host.
    # These directives also provide default values for the settings
    # of all virtual hosts.
    # 3. Settings for virtual hosts, which allow Web requests to be sent to
    # different IP addresses or hostnames and have them handled by the
    # same Apache server process.
    # Configuration and logfile names: If the filenames you specify for many
    # of the server's control files begin with "/" (or "drive:/" for Win32), the
    # server will use that explicit path. If the filenames do not begin
    # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
    # with ServerRoot set to "/etc/httpd" will be interpreted by the
    # server as "/etc/httpd/logs/foo.log".
    ### Section 1: Global Environment
    # The directives in this section affect the overall operation of Apache,
    # such as the number of concurrent requests it can handle or where it
    # can find its configuration files.
    # Don't give away too much information about all the subcomponents
    # we are running. Comment out this line if you don't mind remote sites
    # finding out what major optional modules you are running
    ServerTokens OS
    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    # NOTE! If you intend to place this on an NFS (or otherwise network)
    # mounted filesystem then please read the LockFile documentation
    # (available at <URL:http://httpd.apache.org/docs-2.0/mod/mpm_common.html#lockfile>);
    # you will save yourself a lot of trouble.
    # Do NOT add a slash at the end of the directory path.
    ServerRoot "/etc/httpd"
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    PidFile run/httpd.pid
    # Timeout: The number of seconds before receives and sends time out.
    Timeout 120
    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    KeepAlive Off
    # MaxKeepAliveRequests: The maximum number of requests to allow
    # during a persistent connection. Set to 0 to allow an unlimited amount.
    # We recommend you leave this number high, for maximum performance.
    MaxKeepAliveRequests 100
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    KeepAliveTimeout 15
    ## Server-Pool Size Regulation (MPM specific)
    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # ServerLimit: maximum value for MaxClients for the lifetime of the server
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule prefork.c>
    StartServers 8
    MinSpareServers 5
    MaxSpareServers 20
    ServerLimit 256
    MaxClients 256
    MaxRequestsPerChild 4000
    </IfModule>
    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule worker.c>
    StartServers 2
    MaxClients 150
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25
    MaxRequestsPerChild 0
    </IfModule>
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, in addition to the default. See also the <VirtualHost>
    # directive.
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
    #Listen 12.34.56.78:80
    Listen 80
    # Dynamic Shared Object (DSO) Support
    # To be able to use the functionality of a module which was built as a DSO you
    # have to place corresponding `LoadModule' lines at this location so the
    # directives contained in it are actually available before they are used.
    # Statically compiled modules (those listed by `httpd -l') do not need
    # to be loaded here.
    # Example:
    # LoadModule foo_module modules/mod_foo.so
    LoadModule access_module modules/mod_access.so
    LoadModule auth_module modules/mod_auth.so
    LoadModule auth_anon_module modules/mod_auth_anon.so
    LoadModule auth_dbm_module modules/mod_auth_dbm.so
    LoadModule auth_digest_module modules/mod_auth_digest.so
    LoadModule ldap_module modules/mod_ldap.so
    LoadModule auth_ldap_module modules/mod_auth_ldap.so
    LoadModule include_module modules/mod_include.so
    LoadModule log_config_module modules/mod_log_config.so
    LoadModule env_module modules/mod_env.so
    LoadModule mime_magic_module modules/mod_mime_magic.so
    LoadModule cern_meta_module modules/mod_cern_meta.so
    LoadModule expires_module modules/mod_expires.so
    LoadModule deflate_module modules/mod_deflate.so
    LoadModule headers_module modules/mod_headers.so
    LoadModule usertrack_module modules/mod_usertrack.so
    LoadModule setenvif_module modules/mod_setenvif.so
    LoadModule mime_module modules/mod_mime.so
    LoadModule dav_module modules/mod_dav.so
    LoadModule status_module modules/mod_status.so
    LoadModule autoindex_module modules/mod_autoindex.so
    LoadModule asis_module modules/mod_asis.so
    LoadModule info_module modules/mod_info.so
    LoadModule dav_fs_module modules/mod_dav_fs.so
    LoadModule vhost_alias_module modules/mod_vhost_alias.so
    LoadModule negotiation_module modules/mod_negotiation.so
    LoadModule dir_module modules/mod_dir.so
    LoadModule imap_module modules/mod_imap.so
    LoadModule actions_module modules/mod_actions.so
    LoadModule speling_module modules/mod_speling.so
    LoadModule userdir_module modules/mod_userdir.so
    LoadModule alias_module modules/mod_alias.so
    LoadModule rewrite_module modules/mod_rewrite.so
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule proxy_connect_module modules/mod_proxy_connect.so
    LoadModule cache_module modules/mod_cache.so
    LoadModule suexec_module modules/mod_suexec.so
    LoadModule disk_cache_module modules/mod_disk_cache.so
    LoadModule file_cache_module modules/mod_file_cache.so
    LoadModule mem_cache_module modules/mod_mem_cache.so
    LoadModule cgi_module modules/mod_cgi.so
    LoadModule dav_svn_module /usr/lib/httpd/modules/mod_dav_svn.so
    LoadModule authz_svn_module /usr/lib/httpd/modules/mod_authz_svn.so
    # Load config files from the config directory "/etc/httpd/conf.d".
    Include conf.d/*.conf
    # ExtendedStatus controls whether Apache will generate "full" status
    # information (ExtendedStatus On) or just basic information (ExtendedStatus
    # Off) when the "server-status" handler is called. The default is Off.
    #ExtendedStatus On
    ### Section 2: 'Main' server configuration
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # <VirtualHost> definition. These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    # All of these directives may appear inside <VirtualHost> containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # . On SCO (ODT 3) use "User nouser" and "Group nogroup".
    # . On HPUX you may not be able to use shared memory as nobody, and the
    # suggested workaround is to create a user www and use that user.
    # NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
    # when the value of (unsigned)Group is above 60000;
    # don't use Group #-1 on these systems!
    User apache
    Group apache
    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed. This address appears on some server-generated pages, such
    # as error documents. e.g. [email protected]
    ServerAdmin [Email]root@localhost[Email]
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    # If this is not set to valid DNS name for your host, server-generated
    # redirections will not work. See also the UseCanonicalName directive.
    # If your host doesn't have a registered DNS name, enter its IP address here.
    # You will have to access it by its address anyway, and this will make
    # redirections work in a sensible way.
    ServerName ext02:80
    # UseCanonicalName: Determines how Apache constructs self-referencing
    # URLs and the SERVER_NAME and SERVER_PORT variables.
    # When set "Off", Apache will use the Hostname and Port supplied
    # by the client. When set "On", Apache will use the value of the
    # ServerName directive.
    UseCanonicalName Off
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    DocumentRoot "/var/www/html"
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    # First, we configure the "default" to be a very restrictive set of
    # features.
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    </Directory>
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    # This should be changed to whatever you set DocumentRoot to.
    <Directory "/var/www/html">
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    # Note that "MultiViews" must be named explicitly --- "Options All"
    # doesn't give it to you.
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs-2.0/mod/core.html#options
    # for more information.
    Options Indexes FollowSymLinks
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    AllowOverride None
    # Controls who can get stuff from this server.
    Order allow,deny
    Allow from all
    </Directory>
    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.
    # The path to the end user account 'public_html' directory must be
    # accessible to the webserver userid. This usually means that ~userid
    # must have permissions of 711, ~userid/public_html must have permissions
    # of 755, and documents contained therein must be world-readable.
    # Otherwise, the client will only receive a "403 Forbidden" message.
    # See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
    <IfModule mod_userdir.c>
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    UserDir disable
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disable" line above, and uncomment
    # the following line instead:
    #UserDir public_html
    </IfModule>
    # Control access to UserDir directories. The following is an example
    # for a site where these directories are restricted to read-only.
    #<Directory /home/*/public_html>
    # AllowOverride FileInfo AuthConfig Limit
    # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    # <Limit GET POST OPTIONS>
    # Order allow,deny
    # Allow from all
    # </Limit>
    # <LimitExcept GET POST OPTIONS>
    # Order deny,allow
    # Deny from all
    # </LimitExcept>
    #</Directory>
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    # The index.html.var file (a type-map) is used to deliver content-
    # negotiated documents. The MultiViews Option can be used for the
    # same purpose, but it is much slower.
    DirectoryIndex index.php index.html index.html.var
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives. See also the AllowOverride
    # directive.
    AccessFileName .htaccess
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    <Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    </Files>
    # TypesConfig describes where the mime.types file (or equivalent) is
    # to be found.
    TypesConfig /etc/mime.types
    # DefaultType is the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value. If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    DefaultType text/plain
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type. The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    <IfModule mod_mime_magic.c>
    # MIMEMagicFile /usr/share/magic.mime
    MIMEMagicFile conf/magic
    </IfModule>
    # HostnameLookups: Log the names of clients or just their IP addresses
    # e.g., www.apache.org (on) or 204.62.129.132 (off).
    # The default is off because it'd be overall better for the net if people
    # had to knowingly turn this feature on, since enabling it means that
    # each client request will result in AT LEAST one lookup request to the
    # nameserver.
    HostnameLookups Off
    # EnableMMAP: Control whether memory-mapping is used to deliver
    # files (assuming that the underlying OS supports it).
    # The default is on; turn this off if you serve from NFS-mounted
    # filesystems. On some systems, turning it off (regardless of
    # filesystem) can improve performance; for details, please see
    # http://httpd.apache.org/docs-2.0/mod/core.html#enablemmap
    #EnableMMAP off
    # EnableSendfile: Control whether the sendfile kernel support is
    # used to deliver files (assuming that the OS supports it).
    # The default is on; turn this off if you serve from NFS-mounted
    # filesystems. Please see
    # http://httpd.apache.org/docs-2.0/mod/core.html#enablesendfile
    #EnableSendfile off
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here. If you do define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    ErrorLog logs/error_log
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here. Contrariwise, if you do
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and not in this file.
    #CustomLog logs/access_log common
    # If you would like to have agent and referer logfiles, uncomment the
    # following directives.
    #CustomLog logs/referer_log referer
    #CustomLog logs/agent_log agent
    # For a single logfile with access, agent, and referer information
    # (Combined Logfile Format), use the following directive:
    CustomLog logs/access_log combined
    # Optionally add a line containing the server version and virtual host
    # name to server-generated pages (internal error documents, FTP directory
    # listings, mod_status and mod_info output etc., but not CGI generated
    # documents or custom error documents).
    # Set to "EMail" to also include a mailto: link to the ServerAdmin.
    # Set to one of: On | Off | EMail
    ServerSignature On
    # Aliases: Add here as many aliases as you need (with no limit). The format is
    # Alias fakename realname
    # Note that if you include a trailing / on fakename then the server will
    # require it to be present in the URL. So "/icons" isn't aliased in this
    # example, only "/icons/". If the fakename is slash-terminated, then the
    # realname must also be slash terminated, and if the fakename omits the
    # trailing slash, the realname must also omit it.
    # We include the /icons/ alias for FancyIndexed directory listings. If you
    # do not use FancyIndexing, you may comment this out.
    Alias /icons/ "/var/www/icons/"
    Alias /admin "/home/boss4/web/geoland/admin/"
    Alias /bboard "/home/boss4/web/phpBB3/"
    <Directory "/var/www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    <Directory "/home/boss4/web/geoland/admin">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    <Directory "/home/boss4/web/phpBB3">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    # WebDAV module configuration section.
    <IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
    </IfModule>
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
    # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    <Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
    </Directory>
    # Redirect allows you to tell clients about documents which used to exist in
    # your server's namespace, but do not anymore. This allows you to tell the
    # clients where to look for the relocated document.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar
    # Directives controlling the display of server-generated directory listings.
    # IndexOptions: Controls the appearance of server-generated directory
    # listings.
    IndexOptions FancyIndexing VersionSort NameWidth=*
    # AddIcon* directives tell the server which icon to show for different
    # files or filename extensions. These are only displayed for
    # FancyIndexed directories.
    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*
    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core
    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^
    # DefaultIcon is which icon to show for files which do not have an icon
    # explicitly set.
    DefaultIcon /icons/unknown.gif
    # AddDescription allows you to place a short description after a file in
    # server-generated indexes. These are only displayed for FancyIndexed
    # directories.
    # Format: AddDescription "description" filename
    #AddDescription "GZIP compressed document" .gz
    #AddDescription "tar archive" .tar
    #AddDescription "GZIP compressed tar archive" .tgz
    # ReadmeName is the name of the README file the server will look for by
    # default, and append to directory listings.
    # HeaderName is the name of a file which should be prepended to
    # directory indexes.
    ReadmeName README.html
    HeaderName HEADER.html
    # IndexIgnore is a set of filenames which directory indexing should ignore
    # and not include in the listing. Shell-style wildcarding is permitted.
    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
    # DefaultLanguage and AddLanguage allows you to specify the language of
    # a document. You can then use content negotiation to give a browser a
    # file in a language the user can understand.
    # Specify a default language. This means that all data
    # going out without a specific language tag (see below) will
    # be marked with this one. You probably do NOT want to set
    # this unless you are sure it is correct for all cases.
    # * It is generally better to not mark a page as
    # * being a certain language than marking it with the wrong
    # * language!
    # DefaultLanguage nl
    # Note 1: The suffix does not have to be the same as the language
    # keyword --- those with documents in Polish (whose net-standard
    # language code is pl) may wish to use "AddLanguage pl .po" to
    # avoid the ambiguity with the common suffix for perl scripts.
    # Note 2: The example entries below illustrate that in some cases
    # the two character 'Language' abbreviation is not identical to
    # the two character 'Country' code for its country,
    # E.g. 'Danmark/dk' versus 'Danish/da'.
    # Note 3: In the case of 'ltz' we violate the RFC by using a three char
    # specifier. There is 'work in progress' to fix this and get
    # the reference data for rfc1766 cleaned up.
    # Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
    # English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
    # Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
    # Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
    # Norwegian (no) - Polish (pl) - Portugese (pt)
    # Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
    # Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
    AddLanguage ca .ca
    AddLanguage cs .cz .cs
    AddLanguage da .dk
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage en .en
    AddLanguage eo .eo
    AddLanguage es .es
    AddLanguage et .et
    AddLanguage fr .fr
    AddLanguage he .he
    AddLanguage hr .hr
    AddLanguage it .it
    AddLanguage ja .ja
    AddLanguage ko .ko
    AddLanguage ltz .ltz
    AddLanguage nl .nl
    AddLanguage nn .nn
    AddLanguage no .no
    AddLanguage pl .po
    AddLanguage pt .pt
    AddLanguage pt-BR .pt-br
    AddLanguage ru .ru
    AddLanguage sv .sv
    AddLanguage zh-CN .zh-cn
    AddLanguage zh-TW .zh-tw
    # LanguagePriority allows you to give precedence to some languages
    # in case of a tie during content negotiation.
    # Just list the languages in decreasing order of preference. We have
    # more or less alphabetized them here. You probably want to change this.
    LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
    # ForceLanguagePriority allows you to serve a result page rather than
    # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
    # [in case no accepted languages matched the available variants]
    ForceLanguagePriority Prefer Fallback
    # Specify a default charset for all pages sent out. This is
    # always a good idea and opens the door for future internationalisation
    # of your web site, should you ever want it. Specifying it as
    # a default does little harm; as the standard dictates that a page
    # is in iso-8859-1 (latin1) unless specified otherwise i.e. you
    # are merely stating the obvious. There are also some security
    # reasons in browsers, related to javascript and URL parsing
    # which encourage you to always set a default char set.
    AddDefaultCharset UTF-8
    # Commonly used filename extensions to character sets. You probably
    # want to avoid clashes with the language extensions, unless you
    # are good at carefully testing your setup after each change.
    # See http://www.iana.org/assignments/character-sets for the
    # official list of charset names and their respective RFCs.
    AddCharset ISO-8859-1 .iso8859-1 .latin1
    AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
    AddCharset ISO-8859-3 .iso8859-3 .latin3
    AddCharset ISO-8859-4 .iso8859-4 .latin4
    AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
    AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
    AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
    AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
    AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
    AddCharset ISO-2022-JP .iso2022-jp .jis
    AddCharset ISO-2022-KR .iso2022-kr .kis
    AddCharset ISO-2022-CN .iso2022-cn .cis
    AddCharset Big5 .Big5 .big5
    # For russian, more than one charset is used (depends on client, mostly):
    AddCharset WINDOWS-1251 .cp-1251 .win-1251
    AddCharset CP866 .cp866
    AddCharset KOI8-r .koi8-r .koi8-ru
    AddCharset KOI8-ru .koi8-uk .ua
    AddCharset ISO-10646-UCS-2 .ucs2
    AddCharset ISO-10646-UCS-4 .ucs4
    AddCharset UTF-8 .utf8
    # The set below does not map to a specific (iso) standard
    # but works on a fairly wide range of browsers. Note that
    # capitalization actually matters (it should not, but it
    # does for some browsers).
    # See http://www.iana.org/assignments/character-sets
    # for a list of sorts. But browsers support few.
    AddCharset GB2312 .gb2312 .gb
    AddCharset utf-7 .utf7
    AddCharset utf-8 .utf8
    AddCharset big5 .big5 .b5
    AddCharset EUC-TW .euc-tw
    AddCharset EUC-JP .euc-jp
    AddCharset EUC-KR .euc-kr
    AddCharset shift_jis .sjis
    # AddType allows you to add to or override the MIME configuration
    # file mime.types for specific file types.
    #AddType application/x-tar .tgz
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    # Despite the name similarity, the following Add* directives have nothing
    # to do with the FancyIndexing customization directives above.
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #AddHandler cgi-script .cgi
    # For files that include their own HTTP headers:
    #AddHandler send-as-is asis
    # For server-parsed imagemap files:
    AddHandler imap-file map
    # For type maps (negotiated resources):
    # (This is enabled by default to allow the Apache "It Worked" page
    # to be distributed in multiple languages.)
    AddHandler type-map var
    # Filters allow you to process content before it is sent to the client.
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    # Action lets you define media types that will execute a script whenever
    # a matching file is called. This eliminates the need for repeated URL
    # pathnames for oft-used CGI file processors.
    # Format: Action media/type /cgi-script/location
    # Format: Action handler-name /cgi-script/location
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    # Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    # Putting this all together, we can internationalize error responses.
    # We use Alias to redirect any /error/HTTP_<error>.html.var response to
    # our collection of by-error message multi-language collections. We use
    # includes to substitute the appropriate text.
    # You can modify the messages' appearance without changing any of the
    # default HTTP_<error>.html.var files by adding the line:
    # Alias /error/include/ "/your/include/path/"

    Please note: I AM USING:
    JkOptions ForwardKeySize ForwardURICompat -ForwardDirectories
    And that's what's supposed to fix this problem in the first place, right??

  • How do I set miminum # of connections for pool with Oracle and Tomcat?

    Hi,
    I can't seem to find any attribute to initialize the number of connections for my connection pool. Here is my current context.xml file under my /App1 directory:
    <Context path="/App1" docBase="App1"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="App1ConnectionPool" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    url="jdbc:oracle:thin:@127.0.0.1:1521:oddjob"
    user="app1" password="app1" />
    </Context>
    I've been googling and reading forums, but haven't found a way to establish the minimum number of connections. I've tried all sorts of parameters like InitialLimit, MinLimit, MinActive, etc, with no success.
    Here is some sample code that I am testing:
    package web;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.OracleConnection;
    import javax.naming.*;
    import java.sql.SQLException;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Properties;
    public class ConnectionPool {
    String message = "Not Connected";
    public void init() {
    OracleConnection conn = null;
    ResultSet rst = null;
    Statement stmt = null;
    try {
    Context initContext = new InitialContext();
    Context envContext = (Context) initContext.lookup("java:/comp/env");
    OracleDataSource ds = (OracleDataSource) envContext.lookup("App1ConnectionPool");
    message = "Here.";
         String user = ds.getUser();
    if (envContext == null)
    throw new Exception("Error: No Context");
    if (ds == null)
    throw new Exception("Error: No DataSource");
    if (ds != null) {
    message = "Trying to connect...";
    conn = (OracleConnection) ds.getConnection();
    Properties prop = new Properties();
    prop.put("PROXY_USER_NAME", "adavey/xxx");
    if (conn != null) {
    message = "Got Connection " + conn.toString() + ", ";
              conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME,prop);
    stmt = conn.createStatement();
    rst = stmt.executeQuery("SELECT username, server from v$session where username is not null");
    while (rst.next()) {
    message = "DS User: " + user + "; DB User: " + rst.getString(1) + "; Server: " + rst.getString(2);
    rst.close();
    rst = null;
    stmt.close();
    stmt = null;
    conn.close(); // Return to connection pool
    conn = null; // Make sure we don't close it twice
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // Always make sure result sets and statements are closed,
    // and the connection is returned to the pool
    if (rst != null) {
    try {
    rst.close();
    } catch (SQLException e) {
    rst = null;
    if (stmt != null) {
    try {
    stmt.close();
    } catch (SQLException e) {
    stmt = null;
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException e) {
    conn = null;
    public String getMessage() {
    return message;
    I'm using a utility to repeatedly call a JSP page that uses this class and displays the message variable. This utility allows me to specify the number of concurrent web requests and an overall number of requests to try. While that is running, I look at V$SESSION in Oracle and occassionaly, I will see a brief entry for app1 or adavey depending on the timing of my query and how far along the code has processed in this example. So it seems that I am only using one connection at a time and not a true connection pool.
    Is it possible that I need to use the oci driver instead of the thin driver? I've looked at the javadoc for oci and the OCIConnectionPool has a setPoolConfig method to set initial, min and max connections. However, it appears that this can only be set via Java code and not as a parameter in my context.xml resource file. If I have to set it each time I get a database connection, it seems like it sort of defeats the purpose of having Tomcat maintain the connection pool for me and that I need to implement my own connection pool. I'm a newbie to this technology so I really don't want to go this route.
    Any advice on setting up a proper connection pool that works with Tomcat and Oracle proxy sessions would be greatly appreciated.
    Thanks,
    Alan

    Well I did some more experiments and I am able to at least create a connection pool within my example code:
    package web;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.OracleConnection;
    import javax.naming.*;
    import java.sql.SQLException;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Properties;
    public class ConnectionPool {
    String message = "Not Connected";
    public void init() {
    OracleConnection conn = null;
    ResultSet rst = null;
    Statement stmt = null;
    try {
    Context initContext = new InitialContext();
    Context envContext = (Context) initContext.lookup("java:/comp/env");
    OracleDataSource ds = (OracleDataSource) envContext.lookup("App1ConnectionPool");
    message = "Here.";
         String user = ds.getUser();
    if (envContext == null)
    throw new Exception("Error: No Context");
    if (ds == null)
    throw new Exception("Error: No DataSource");
    if (ds != null) {
    message = "Trying to connect...";
    boolean cache_enabled = ds.getConnectionCachingEnabled();
    if (!cache_enabled){
    ds.setConnectionCachingEnabled(true);
    Properties cacheProps = new Properties();
    cacheProps.put("InitialLimit","5");
         cacheProps.put("MinLimit","5");
    cacheProps.put("MaxLimit","10");
    ds.setConnectionCacheProperties(cacheProps);
              conn = (OracleConnection) ds.getConnection();
    Properties prop = new Properties();
    prop.put("PROXY_USER_NAME", "adavey/xyz");
    if (conn != null) {
    message = "Got Connection " + conn.toString() + ", ";
              conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME,prop);
    stmt = conn.createStatement();
    //rst = stmt.executeQuery("SELECT 'Success obtaining connection' FROM DUAL");
    rst = stmt.executeQuery("SELECT user, SYS_CONTEXT ('USERENV', 'SESSION_USER') from dual");
    while (rst.next()) {
    message = "DS User: " + user + "; DB User: " + rst.getString(1) + "; sys_context: " + rst.getString(2);
    message += "; Was cache enabled?: " + cache_enabled;
    rst.close();
    rst = null;
    stmt.close();
    stmt = null;
    conn.close(OracleConnection.PROXY_SESSION); // Return to connection pool
    conn = null; // Make sure we don't close it twice
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // Always make sure result sets and statements are closed,
    // and the connection is returned to the pool
    if (rst != null) {
    try {
    rst.close();
    } catch (SQLException e) {
    rst = null;
    if (stmt != null) {
    try {
    stmt.close();
    } catch (SQLException e) {
    stmt = null;
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException e) {
    conn = null;
    public String getMessage() {
    return message;
    In my context.xml file, I tried to specify the same Connection Cache Properties as attributes, but no luck:
    <Context path="/App1" docBase="App1"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="App1ConnectionPool" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    url="jdbc:oracle:thin:@127.0.0.1:1521:oddjob"
    user="app1" password="app1"
    ConnectionCachingEnabled="1" MinLimit="5" MaxLimit="20"/>
    </Context>
    These attributes seemed to have no effect:
    ConnectionCachingEnabled="1" ; also tried "true"
    MinLimit="5"
    MaxLimit="20"
    So basically if I could find some way to get these attributes set within the context.xml file instead of my code, I would be a happy developer :-)
    Oh well, it's almost Miller time here on the east coast. Maybe a few beers will help me find the solution I'm looking for.

Maybe you are looking for