Java.sql.SQLException: Error in allocating a connection

hi,
I have developed enterprise application using net beans IDE 5.5.I created one enity bean using sql server database.When i tried deploy this project i am getting following error...
Internal Exception: java.sql.SQLException: Error in allocating a connection.
Cause: Class name is wrong or classpath is not set for : com.microsoft.jdbc.sqlserver.SQLServerDataSourceError
can anybody please help me.....where i went wrong...i am new to netbeans IDE
regrds
patel

u need to download the three jar files.
download the following jar files and add in ur classpath.
msutil-2000.sp2-lib.jar
msbase-2000.sp2-lib.jar
mssqlserver-2000.sp2-lib.jar
This is sample program...
u can test in standalone first and do in netbeans....
import java.sql.*;
public class querybean {
public String getdata(String sql) {
     try {
System.out.println("testing connection ");
          Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
     Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=master;user=sa;password=userpass;");
     Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(sql);
System.out.println("testing connection pooling");
while(rs.next()) {
System.out.println(rs.getString(1));
} catch(Exception e1) {
System.out.println("exception caught" + e1);
return "";
public static void main (String args[]) throws Exception {
querybean qb = new querybean();
qb.getdata("select * from sampletable");
I belive it will work now

Similar Messages

  • Java.sql.SQLException: Error in allocating a connection. Cause: No Password

    I'm deploying an EJB Module with a CMP in SJAS from SJSE.
    I get the following exception "java.sql.SQLException: Error in allocating a connection. Cause: No PasswordCredential found" the first time a CMP tries to connect to the MS SQL Server database.
    I can connect through the Admin console (PING works fine) but this error hapens in runtime.
    The datasource classname i'm using is "com.sun.sql.jdbcx.sqlserver.SQLServerDataSource" which is suggested by the SJSE.
    Any help will be welcome...
    Nelson Marques

    If you are using Netbeans, then this link might help:
    http://forum.java.sun.com/thread.jspa?forumID=136&threadID=598423
    Otherwise, have you try this ?
    Verify your sun-ejb-jar.xml does not use default-resource-princinpal element:
    <res-ref-name>jdbc/pdisasdb</res-ref-name>
    <jndi-name>jdbc/pdisasdb</jndi-name>
    <default-resource-principal>
    <name>myname</name>
    <password>geheim</password>
    </default-resource-principal>
    </resource-ref>

  • Glassfish SQLException: Error in allocating a connection in MySQL

    Hi All,
    I have just installed the Bundled Netbeans 6.5, Glassfish v2 and v3 Prelude (not including MySQL) that runs on top of MySQL 5.1 (separate installation) on server A, in order to mirror another similar working installation (Bundled Netbeans 6.1, Glassfish v2 including MySQL 5.0) on server B. Both Windows XP servers have got identical setups in their respective C:\Program Files\glassfish-v2ur2\domains\domain1\config\domain.xml files. However, the following error was encountered when trying to deploy the same EnterpriseApplication on server A which had no such problem on server B:
    Glassfish Server Log
    Server: unknown
    RAR5099 : Wrong class name or classpath for Datasource Object
    java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1498)
            at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:251)
            at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:106)
    RAR5038:Unexpected exception while creating resource for pool mysqlPool. Exception : Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    RAR5117 : Failed to obtain/create connection from connection pool [ mysqlPool ]. Reason : Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource]
    Exception occured in J2EEC Phase
    com.sun.enterprise.deployment.backend.IASDeploymentException:
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    Error Code: 0
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
    EnterpriseApplication (EJB 3.0) Deployment output
    Deploying application in domain failed; Deployment Errorjava.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    Error Code: 0
    C:\Documents and Settings\Jack\EnterpriseApplication\EnterpriseApplicationBean-ejb\nbproject\build-impl.xml:400: The module has not been deployed.Even manually re-creating the same project (as opposed to getting a copy of the Netbeans project folder from server B) did not make any difference. Likewise, the following jdbc connection pool definition was added possibly by Netbeans from Server Database JDBC Connection Resource setting:
          <property name="URL" value="jdbc:mysql://localhost:3306/employeeDB"/>
          <property name="driverClass" value="com.mysql.jdbc.Driver"/>
          <property name="Password" value="abcdef"/>
          <property name="portNumber" value="3306"/>
          <property name="databaseName" value="employeeDB"/>
          <property name="serverName" value="localhost"/>
          <property name="User" value="applicationuser"/>Can anyone see where the problem lies?
    Any assistance would be much appreciated.
    Thanks in advance,
    Jack

