URGENT: Tomcat, Connection Pool - Issue with web.xml & server.xml

Folks,
I am trying to connect to a MS SQL database using Tomcat/JSP but having issues. The code that I am using is as follows:
Context ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/test");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
I have added the following code to my Server.xml:
<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="DB_AW_DATA" password="tester" driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://192.168.0.1\\Newcastle"/>
And the complete web.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE web-app (View Source for full doctype...)>
- <web-app>
- <resource-ref>
<description>Resource reference to java.sql.Connection factory defined in server.xml</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
The error message that I am getting is as follows:
java.sql.SQLException: Cannot load JDBC driver class 'null'
What confuses me is that I have placed the following files in Tomcat\common\lib...
mssqlserver.jar
msbase.jar
msutil.jar
I think this is purely an issue with how I configured server.xml and web.xml
In the Tomcat documentation it states to put the code in the server.xml - but nested inside the Context element. This is something that I have not done as I am clear what the Context should be..
Can someone assist...
<Context path="" docBase="ROOT" debug="0"> ???
what should be the path and the docBase.
I have deployed the following application:
http://localhost:8080/SCWAPP/index.jsp
THANKS IN ADVANCE FOR ALL SUPPORRT

you should put the code you typed in server.xml into context.xml
in the META-INF folder and this will fix your problem.
the latest tomcat docs detail what to do.

Similar Messages

  • Connection pool issues with Mysql

    Hi,
    I have defined sufficient read connections (50) in the toplink configuration, I am finding toplink is not releasing the connections in Mysql, this is when run from Jboss App server.
    Is anyone aware of toplink connection pool issues with MySql?
    thanks

    TopLink always closes connections, I cannot see how this could occur.
    Please include your persistence.xml or sessions.xml. Also ensure you are closing your EntityManager or ClientSession, especially if using exclusive connections.
    Also include the exception you are getting.
    James : http://www.eclipselink.org

  • Java Connection Pooling issue with Oracle 10g Express Edition

    Hello
    I have a Java based web application that uses the Oracle 10g Express Edition database. I am using a connection pool to get connections to the database.
    I use the NetBeans IDE and run my web application on the bundled Tomcat server(5.5.7) that comes with the IDE. Though when I initially run the application from the IDE, the connection pool is set up fine, when I recompile my java code and try to run the application again, I get the following error each time:
    Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with the
    matching protocol stack.
    The logs before the error shows up, indicate that the connection pool object is fine and gives me the number of available connections and the number of active connections and so on, which I have printed from the constructor of the Connection Pool class:
    For e.g.:
    Cache size = 17
    Available Connections = 17
    Cache Limit = 1000
    Active size = 0
    However, if I kill my Tomcat server process and run the application again, it works fine with no error.
    I looked around for possible causes and solutions and all I could find
    was increasing the processes parameter value in the init.ora file. I have increased the parameter value to from 100 to 20000 now, in increments of 500/1000 each time but it hasnt worked so far.
    Someone else suggested that I increase the size of my connection pool; I initially had it set to a minimum limit of 5, an initial limit of 10 and a maximum limit of 1000. However if I set the Initial Limit to anything above 17 connections, I see the following log on the Bundled Tomcat log and my application doesn't run at all:
    Log: Loading JDBC Driver : class=oracle.jdbc.driver.OracleDriver ...
    Log: Loaded JDBC Driver
    Log: Connection with URL=jdbc:oracle:thin:@localhost:1521:xe as username/password
    Error code not handled : 0
    Exception Message :java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS: no appropriate service handler found
    The Connection descriptor used by the client was:
    localhost:1521:xe
    // End of log
    And the Bundled Tomcat server automatically shuts down.
    Again the System.out statements from the Connection Pool class constructor show that the cache has been initialized and that currently there are free connections available in the pool.
    E.g.
    Cache size = 18
    Available Connections = 18
    Cache Limit = 1000
    Active size = 0
    Has anyone faced anything similar? Could someone please suggest what I'm doing wrong here and what I should do to set right this problem?
    Swetha

    hello, please pardon me, my english is basic. i do of my best. i had the same problem until reading the pdf documentation 2 days for java devvelloper.it is simple, follow this way.
    try {OracleDataSource ds;
         Connection conn;
      ds = new OracleDataSource();
      ds.setURL("jdbc:oracle:thin:@localhost");
      conn = ds.getConnection("userid","password");
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    don't forget to Dowload the user client of oracle Express Edition. do the rest of your program and it will work. take a look to the documentation pdf for java develloper. all it is explained.  good look                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Connection pooling issue with compiling with jdk 1.5.0

    A
    javax.naming.NameNotFoundException: Name jdbc is not bound in this Context exception occurs when I run my web app in Tomcat 5 using jdk 1.5. However, I don't get this problem with I use jdk 1.6.0. The mysql connector version is 3.1.1.4 and my server.xml file has been configured correctly. Any suggestions as to why this exception is occurring - I'm assuming it's a version issue but not sure how to solve it!

    Use "java:comp/env/jdbc/DbUser" instead of just "jdbc/DbUser" for datasource config
    See http://www.tek-tips.com/viewthread.cfm?qid=431734
    The mysql connector version is 3.1.1.4Use a more recent jdbc driver
    http://dev.mysql.com/downloads/connector/j/5.0.html
    http://dev.mysql.com/doc/refman/5.0/en/connector-j-versions.html
    Message was edited by:
    java_2006

  • Error: Creating a Connection Pool: issue with valid transaction levels

    Server: SunOS 5.8 Generic_117350-27 sun4u sparc SUNW,UltraAX-MP
    App Server: Sun Java System Application Server 8.2
    Jar: ojdbc14.jar
    Datasource Classname: oracle.jdbc.pool.OracleConnectionPoolDataSource
    Resource Type: javax.sql.ConnectionPoolDataSource
    [Issue]
    Using /SUNWappserver/lib/ojdbc14.jar, when I create my connection pool in Sun Java System Application Server 8.2, I return the following error each time I try to start the domain:
    [#|2006-07-28T14:53:56.169-0500|WARNING|sun-appserver-pe8.2|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5117 : Failed to obtain/create connection. Reason : The isolation level could not be set: READ_COMMITTED and SERIALIZABLE are the only valid transaction levels|#]
    When I change the value to "SERIALIZABLE" in my domain.xml file, I receive the following error in my server.log:
    Caused by: org.xml.sax.SAXParseException: Attribute "transaction-isolation-level" with value "SERIALIZABLE" must have a value from the list "read-uncommitted read-committed repeatable-read serializable ".
    So, I'm stuck!
    I can't use the values READ_COMMITTED or SERIALIZABLE since the valid values are "read-uncommitted read-committed repeatable-read serializable ".
    Case sensitivity matters.
    Any thoughts or help would be greatly appreciated.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    The Oracle JDBC accepts TRANSACTION_READ_COMMITTED and TRANSACTION_SERIALIZABLE isolation levels.
    Example:
    connAttr.setProperty(“TRANSACTION_ISOLATION”, “TRANSACTION_SERIALIZABLE”);
    I'd check with the Apps server folks.
    Kuassi - blog http://db360.blogspot.com/
    ------ book http://www.amazon.com/gp/product/1555583296/

  • Connection pool issue with packaged application

    we are using 9.2 mp1 for a Oarcle packaged application which is talking to Oracle RAC. In production one
    of the RAC nodes went down and we see that the wbelogic connection pool is never able to reconnect
    This is a packaged application Bharosa which internally uses hibernate and in turn relies on weblogic connection pool
    See a few stuck threads in the logs indicating some prolem with the connection cleanup
    <Dec 16, 2008 12:11:03 PM PST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "626" seconds working on the request "Http Request: /fahost/econnect/IntegratedAuthRemoteServlet.svl;JSPSESSIONID=82W2JLLJ8vCB25G3jyc6cYdXVXLYc1G1GwTt91plpCpB9MY6yQP3!468271380!-864027599!1229457609639", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
         weblogic.common.resourcepool.ResourcePoolImpl.releaseResource(ResourcePoolImpl.java:521)
         weblogic.jdbc.common.internal.ConnectionPool.release(ConnectionPool.java:669)
         weblogic.jdbc.common.internal.ConnectionPoolManager.release(ConnectionPoolManager.java:113)
         weblogic.jdbc.wrapper.PoolConnection.doClose(PoolConnection.java:192)
         weblogic.jdbc.wrapper.PoolConnection.close(PoolConnection.java:117)
         org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:74)
         org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:388)
         org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:343)
         org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:230)
         org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:201)
         org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:127)
         com.bharosa.common.hibernate.HiberDBMgr.commitTransaction(HiberDBMgr.java:293)
         com.bharosa.common.db.BharosaDBMgr.endSession(BharosaDBMgr.java:243)
         com.bharosa.common.hibernate.HiberBaseDAO.executeQuery(HiberBaseDAO.java:596)
         com.bharosa.common.hibernate.HiberBaseDAO.executeDBQuery(HiberBaseDAO.java:543)
         com.bharosa.common.hibernate.HiberDBMgr.executeDBQuery(HiberDBMgr.java:351)
         com.bharosa.vcrypt.dataaccess.impl.VCryptUserDataAccessImpl.getVCryptUserByLoginId(VCryptUserDataAccessImpl.java:520)
         com.bharosa.vcrypt.auth.impl.VCryptAuthImpl.getUserByLoginId(VCryptAuthImpl.java:274)
         com.bharosa.client.BharosaHelper.getUser(BharosaHelper.java:116)
         com.bharosa.client.BharosaHelper.createPersonalizedAuthentiPad(BharosaHelper.java:308)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthDelegateSkeleton.getAuthpadHTML(IntegratedAuthDelegateSkeleton.java:672)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthDelegateSkeleton.createAuthPad(IntegratedAuthDelegateSkeleton.java:113)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthDelegateSkeleton.createAuthPad(IntegratedAuthDelegateSkeleton.java:103)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthRemoteServlet.invokeService(IntegratedAuthRemoteServlet.java:60)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthRemoteServlet.doPost(IntegratedAuthRemoteServlet.java:40)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    >
    <Dec 16, 2008 12:11:03 PM PST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "616" seconds working on the request "weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl@ba063", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
         weblogic.common.resourcepool.ResourcePoolImpl.getCurrCapacity(ResourcePoolImpl.java:671)
         weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:1922)
         weblogic.timers.internal.TimerImpl.run(TimerImpl.java:265)
         weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    >
    <Dec 16, 2008 12:11:03 PM PST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "635" seconds working on the request "Http Request: /fahost/econnect/IntegratedAuthRemoteServlet.svl;JSPSESSIONID=Q3C6JLLV1lwjqmTWLQ4m5M02BqBKmQzcyt66wY925kykg2pQyB1t!1872529297!468271380!1229457621681", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
         java.net.SocketInputStream.socketRead0(Native Method)
         java.net.SocketInputStream.read(SocketInputStream.java:129)
         oracle.net.ns.Packet.receive(Unknown Source)
         oracle.net.ns.DataPacket.receive(Unknown Source)
         oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
         oracle.net.ns.NetInputStream.read(Unknown Source)
         oracle.net.ns.NetInputStream.read(Unknown Source)
         oracle.net.ns.NetInputStream.read(Unknown Source)
         oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1099)
         oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1070)
         oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:478)
         oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
         oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
         oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10622)
         weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:157)
         org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
         org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
         org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
         org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
         org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
         org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
         org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
         org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
         org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
         com.bharosa.common.hibernate.HiberDBMgr.commitTransaction(HiberDBMgr.java:293)
         com.bharosa.common.db.BharosaDBMgr.endSession(BharosaDBMgr.java:243)
         com.bharosa.common.dataaccess.DataAccessMgr.endSession(DataAccessMgr.java:132)
         com.bharosa.vcrypt.tracker.impl.VCryptTrackerImpl.updateLog(VCryptTrackerImpl.java:1048)
         com.bharosa.vcrypt.tracker.impl.VCryptTrackerImpl.updateLog(VCryptTrackerImpl.java:622)
         com.bharosa.client.BharosaHelper.fingerPrintFlash(BharosaHelper.java:203)
         com.bharosa.client.BharosaHelper.fingerPrintBrowser(BharosaHelper.java:155)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthDelegateSkeleton.runPreAuthRules(IntegratedAuthDelegateSkeleton.java:239)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthDelegateSkeleton.runPreAuthRules(IntegratedAuthDelegateSkeleton.java:214)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthRemoteServlet.invokeService(IntegratedAuthRemoteServlet.java:83)
         com.svb.ib.security.web.loginauthserver.IntegratedAuthRemoteServlet.doPost(IntegratedAuthRemoteServlet.java:40)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    >

    Hi. Something is seriously ill there. I would ask that you post a full thread dump
    to see what's locking what. You may need an official support case...

  • Replace Quotes, Connection Pooling, and Sun Web Server with MySQL, Oracle

    This is code I use to insert data into my MySQL and Oracle databases.
    I takes care of quotes and shows use of context, i.e. when you use Sun Web Server's
    ConnectionPooling. This code works. Feel free to reply if you have questions on how to set up connection pooling using Sun Web Server 6.1SP - it took quite a long time to learn and I couldn't find much information throughout the web, so I hope this helps...
    This is not a question and I am not looking for an answer, but please post comments or suggestions.
    dailysun
    This is in one class where I have a hashtable containing the
    column name / value pairs that I want to enter into my table.
    This class simply creates the SQL string from the values in the
    hashtable. It then passes that hashtable including the database
    name to a class which executes that sql statement (second code
    portion).
    /* Insert data into sf_parts. Create the column strings from
             * the provided hash table. Be sure to parse out hash elements which
             * are used for the createTemplate process
            StringBuffer values = new StringBuffer();
            StringBuffer fields = new StringBuffer();
            Enumeration keys = fieldHash.keys();
            while(keys.hasMoreElements()){
                Object currentKey = keys.nextElement();
                    String fieldValue = (String) fieldHash.get(currentKey);
                    if(values.length() >0){
                        values.append(",");
                    values.append("'"+fieldValue.replaceAll("'","''")+"'"); // Takes care of quotes and various other special characters!
                    if(fields.length() >0){
                        fields.append(",");
                    fields.append(currentKey);
            sql = "INSERT INTO myTable (" + fields.toString() + ") VALUES (" + values.toString() + ");";
            String insertResult = caq.getInsertDelete(sql,"myDatabaseName"); // your database name is defined in web.xml and sun-web.xml when you use Sun Web Server's Connection Pooling.
            returnValue += "<br><br><b>Rows inserted into table(myTable): </b>" + insertResult + "<br>\n";
            And, like I describe above, this method executes the sql statement.
         * Takes care of insert, update and delete requests.
         * Must have set both dbName as well as the sql String.
         * Will return number of rows affected as String.
         * @return String Number of rows affected
         * @exception SQLException
         * @exception Exception
        public String getInsertDelete() {
            checkData(); // this simply checks if the variables dbName and sql are not empty ;-)
            InitialContext initContext = null;
            int rv = 0;
            try{
                // Get connection from configured pool
                initContext = new InitialContext();
                source = (DataSource) initContext.lookup("java:comp/env/jdbc/" + dbName); // I have this set up in web.xml and sun-web.xml (I use Sun Web Server 6.1SP which does connection pooling for me)
                conn = source.getConnection();
                if(conn != null){
                    stmt = conn.createStatement();
                    rv = stmt.executeUpdate(sql);
            }catch (SQLException e){
                // do something
            }catch (Exception e){
                // do something
            }finally{
                try{
                    stmt.close();
                }catch(Exception e){
                    // do something
                try{
                    conn.close();
                }catch(Exception e){
                    // do something
                try{
                    initContext.close();
                }catch(Exception e){
                    // do something
            return rv+"";
        }  

    This is code I use to insert data into my MySQL and
    Oracle databases.
    I takes care of quotes and shows use of context, i.e.
    when you use Sun Web Server's
    ConnectionPooling. This code works. Feel free to
    reply if you have questions on how to set up
    connection pooling using Sun Web Server 6.1SP - it
    took quite a long time to learn and I couldn't find
    much information throughout the web, so I hope this
    helps...
    This is not a question and I am not looking for an
    answer, but please post comments or suggestions.Using prepared statements would mean that you wouldn't have to worry about quotes.
    You should be closing the result set.
    You are handling all fields as strings. That won't work with time fields and might not work for numeric fields.
    Presumably most of your variables are member variables. They should be local variables because that is the scope of the usage.
    You must do something with the exceptions.
    Hashtables although convienent mean that problems with usage can only be resolved at run time rather than compile time.

  • Tomcat Connection Pooling

    I am using Tomcat connection pooling (DBCP) to get the connection from the Database
    It really works great with Oracle, MySQL, Sybase and as well as DB2.
    Recently I tried to integrate apache with tomcat to improve the performance.
    But now the problem is I am unable to load the JDBC Driver its giving me an error message as Cannot load JDBC driver class ?null?
    @ org.apache.commons.dbcp.BasicDataSource.createDataSource ..
    Interseting thing is I am able to get connection through datasource(DBCP) if I use the following URL
    http://localhost:8080/application _name/Hello.jsp
    But I get the error message when I try to get connection through datasource(DBCP)
    as Cannot load JDBC driver class ?null? for this URL
    http://localhost/application_name/Hello.jsp
    Both the URL use same server.xml, httpd.conf,servlet class and jsp pages
    Gurus can you please help me to understand why my application is unable to get the connection when I use this URL http://localhost/application_name/Hello.jsp
    But not with other one
    Please........... Some one help me
    Thanks in Advance
    Maria

    Thanks for your reply
    Yes I am doing context lookup like this
    Context ctx = (Context) new InitialContext().lookup("java:comp/env");
    conn = ((DataSource) ctx.lookup("jdbc/test")).getConnection();
    This works with Tomcat but I am unable to make it work after
    integrating tomcat with apache
    Thanks for your help
    Maria

  • Tomcat Connection pooling problem

    I am using Tomcat connection pooling (DBCP) to get the connection from the Database
    It really works great with Oracle, MySQL, Sybase and as well as DB2.
    Recently I tried to integrate apache with tomcat to improve the performance.
    But now the problem is I am unable to load the JDBC Driver its giving me an error message as Cannot load JDBC driver class ?null?
    @ org.apache.commons.dbcp.BasicDataSource.createDataSource ..
    Interseting thing is I am able to get connection through datasource(DBCP) if I use the following URL
    http://localhost:8080/application _name/Hello.jsp
    But I get the error message when I try to get connection through datasource(DBCP)
    as Cannot load JDBC driver class ?null? for this URL
    http://localhost/application_name/Hello.jsp
    Both the URL use same server.xml, httpd.conf,servlet class and jsp pages
    Gurus can you please help me to understand why my application is unable to get the connection when I use this URL http://localhost/application_name/Hello.jsp
    But not with other one
    Please........... Some one help me
    Thanks in Advance
    Maria

    How did you make Tomcat connection pooling(DBCP) working with Oracle?
    I refereced to the "JNDI Datasource HOW-TO" in Jakarta Tomcat. I am using Tomcat 4.18. I can get DataSource object, but when to get connection from dataSource, not any response, It seems freezing.
    I appreciate any reply.
    Johnson Ouyang

  • Welogic 9.2 jdbc connection pool monitoring section not displaying server

    Welogic 9.2 managed jdbc connection pool monitoring section not displaying server name. Can you please let me know how can i achive this

    Hi,
    It happens if the Connectivity is Lost b/w DataBase & WLS Server...In that case in the WLS AdminConsole---DataSource---Monitoring Tab you wont see even the Testing Page with valid datasource to test it.
    So please make sure that the N/W connectivity proper....One more thing you can try:
    <h3><font color=red>Test-1</font></h3>
    You can use *“weblogic.Admin”* utility to Enable and Disable the Pool (DataSource) Just to Confirm whether the dataSource is actually active or not::
    Step1). run *"setWLSEnv.sh"* first in the same Shell prompt....then do the following:
    Step2). To suspend:
    java weblogic.Admin -url t3://localhost:7001 -username weblogic -password weblogic SUSPEND_POOL YourDataSourceName
    Step3). To re-enable:
    java weblogic.Admin -url t3://localhost:7001 -username weblogic -password weblogic RESUME_POOL YourDataSourceName
    To test whether you are getting any Exception or Error while doing this....If yes u are getting any Error or exception then It means there May be some Database connectivity issue...
    <h3><font color=red>Test-2</font></h3>
    Please use the following Utility to Test the Database connectivity from your WLS Server box:
    <font color=maroon>
    java -classpath /opt/app/bea/weblogic92mp2/weblogic92/server/lib/weblogic.jar -Dbea.home=/opt/app/bea/weblogic92mp2   utils.dbping ORACLE_THIN DbUserName DBPassword somethingDbUrl.Something.net:1521:dbInstance
    </font>
    Syntax:
    java   -classpath /opt/app/bea/weblogic92mp2/weblogic92/server/lib/weblogic.jar   -Dbea.home=/opt/app/bea/weblogic92mp2   utils.dbping   ORACLE_THIN   <DBUserName>   <DBPassword>   <DBURL>
    The above utilty will test the DB Connectivity ...you need to run it from your WLS server Box...
    <h3><font color=red>Another Simple Alternative of Test-2</font></h3>
    http://jaysensharma.wordpress.com/2010/03/23/testing-datasource-status-using-wlst/
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)

  • Need help on resolving the issue with adobe output server - error MSG256 & MSG 210 not in .ini file

    Hi,
    I am using adobe output designer 5.5 for designing the label template and using the Adobe output server for printing process.
    In the Jfmerge.ini we given the condition "DiscardUnknownFields=Yes" for ignoring the unwanted fields in the .dat file.
    During the process, I faced some issue with the output server in printing the labels.
    When the .dat file is placed in the Data folder of adobe, the label is not getting printed in the printer.
    The file is move to the error folder and an error file is getting generated which contains the error message as given below:
    090826 02:59:02 D:\Program Files\Adobe\Central\Bin\jfmerge: [256]** Message Msg256 not in .ini file **
    090826 02:59:02 D:\Program Files\Adobe\Central\Bin\jfmerge: [210]** Message Msg210 not in .ini file **
    2009/08/26 02:59:02 D:\Program Files\Adobe\Central\Bin\jfserver.exe: [314]Agent exit message: [210]** Message Msg210 not in .ini file **
    The output server is a new installtion and I verified the Jfmerge.ini file. It contains the message details of Msg256 and Msg210.
    I also verified the license and it is a valid licence.
    Kindly help me out in solving this issue.
    Thanks
    Senthil

    I assume this is too late to help you, but other might need a hint.  I had the same problem, and found some possible causes that I posted on http://codeznips.blogspot.com/2010/02/adobe-output-server-message-msg210-not.html.
    It is quite likely that you are missing some double quotes around the path specifying the ini file (-aii), if its installed under "Program Files".
    Hope this helps anyone....
    Vegard

  • Issue with web part connections : won't display data when the lookup field is a calculated field

    Hello,
    I have a list A with a calculated field named A.A. I have a list B that has a lookup field to list A, to field A.A, named B.A. I add the two lists in a wiki page and I try to connect them - I.E., select a row from A and the rows from B would be automatically
    filtered.
    The B\Connections\get filtered values from A and select Provider:A.A, Consumer B.A doesn't bring any results. If I do the exact opposite: A\Connections\get filtered values from B and select Provider:B.A, Consumer A.A  works fine. But, this is not what
    I want.
    If the A.A isn't calculated field, everything works fine. So, it looks like there's an issue with calculated fields acting as consumers.
    Is this a known issue and are there any know workarounds? A workaround is to abandon calculated field and  use sharepoint designer workflow.
    Thank you
    Christos

    Hi,
    According to your post, my understanding is that you had issues about connecting web parts.
    I try to reproduce the issue, however, everything works well.
    Create a custom list named List A, add a caculated column named A.A(Formula: =Title).
    Create a custom list named List B, add a lookup column named B.A(List A: A.A).
    Create a page and then insert the two list view web parts.
    Edit page, select List B->Connections->Get Filtered Values From List A.
    Then I can filter the List B.
    I recommend to create another caculated column and get filter value form it to check whether it works.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Connection pooling issue, urgent

    Hi,
    Our asp.net web application use sAP .net connector to make RFC call to sap CRM system. recently, I am trying to utilizing connection pooling, but assigning connection obtained from pool to proxy class , I did exactly the online help docs says, but, i got some very disappointment result, it cause iis worker process memory write proctection error. and very time, I reboot my machine, the problem does not go away, my O.S tells me that "Data Execution proctection" warning comes up and afterwords, iis worker process and etc, I am not sure what I did wrong, any body experience similar problem,
    after I uninstall .net connection, and I reboot my machine
    , this error went away. Please help.
    following is my configuration settings:
    <SAP>
           <Connector>
                 <ConnectionPool              
                   MaxOpenConnections="20"  
                                 MaxCapacity="20"
                           MaxIdleTime="10"
                           CleanupInterval="10" />                   
                          <Destinations Default="cd1">
                              <Entry
                                DestinationName="cd1"
                                AppServerHost="ASHOST=sapcrd01.bentley.com"
                                SystemNumber="00"
                                Username="ASPRFC"
                                Password="bentley"
                                Client="100"/>                        
                           </Destinations>
              </Connector>
         </SAP>
    following line of code is from myproxy constructor
         this.oCommonProxy.Connection=SAP.Connector.Connection.GetConnectionFromPool(GetConnectStringForUser(this.sRfcUser,this.sRfcPass));
    public void CloseConnection()
                                       SAP.Connector.Connection.ReturnConnection(this.oCommonProxy.Connection);
    Message was edited by: Yuwen Li
    Message was edited by: Yuwen Li

    Hm, sounds strange. Can you try to attach a debugger with both, managed and unmanged mode, turn on "first chance exception handling" for all exception types and check the call stack when the exception happens?

  • Possible issue with Web service connections in SP3

    Hello,
    I installed Xcelsius 2008 SP3 over SP2 and some of my input values for my web service connection were not being built into the XML request. I then rolled back to 2008 SP2 and all was fine. Not a thing i tried could fix it, and it was not all the input values just some of them and the same ones each time. Perhaps i installed different Xcesius suites: the SP2 one i have is trial version and has a black BO splash, the SP3 one has a yellow SAP splash. SP3 has some funky enhancements so i would certainly like to go that way. Any ideas? Or ideas as to how i could get this into BO support for troubleshooting?
    Regards,
    Gilbert

    By mistake I posted to this thread. Removing my message.
    Edited by: Anil Kumar on Dec 24, 2009 4:55 AM

  • Connection pool for big web application

    hi,
    i am developing an application which had more then 20 classes and each class use databases.
    i made an connection bean and use it for database connectivity but as my code expand and my application run for longer time i start getting error of connection limit.
    then i start using connection pool. in this i start using one connection for whole application.
    now i want that my
    1-whole application use that connection pool and i dont need to initialize it in different classes.
    2- The main problem is that may at a time i have to connect database with different user and these connections should remain active.
    my application will be used for enterprise level and remain active for months .
    following is my connection pool
    public class ConnectionPool implements Runnable
          private Log log=new Log();
          private String driver, url, username, password;
          private int maxConnections;
          private boolean waitIfBusy;
          private Vector availableConnections, busyConnections;
          private boolean connectionPending = false;
          public ConnectionPool(String driver, String url,String username, String password,int initialConnections, int maxConnections, boolean waitIfBusy) 
              this.driver         =     driver;
              this.url            =     url;
              this.username       =     username;
              this.password       =     password;
              this.maxConnections =     maxConnections;
              this.waitIfBusy     =     waitIfBusy;
              if (initialConnections > maxConnections)
                initialConnections = maxConnections;
              availableConnections = new Vector(initialConnections);
              busyConnections = new Vector();
              try
                  for(int i=0; i<initialConnections; i++)
                    availableConnections.addElement(makeNewConnection());
              catch(Exception e)
                log.write(e.getMessage());
          }//EO constructor
      public synchronized Connection getConnection()
             if (!availableConnections.isEmpty())
                  log.write("Total connections="+availableConnections.size());
                  Connection existingConnection =  (Connection)availableConnections.lastElement();
                  int lastIndex = availableConnections.size() - 1;
                  availableConnections.removeElementAt(lastIndex);
                  // If connection on available list is closed (e.g.,it timed out), then remove it from available list
                  // and repeat the process of obtaining a connection. Also wake up threads that were waiting for a connection because maxConnection limit was reached.
                        try
                            if (existingConnection.isClosed())
                              notifyAll(); // Freed up a spot for anybody waiting
                              return(getConnection());
                            else
                              log.write(  "in available connection"  );
                              busyConnections.addElement(existingConnection);
                              return(existingConnection);
                        catch(SQLException se)
                            log.write(se.getMessage());
              } else {
                        // Three possible cases:
                        // 1) You haven't reached maxConnections limit. So establish one in the background if there isn't
                        //    already one pending, then wait for the next available connection (whether or not it was the newly established one).
                        // 2) You reached maxConnections limit and waitIfBusy flag is false. Throw SQLException in such a case.
                        // 3) You reached maxConnections limit and waitIfBusy flag is true. Then do the same thing as in second
                        //    part of step 1: wait for next available connection.
                        if ((totalConnections() < maxConnections) &&  !connectionPending)
                          makeBackgroundConnection();
                        else if (!waitIfBusy)
                            log.write("Connection limit reached");
                        // Wait for either a new connection to be established (if you called makeBackgroundConnection) or for
                        // an existing connection to be freed up.
                        try {
                          wait();
                        catch(InterruptedException ie)
                          log.write(ie.getMessage());
                  // Someone freed up a connection, so try again.
                return(getConnection());
              }//EO main if-else
          return null;
    }//EO getconnection method
      // You can't just make a new connection in the foreground
      // when none are available, since this can take several
      // seconds with a slow network connection. Instead,
      // start a thread that establishes a new connection,
      // then wait. You get woken up either when the new connection
      // is established or if someone finishes with an existing
      // connection.
      private void makeBackgroundConnection() {
        connectionPending = true;
        try {
          Thread connectThread = new Thread(this);
          connectThread.start();
        } catch(OutOfMemoryError oome) {
          // Give up on new connection
          log.write(oome.getMessage());
      public void run() {
        try {
          Connection connection = makeNewConnection();
          synchronized(this) {
            availableConnections.addElement(connection);
            connectionPending = false;
            notifyAll();
        } catch(Exception e) { // SQLException or OutOfMemory
          // Give up on new connection and wait for existing one free up.
          log.write(e.getMessage());
      // This explicitly makes a new connection. Called in
      // the foreground when initializing the ConnectionPool,
      // and called in the background when running.
      private Connection makeNewConnection()
        //log.write("make new connection with  "+url+" "+username+" "+password +" and driver= "+driver);
        Connection connection=null;
          try
            // Load database driver if not already loaded
            //Class.forName(driver);
             DriverManager.registerDriver(new OracleDriver());
            // Establish network connection to database
            connection =  DriverManager.getConnection(url, username, password);
                    if( connection.isClosed() )
                      log.write("ooooooops no connection");
                    else
                      log.write("yahoooo get connection");
          catch(Exception e)
            log.write(e.getMessage());
        return(connection);
      public synchronized void free(Connection connection) {
        busyConnections.removeElement(connection);
        availableConnections.addElement(connection);
        // Wake up threads that are waiting for a connection
        notifyAll();
      public synchronized int totalConnections() {
        return(availableConnections.size() + busyConnections.size());
      /** Close all the connections. Use with caution:
       *  be sure no connections are in use before
       *  calling. Note that you are not <I>required</I> to
       *  call this when done with a ConnectionPool, since
       *  connections are guaranteed to be closed when
       *  garbage collected. But this method gives more control
       *  regarding when the connections are closed.
      public synchronized void closeAllConnections() {
        closeConnections(availableConnections);
        availableConnections = new Vector();
        closeConnections(busyConnections);
        busyConnections = new Vector();
      private void closeConnections(Vector connections) {
        try {
          for(int i=0; i<connections.size(); i++) {
            Connection connection =
              (Connection)connections.elementAt(i);
            if (!connection.isClosed()) {
              connection.close();
        } catch(SQLException sqle) {
          // Ignore errors; garbage collect anyhow
          log.write(sqle.getMessage());
      }i get this code from internet, in which it also mention that use following code
    public class BookPool extends ConnectionPool {
    private static BookPool pool = null;
    private BookPool(...) {
    super(...); // Call parent constructor
    public static synchronized BookPool getInstance() {
    if (pool == null) {
    pool = new BookPool(...);
    return(pool);
    }if some one want to use it for whole application then use connection pool by BookPool,
    now main point is i m not getting the BookPool class could some one explain it to me???
    and second by using it can i connect to different users of DB at a time, if cant then how i can.
    its good if some one explain it by little code.
    thxxxxxxxxxxxxxxxxxx

    If this is a real, serious application and not just for practice, then why are you trying to write your own connection pool implementation?
    You'd better use Jakarta's Commons Pool and Commons DBCP, which are widely used, well tested implementations of connection pools.
    If this is a web application running in a J2EE container, you'd normally configure the connection pool in the container. The container will register the pool in JNDI and you'd look it up in JNDI from your application.
    Here's some documentation on how to do that in Tomcat 5.5: JNDI Datasource HOW-TO

Maybe you are looking for

  • Problem in Archiving File From FTP Server to XI File Server Using FCC

    Hi, The scenario is file to IDOc. XI has to read the input file from client FTP server and archive it to XI local file server. Archiving on XI server is working fine without FCC (for xml files). But with FCC, the sender FTP adapter is archiving empty

  • Problem with form or servlet???

    hello.. i am trying to send some form data to a servlet for processing.. here is the code for the form <table border="0"> <form action="details.upd" method="post" name="upd"> <tr><td>Username</td><td><input name="uname" type="text" size="25" maxlengt

  • Strange route in Maps 2.0

    If the map itself is wrong Navteq is the one to blame. What if the route that Maps 2.0 creates is totaly bizzare? Whos fault is that? Nokia? Message Edited by smoketoomuch on 07-Nov-2008 02:14 PM Solved! Go to Solution.

  • Obtaining accurate printing results

    Hi, I am using Ps CS5.1, Canon printer Pixma MP988 & a Mac OS X10.9.1. In the last couple of weeks I no longer am getting correct pri ntouts, I susspect something related to colour profiling has recently changed (I must have done it myself but not aw

  • Getting SOA 10.1.3.5 JmsAdapter to connect to WL jms on other server.

    I have a SOA 10.1.3.5 environment running on windows and I want to create a BPEL project that uses the JmsAdapter to connect to a WL jms queue running on linux box. Following docs I've seen, I copied over the weblogic.jar and wljmsclient.jar to the %