    I'm new to Java and GlassFish and I get the same error message when trying to ping my created data pool for MySQL. Inside the NetBeans IDE running Java Swing Applications + MySQL connection via JDBC, it works fine (Classpath settings ok). I set the same path to the JVM settings in Glassfish but every time I try to ping it the mentioned error occurs. Any suggestions?

  • Java.sql.SQLException: Error while trying to retrieve text for error ORA-24

    Hi All,
    Am having serious problem with ORA-24327 and the behavior is very very unpredictable. I have couple of environment where the same error comes in different context. The recent one was surprising. I have describe bellow the environment configuration and the stack trace. The error which surprised me was when I use type � 3 driver while starting weblogic I get ORA �24327 but when I use Type �4 it starts properly. If you could kindly provide solution it would be great help. I would also appreciate if u can provide information which driver to use where performance is the major concern. I would also appreciate if u could provide feed-back from the industry about booth the driver. Apart from that I have couple have environment where it occurs when 10/12 user access simultaneously. All the open connection is closed in program properly still am getting the error.
    Thanks in anticipation.
    Cheers,
    Tapas
    Environment
    OS - SunOS 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-Enterprise
    JDK - Solaris VM (build Solaris_JDK_1.2.2_07, native threads, sunwjit)
    Weblogic - 5.1.0 Service Pack 9 04/05/2001 14:59:53 #105983
    Oracle � 8.1.6
    Delaying 10 seconds before making a beuatpool pool connection.
    Pool 1 (Type �3 )
    weblogic.jdbc.connectionPool.beuatpool=\
    url=jdbc:weblogic:oracle,\
    driver=weblogic.jdbc.oci.Driver,\
    loginDelaySecs=10,\
    initialCapacity=10,\
    maxCapacity=20,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=10,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=xxx;password=xxx;server=xxxx
    Pool 2(Type �4)
    weblogic.jdbc.connectionPool.thinPool=\
    url=jdbc:oracle:thin:@xxx:1521:xxx,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=10,\
    capacityIncrement=1,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=15,\
    testTable=dual,\
    props=user=xxx;password=xxx;server=xxx:1521:xxx
    allow=everyone
    ---------- LOGIN ERROR CODE: 24327
    java.sql.SQLException: Error while trying to retrieve text for error ORA-24327 �
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at weblogic.db.oci.OciConnection.getLDAException(OciConnection.java:143)
    at weblogic.jdbcbase.oci.Driver.connect(Driver.java:157)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:149)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:109)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    ---------- LOGIN ERROR CODE: 24327
    ---------- LOGIN ERROR CODE: 24327
    Fri Aug 31 00:57:22 GMT-05:00 2001:<I> <JDBC Pool> Sleeping in createResource()
    Fri Aug 31 00:57:23 GMT-05:00 2001:<E> <JDBC Pool> Failed to create connection p
    ool "beuatpool"
    weblogic.common.ResourceException: weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: Error while trying to retrieve text for error ORA-24327 -
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at weblogic.db.oci.OciConnection.getLDAException(OciConnection.java:143)
    at weblogic.jdbcbase.oci.Driver.connect(Driver.java:157)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:172)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:109)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at weblogic.common.ResourceException.<init>(ResourceException.java:18)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:182)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:109)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at weblogic.common.ResourceException.<init>(ResourceException.java:18)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:125)
    at weblogic.common.internal.ResourceAllocator.makeResources(Compiled Cod
    e)
    at weblogic.common.internal.ResourceAllocator.<init>(Compiled Code)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:330)
    at weblogic.jdbc.common.internal.JdbcInfo.initPools(Compiled Code)
    at weblogic.jdbc.common.internal.JdbcInfo.startup(JdbcInfo.java:200)
    at weblogic.jdbc.common.internal.JdbcStartup.main(JdbcStartup.java:11)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.t3.srvr.StartupThread.runMain(StartupThread.java:219)
    at weblogic.t3.srvr.StartupThread.doWork(Compiled Code)
    at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)

    Hi,
    I guess you can try some of these:
    - Make sure you're not missing an entry inside your tnsnames.ora file. Thin driver does not require the information inside that file, as opposed to Weblogic's OCI driver. If you are able to connect to the DB using a thin driver, then the problem is most probably (WL)driver-related.
    - Make sure you've properly configured the DB user / password inside your weblogic.properties (config.xml if WL6+).
    - Make sure you're able to access all drivers and classes required (PATH, CLASSPATH, etc...)
    - Make sure the OCI driver version you are using is fully compatible with the Oracle (server) version you are pointing to.
    - Try to access the DB user through some other client (for instance, SQLPlus*).
    Hope this is of some help,
    Freddy.

  • Java.sql.SQLException: Error while trying to retrieve text for error ORA-12545

    Hi,
    I am getting the following error when i tried to connect to Oracle database from
    a servlet. This exception is coming at the time of getting connection. And the
    same code is working when i used in the standalone java program.
    Oracle 8i database and WLS 6.0 are on the same UNIX machine.
    ---------attempting to connect ------
    java.sql.SQLException: Error while trying to retrieve text for error ORA-12545
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java, Compiled
    Code)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java, Compiled C
    ode)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java, Compiled Code)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java, Com
    piled Code)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va, Compiled Code)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java, Compiled C
    ode)
    at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Cod
    e)
    at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Cod
    e)
    at ConnectionPoolServlet.doGet(ConnectionPoolServlet.java, Compiled Code
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Cod
    e)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Cod
    e)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java, Compiled Code)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java, Compiled Code)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java, Compiled Code)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java, Compiled Co
    de)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    Can any one help me out.
    Durga

    The problem is solved after exprting the parameter ORACLE_SID=<database_name>
    in Weblogic startup script.
    thank u for the suggestions.
    Durga
    Joseph Weinstein <[email protected]> wrote:
    >
    >
    Durga wrote:
    Hi Joe,
    I have checked the ORACLE_HOME parameter. There was a differnce. Ichanged to
    /oracle/app/product/8.1.7
    Now i am getting different exception. But still the standalone codeis working.
    any clues why I am getting this exception. I will send the code andthe weblogic
    properties file for reference if u need.Good. No, I don't need it. Now make sure the library path that the OS
    uses to find
    Oracle libraries, and our driver libraries etc., is in the same order
    for the
    server as for the shell that is successful on it's own. Make sure your
    Oracle
    client stuff is ahead of any weblogic libraries.
    Joe
    java.sql.SQLException: ORA-12547: TNS:lost contact
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java,Compiled
    Code)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java,Compiled
    C
    ode)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java, CompiledCode)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java,Com
    piled Code)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java,Compiled
    C
    ode)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java,Compiled
    C
    ode)
    at java.sql.DriverManager.getConnection(DriverManager.java,Compiled Cod
    e)
    at java.sql.DriverManager.getConnection(DriverManager.java:177)
    at ConnectionPoolServlet.doGet(ConnectionPoolServlet.java,Compiled Code
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.getRuntimeName(ServletStubI
    mpl.java, Compiled Code)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java, Compiled Code)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:1631)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java,Compiled
    Co
    de)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, CompiledCode)
    Joseph Weinstein <[email protected]> wrote:
    The environment for the server probably doesn't have the same ORACLE_HOME
    setting as your shell when you succeed in a standalone.
    Also, you should be using our connection pools, and you should avoid
    making DriverManager calls in any multithreaded app such as WebLogic.
    Joe
    Durga wrote:
    Hi,
    I am getting the following error when i tried to connect to Oracledatabase from
    a servlet. This exception is coming at the time of getting connection.And the
    same code is working when i used in the standalone java program.
    Oracle 8i database and WLS 6.0 are on the same UNIX machine.
    ---------attempting to connect ------
    java.sql.SQLException: Error while trying to retrieve text for errorORA-12545
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java,
    Compiled
    Code)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java, CompiledC
    ode)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java, Compiled
    Code)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java,Com
    piled Code)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va, Compiled Code)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java, CompiledC
    ode)
    at java.sql.DriverManager.getConnection(DriverManager.java, CompiledCod
    e)
    at java.sql.DriverManager.getConnection(DriverManager.java, CompiledCod
    e)
    at ConnectionPoolServlet.doGet(ConnectionPoolServlet.java, CompiledCode
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, CompiledCod
    e)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, CompiledCod
    e)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java, Compiled Code)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java, Compiled Code)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java, Compiled Code)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java, CompiledCo
    de)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
    Code)
    Can any one help me out.
    Durga

  • Java.sql.SQLException: Error while trying to retrieve text for error ORA-12

    Hi,
    I am getting the following error when i tried to connect to Oracle database from a servlet on HP-UX. I am using wls 6.0. And the same code is working when i used in the standalone java program.
    java.sql.SQLException: Error while trying to retrieve text for error ORA-12545
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java, Compiled
    Code)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java, Compiled C
    ode)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java, Compiled Code)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java, Com
    piled Code)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va, Compiled Code)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java, Compiled C
    ode)
    at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Cod
    e)
    at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Cod
    e)
    at ConnectionPoolServlet.doGet(ConnectionPoolServlet.java, Compiled Code
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Cod
    e)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Cod
    e)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java, Compiled Code)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java, Compiled Code)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java, Compiled Code)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java, Compiled Co
    de)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    Can any one help me out.
    Durga

    This is the text for ORA-12545, there is a problem in your NET8 somewhere.
    http://technet.oracle.com/doc/network.815/a67440/ch11.htm#440586

  • Java.sql.SQLException: Error accessing jdbc driver

    Hi,
    We are using WebLogic Server 7.0 as Application Server.
    We now create a connection pool named regPool and
    a Tx datasource named regDS.
    When we get the connection from the datasource, exception occurred.
    java.sql.SQLException: Error accessing jdbc driver: driverURL =
    jdbc:weblogic:pool:regPool, props = {enableTwoPhaseCommit=false,
    jdbcTxDataSource=true, connectionPoolID=regPool}
    at
    weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:323)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:377)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:129)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java
    :265)
    So I guess that why we can't use CMP for finding data. Here is the error when we call the finder.
    javax.ejb.FinderException: Exception in findAllEmr while preparing or
    executing statement: 'null'
    java.sql.SQLException: Cannot obtain connection after 30 seconds. ,
    Exception = Access not allowed
    java.sql.SQLException: Cannot obtain connection after 30 seconds. ,
    Exception = Access not allowed
    at
    weblogic.jdbc.jts.Connection.wrapAndThrowSQLException(Connection.java:694)
    According to the exception message, it looks
    like the connection fail between WLS and Oracle 9.2.
    Here is a scenario I think you should need to know.
    I change the table-name in the weblogic-cmp-rdbms-jar.xml
    to a name that doesn't exist in the database.
    Then, re-package the EJB, copy it to server and restart the server.
    A exception occurred that says the table doesn't exist.
    So, in this case, it looks like the datasource works and
    connection is fine.
    Any recommendation will be appreciated.
    Jimmy Chang

    Hi!
    I am a default user to the databse server. I connect to the database with '\' as the username and blank passoword(I mean with Network authentication may be).When I am trying to create connection using
    con = DriverManager.getConnection("jdbc:oracle:thin:@DRACINAL2:BSAJ", "/","" )
    it gives me followint error
    ava.sql.SQLException: Null user or password not supported in THIN driver
         void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
         void oracle.jdbc.dbaccess.DBError.throwSqlException(int, java.lang.Object)
         void oracle.jdbc.dbaccess.DBError.check_error(int)
         oracle.jdbc.dbaccess.DBConversion oracle.jdbc.ttc7.TTC7Protocol.logon(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
         void oracle.jdbc.driver.OracleConnection.<init>(oracle.jdbc.dbaccess.DBAccess, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
         java.sql.Connection oracle.jdbc.driver.OracleDriver.getConnectionInstance(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
         java.sql.Connection oracle.jdbc.driver.OracleDriver.connect(java.lang.String, java.util.Properties)
         java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties, java.lang.ClassLoader)
         java.sql.Connection java.sql.DriverManager.getConnection(java.lang.String, java.lang.String, java.lang.String)
         void textPack.GenTextFile.main(java.lang.String[])
    How should I go about it?
    Thanks for your help.
    -Sreekanth Varidhireddy

  • [b]java.sql.SQLException: Io exception: Software caused connection abort: r

    hi ,
    In my application iam getting DBconnection obj from context attribute which iam using in all my sevlets & jsp's.
    The application is running fine but sometimes iam getting following exception
    java.sql.SQLException: Io exception: Software caused connection abort: recv failed
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:417)
    at oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConn
    ection.java:474)
    at oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.
    java:383)
    at org.apache.jsp.Vis_002dReg.GetCompNames_jsp._jspService(GetCompNames_
    jsp.java:64)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
    .java:311)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
    01)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
    atcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD
    ispatcher.java:575)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis
    patcher.java:498)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary
    .java:1002)
    at org.apache.jsp.Vis_002dReg.VisRegCustmer3_jsp._jspService(VisRegCustm
    er3_jsp.java:320)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
    .java:311)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
    01)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
    3)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
    :565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
    ool.java:619)
    at java.lang.Thread.run(Thread.java:534)
    222222 In GET COMPANY NAMES EXCEPTION
    java.lang.NullPointerException
    at org.apache.jsp.Vis_002dReg.GetCompNames_jsp._jspService(GetCompNames_
    jsp.java:101)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
    .java:311)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
    01)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
    atcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD
    ispatcher.java:575)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis
    patcher.java:498)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary
    .java:1002)
    at org.apache.jsp.Vis_002dReg.VisRegCustmer3_jsp._jspService(VisRegCustm
    er3_jsp.java:320)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
    .java:311)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
    01)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
    3)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
    :565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
    ool.java:619)
    at java.lang.Thread.run(Thread.java:534)
    can any body help me with this wat went wrong, need urgent

    Something bad happened.
    Why is this such a calamity?
    Anyway something (probably the server) closed the connection probably. Maybe a time out. Or you asked for something so dispicable the database got upset and booted you out.

  • Java.sql.SQLException: No operations allowed after connection closed

    Hi all
    I was trying the jakarta DBCP pool for managing my connections to Mysql(4.0.17-standard ). I let tomcat to manage the pool by specifying datasource in server.xml and web.xml. Everything works fine if there are only a few transactions. But when the number of queries increse, I get an exception like
    java.sql.SQLException: No operations allowed after connection closed.
    Connection was closed explicitly by the application at the following location:
    ** BEGIN NESTED EXCEPTION **
    java.lang.Throwable
    STACKTRACE:
    java.lang.Throwable
            at com.mysql.jdbc.Connection.close(Connection.java:1061)
            at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec
    tion.java:124)
            at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola
    bleConnectionFactory.java:196)
            at org.apache.commons.pool.impl.GenericObjectPool.returnObject(Unknown S
    ource)
            at org.apache.commons.dbcp.AbandonedObjectPool.returnObject(AbandonedObj
    ectPool.java:140)
            at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.j
    ava:110)
    ......I then tried the Connecion Pool manually with DBCP to check it is a problm with tomcat or ont. Still the exception comes after a few transactions. I re-checked the code and I am closing all connections in finally block. I searched in net for a solution, but couldnt find any. Is that a problm with mysql? has anyone experienced it? Any help will be greatly appreciated
    thanks
    boolee

    Odd that Throwable is the exception logged. What does your finally block actually look like? As an experiment, what happens if you execute the following line of hypothetical code in your 'finally' block?
    finally {
      System.out.println(conn.getClass().getName());
    }- Saish

  • Java.sql.SQLException errors in Tomcat log

    When bringing up a RoboHelp 8 help page using a URL like this:
    http://server:port/configuration/server?project=ProjectName&context=mapid
    an error is logged to my Tomcat localhost.date.log file.  The help page displays fine with no errors, but I'd rather not have the log files filling up with errors every time help is invoked.  Any idea what is causing these and how to avoid?  Is opening a browser window with a url the best way to invoke context sensitive help from a web app?
    Feb 24, 2010 1:46:09 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
        at adobe.robohelp.server.DatabaseManager.ExecuteUpdateNoCommit(DatabaseManager.java:237)
        at adobe.robohelp.server.DatabaseManager.GetNewUserId(DatabaseManager.java:447)
        at adobe.robohelp.server.CSystemManager.CreateCookies(CSystemManager.java:531)
        at adobe.robohelp.server.CSystemManager.doCommand(CSystemManager.java:207)
        at adobe.robohelp.server.HelpArea.doGet(HelpArea.java:62)
        at adobe.robohelp.server.AreaManager.doGet(AreaManager.java:79)
        at adobe.robohelp.server.RoboHelpServer.doGet(RoboHelpServer.java:149)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Unknown Source)

    I did a couple of things like fix the type that was being passed etc., and I get this exception now
    java.sql.SQLException: ORA-06550: line 1, column 28:
    PLS-00103: Encountered the symbol "COMPUTER" when expecting one of the following:
    . ( ) , * @ % & = - + < / > at in is mod remainder not rem =>
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2
    like4 likec as between from using || multiset member
    submultiset
    The symbol ". was inserted before "COMPUTER" to continue.
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
         at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:204)
         at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1006)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
         at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4714)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
         at dao.CallableStatementDAO.callProcedure(CallableStatementDAO.java:69)
         at integration.IntegrationService.main(IntegrationService.java:192)

  • Java.sql.SQLException: Cannot rollback a transactional connection

    Hi
    This is what i am trying to do:
    try{
    conn = getConnection();
    conn.setAutoCommit(false);
    execQuery(sql_1);
    execQuery(sql_2);
    conn.commit();
    }catch(Exception ex){
    conn.rollback();
    i have made an error in sql_2 so i get an Exception. My queries use the same "conn" so the rollback should applay to the first query but it has made a commit. How do i get rollback to work?
    I read this in an other topic:
    Make sure that you configure your database connection in the jboss.jcml and not in the bean (or servlet) itself.
    Then, make a lookup via jndi. On this way, the driver gets bound to the transactionManager and the rollback() works finde.
    But i don�t know how to configure the connections, and how does the trasactionManager work.
    Can some one help me?

    Maybe i should ad that i am using Oracle db an the
    code is in a Entity BeanThis changes the way you want to do rollbacks. Rollbacks in ejbs are handled by the container. In order to do rollbacks, you need to flag the transaction as to be rolled back. To do this, you need to call the method setRollbackOnly() in the ejb's SessionContext - sessionContext.setRollbackOnly();
    For this to work correctly, you must declare the method in the ejb's deployment descriptor as requiring to handle transactions by specifying the appropriate value for the <tran-attribute> element of you ejb's dd.
    BTW, you'd be better off posting EJB related question in the J2EE SDK forum.

  • Java.sql.SQLException: The TCP/IP connection to the host  has failed.

    Hello. I hope you had a happy new year! Now its back to work.
    I am having a problem connecting to a remote SQL Server DB. I am using NetBeans 5.5 and the latest J2EE. I am able to see the tables in the IDE and bind objects to data. But when I run it it gets this:
    java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: no further information
    at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:100)
    at com.sun.sql.rowset.internal.CachedRowSetXReader.connect(CachedRowSetXReader.java:344)
    at com.sun.sql.rowset.internal.CachedRowSetXReader.readData(CachedRowSetXReader.java:126)
    at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:968)
    at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:1428)
    I checked the SQL Server Configuration manager on that machine and TCP/IP connections are allowed. What else could be wrong?
    Thank You.

    "Connection refused" means that the client sends a packet saying "I would like to connect to port number NNNN please" to the server computer, and the server computer's OS sends the reply "there is no process listening to that port on the network interface you are using".
    The database server is not running, or running but not listening to TCP/IP connections, or at a different port from what you think, or listening to only selected network interfaces (it is possible for a process to listen to a specific interface or a wildcard for all interfaces). A less likely scenario is that a firewall is sending the "connection refused" message.
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port. You need to configure the database to accept TCP connections; the server documentation or google should explain how.
    - Try "telnet server-host-name the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try telnet with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • Error in allocating a connection + JPA

    Hello Experts,
    I am trying my first ever JPA Program.I am using netbeans 6.0.In netbeans there is a sample application for WebJPA.In that they are calling entity from servlet.I just made a different project.I have copied all files in my project.At the time of creating persistence unit I have used DB2.But now when I am compiling my project I am getting the following errors.Seems there is some problem with connection to DB2.I have also added the correct jar files during creation of persistence unit.Please help me.Many Thanx in advance.
    *Deploying application in domain failed; Deployment Errorjava.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Failure in loading T2 native library db2jcct2, reason: java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path --*
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Failure in loading T2 native library db2jcct2, reason: java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path
    Error Code: 0
    Deployment error:
    The module has not been deployed.
    See the server log for details.
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
    at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor1068.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
    Caused by: The module has not been deployed.
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:157)

    Hi garava,
    Thanks for the reply.I had followed the same path while creating Persistence Unit.I googled this error & I found a solution where I need to set the NativeLibraryPathPrefix in my JVM.
    For this I went to Servers->Glassfish V2 -> JVM-> .There I set NativeLibraryPathPrefix = D:\Program Files\IBM\SQLLIB\BIN.
    It's working now.But I can't understand what was the problem & how it got solved.
    One more issue ,suppose tom I am facing the same problem for some other XYZ database.Do I need to change this path again for that database.What this path exactly means.I read it looks for "db2jcc2.dll" in this path.What is the need of this dll if I am including jar files during creation of persistence Unit.
    Please help.Thanks in advance.

  • Regarding Internal Exception: java.sql.SQLException

    While deploying the application we are encounter a following error,
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: FATAL: sorry, too many clients already
    Error Code: 0
    Deployment error:
    Please give me a suggession for this error.
    Thanks,

    While deploying the application we are encounter a following error,
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: FATAL: sorry, too many clients already
    Error Code: 0
    Deployment error:
    Please give me a suggession for this error.
    Thanks,

  • CTS1.4.1 Samples JDBC test failing with Error in allocating a connection

    Tests under CTS1.4.1 samples>>JDBC>>ee>>testConn>> are failing with the following error :
    Sep 14, 2005 4:27:55 PM com.sun.gjc.spi.DSManagedConnectionFactory createManagedConnection
    WARNING: RAR5113 : Error creating connection from supplied information: Reason - Error while parsing address
    Sep 14, 2005 4:27:55 PM com.sun.enterprise.resource.LocalTxConnectorAllocator createResource
    WARNING: RAR5038:Unexpected exception while creating resource
    Sep 14, 2005 4:27:55 PM com.sun.enterprise.connectors.ConnectionManagerImpl internalGetConnection
    WARNING: RAR5117 : Failed to obtain/create connection. Reason : Connection could not be allocated because: Error while parsing address
    Sep 14, 2005 4:27:55 PM com.sun.gjc.spi.DataSource getConnection
    WARNING: RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: Error while parsing address ]
    ERROR: SQL Exception : Error in allocating a connection. Cause: Connection could not be allocated because: Error while parsing address
    ERROR: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Error while parsing address
    at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:72)
    at com.sun.ts.tests.samples.jdbc.ee.testConn.testConnClient.getConnection(testConnClient.java:252)
    at com.sun.ts.tests.samples.jdbc.ee.testConn.testConnClient.setup(testConnClient.java:91)
    But the mystery is that the main set of JDBC tests (outside of samples) in CTS1.4.1 are running fine.
    One difference I notice is that the tests that are failing use "createManagedConnection".
    The main configurations file "ts.jte" present under %TS_HOME%\bin has all the settings correct. Thats why the main JDBC tests go through fine.
    I wonder where these failing tests pick up the bad "address" from.
    Any help on this would be greatly appreciated.
    Thanks !

    CTS is a paid product and any question regarding that should be answered by a Licencee Engineer. Pls contact the LE regard the setup of CTS or any TCK.

Maybe you are looking for