Jboss ConnectionPool problem

Hi,
I have now used a fair amount of time debugging, but am not able to find out what causes this problem. I am getting the old "No managed connection available within blocking timeout" error. The thing is that I have set up minimum of 5 and maximum of 30 connections in oracle-ds.xml. I am using oracle. When I check in TOAD(app. development environment for oracle) it shows that almost all of my connections' state is inactive. I was thinking this would mean that I do not close a connection somewhere. I have now gone through all SQLs that have inactive state and I it seems like I am closing all of them. ALso tried to
<track-statements>true</track-statements>     in that xml. It reports all result sets that have not been closed. However, I found one place where I try to close connection before preparedstatement. I have changed that but still getting the same error after a while.
Checking in jmx-console did not help. The thing is that I do not know what configuration parameter I am looking for. Mostly the Mbean ( ManagedConnectionPool) has the parameters from oracle-ds.xml.
Any tips would be appreciated.
Thanks in advance.
-C

anyone?

Similar Messages

  • ConnectionPooling problem...

    Hello,
    I am having a problem with my database driver. The thing is that the class is compiling correctly, but only when I execute the createPool() function from one of my JSP's, do I get the following 500 Servlet Exception (the ConnectionPool class follows the error):
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:120)
         at ConnectionPool.createPool(ConnectionPool.java:165)
         at jsp.www__isbops__com._80_0._index__jsp._jspService(//inc1.jsp:14)
         at com.caucho.jsp.JavaPage.service(JavaPage.java:89)
         at com.caucho.jsp.JavaPage.subservice(JavaPage.java:83)
         at com.caucho.jsp.Page.service(Page.java:409)
         at com.caucho.server.http.Invocation.service(Invocation.java:266)
         at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:349)
         at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:265)
         at com.caucho.server.TcpConnection.run(TcpConnection.java:142)
         at java.lang.Thread.run(Thread.java:484)
    ConnectionPool.java:
    Here is the connection pool class, which compiles correctly, so I don't think it is a classpath problem. Though I do correctly point to the jar file that contains the driver, and I don't "import" the driver. I have no idea what's wrong:
    import java.sql.*;
    import java.util.*;
    public class ConnectionPool
      private String jdbcConnection = "<hidden for the java forum>";
      private String dbUsername = "<hidden>";
      private String dbPassword = "<hidden>";
      private String testTable = "testConnectionPool";
      private int initialConnections = 10;
      private int incrementalConnections = 5;
      private int maxConnections = 50;
      private Vector connections = null;
       public ConnectionPool() {}
      public int getInitialConnections()
        return initialConnections;
      public void setInitialConnections(int initialConnections)
        this.initialConnections = initialConnections;
      public int getIncrementalConnections()
        return incrementalConnections;
      public void setIncrementalConnections(
        int incrementalConnections)
        this.incrementalConnections = incrementalConnections;
      public int getMaxConnections()
        return maxConnections;
      public void setMaxConnections(int maxConnections)
        this.maxConnections = maxConnections;
      public String getTestTable()
        return testTable;
      public void setTestTable(String testTable)
        this.testTable = testTable;
      public synchronized void createPool() throws Exception
        if (connections != null)
          return;
        Class.forName("org.gjt.mm.mysql.Driver").newInstance();
        connections = new Vector();
        createConnections(initialConnections);
      public boolean isPooled() throws Exception {
        if(connections == null) {
          return false;
        return true;
      private void createConnections(int numConnections) throws
        SQLException
        for (int x=0; x < numConnections; x++)
          if (maxConnections > 0 &&
            connections.size() >= maxConnections)
            break;
          //add a new PooledConnection object to connections vector
          connections.addElement(new PooledConnection(
            newConnection()));
          System.out.println("Database connection created...");
      private Connection newConnection() throws SQLException
        //create a new database connection
        Connection conn = DriverManager.getConnection(jdbcConnection,
          dbUsername, dbPassword);
        if (connections.size() == 0)
          DatabaseMetaData metaData = conn.getMetaData();
          int driverMaxConnections = metaData.getMaxConnections();
          if (driverMaxConnections > 0 &&
            maxConnections > driverMaxConnections)
            maxConnections = driverMaxConnections;
        return conn;
      public synchronized Connection getConnection() throws
        SQLException
        if (connections == null)
          return null;
        Connection conn = getFreeConnection();
        while (conn == null)
          wait(250);
          conn = getFreeConnection();
        return conn;
      private Connection getFreeConnection() throws SQLException
        Connection conn = findFreeConnection();
        if (conn == null)
          createConnections(incrementalConnections);
          conn = findFreeConnection();
          if (conn == null)
            return null;
        return conn;
      private Connection findFreeConnection() throws SQLException
        Connection conn = null;
        PooledConnection pConn = null;
        Enumeration enum = connections.elements();
        while (enum.hasMoreElements())
          pConn = (PooledConnection)enum.nextElement();
          if (!pConn.isBusy())
            conn = pConn.getConnection();
            pConn.setBusy(true); //set connection to busy
            if (!testConnection(conn))
              conn = newConnection();
              pConn.setConnection(conn);
            break;
        return conn;
      private boolean testConnection(Connection conn)
        try
          if (testTable.equals(""))
            conn.setAutoCommit(true);
          else
            Statement stmt = conn.createStatement();
            stmt.execute("select count(*) from " + testTable);
        catch (SQLException e)
          //connection is no longer valid, attempt to close it
          closeConnection(conn);
          return false;
        return true;
      public void returnConnection(Connection conn)
        if (connections == null)
          return;
        PooledConnection pConn = null;
        Enumeration enum = connections.elements();
        while (enum.hasMoreElements())
          pConn = (PooledConnection)enum.nextElement();
          if (conn == pConn.getConnection())
            pConn.setBusy(false);
            break;
      public synchronized void refreshConnections() throws
        SQLException
        if (connections == null)
          return;
        PooledConnection pConn = null;
        Enumeration enum = connections.elements();
        while (enum.hasMoreElements())
          pConn = (PooledConnection)enum.nextElement();
          if (!pConn.isBusy())
            wait(10000); //wait 5 seconds
          closeConnection(pConn.getConnection());
          pConn.setConnection(newConnection());
          pConn.setBusy(false);
      public synchronized void closeConnections() throws SQLException
        if (connections == null)
          return;
        PooledConnection pConn = null;
        Enumeration enum = connections.elements();
        while (enum.hasMoreElements())
          pConn = (PooledConnection)enum.nextElement();
          if (!pConn.isBusy())
            wait(5000);
          closeConnection(pConn.getConnection());
          connections.removeElement(pConn);
        connections = null;
      private void closeConnection(Connection conn)
        try
          conn.close();
        catch (SQLException e)
      private void wait(int mSeconds)
        try
          Thread.sleep(mSeconds);
        catch (InterruptedException e)
      class PooledConnection
        Connection connection = null;
        boolean busy = false;
        public PooledConnection(Connection connection)
          this.connection = connection;
        public Connection getConnection()
          return connection;
        public void setConnection(Connection connection)
          this.connection = connection;
        public boolean isBusy()
          return busy;
        public void setBusy(boolean busy)
          this.busy = busy;
    }

    Hi,
    The problem lies in the classpath. You should set the classpath of the webserver so as include the the jar file of the driver class which you are using.
    If you still have any doubt, you can unzip all the classes that are present in the jar file to the directory where you place servlet class files.
    Bye.

  • Mysql, Jboss connecting problem

    Hello,
    I am having problem with mysql database. I am trying to run AccountEJB application from SUN with mysql as my backend.
    PLEASE DO NOT FORGET I AM NOT EXPERT IN JBOSS OR EJB BUT I AM TRYING TO LEAN WITH A EXAMPLE.
    HERE IS MY SETUP UP TO THIS POINT.
    I am running jboss-3.03.0_tomcat-4.0.3
    I am including
    1. AccountBean
    2. ejb-jar.xml
    3. web.xml
    4. jboss.xml
    6. mysql-service.xml ( I add my database name, username, password and i copy it to ..server/default/deploy dir.)
    I only modified mysql-service.xml. Do i have to modify any other jboss files. Some people are saying i have to modify "standardjaws.xml, standardjbosscmp.xml"
    My AccountBean code is
    Please take a look at "setEntityContext" and "makeConnection" that is where problem comes.
    Here is the error
    10:43:19,950 INFO [Engine] AccountServlet: init
    10:43:19,950 INFO [STDOUT] AccountServlet: init()
    10:43:20,101 INFO [STDOUT] Got context
    10:43:20,311 INFO [STDOUT] Got referance
    10:43:20,371 INFO [STDOUT] Got referance to home object
    10:43:20,501 INFO [STDOUT] setEntityContext call....
    10:43:20,501 INFO [STDOUT] makeConnection call...
    10:43:20,501 INFO [STDOUT] Something went wrong within makeConnction call ....
    javax.naming.NameNotFoundException: MySqlDS not bound
    10:43:20,501 INFO [STDOUT] Came back from makeConnction call ...
    10:43:20,501 INFO [STDOUT] ejbCreate call
    10:43:20,501 INFO [STDOUT] insertRow call...
    10:43:20,511 ERROR [STDERR] Caught an exception.
    10:43:20,511 ERROR [STDERR] java.rmi.ServerException: ejbCreate: null; nested ex
    ception is:
    javax.ejb.EJBException: ejbCreate: null
    package com.ps.impl;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import java.sql.*;
    import javax.sql.*;
    import javax.ejb.*;
    import javax.naming.*;
    import java.util.*;
    import java.rmi.*;
    public class AccountBean implements EntityBean
    private EntityContext context;
    private String id;
    private String firstName;
    private String lastName;
    private double balance;
    private Connection con;
    //private String dbName = "java:/MySqlDS";
    public void debit (double amount)
    if (balance - amount < 0)
    else
    balance = balance - amount;
    public void credit (double amount)
    balance = balance + amount;
    public String getFirstName()
    return firstName;
    public String getLastName()
    return lastName;
    public double getBalance()
    return balance;
    public String ejbCreate(String id, String firstName, String lastName, double balance)
    throws CreateException
    System.out.println("ejbCreate call");
    if (balance < 0.00) {
    throw new CreateException
    ("A negative initial balance is not allowed.");
    try {
    insertRow(id, firstName, lastName, balance);
    } catch (Exception ex) {
    throw new EJBException("ejbCreate: " +
    ex.getMessage());
    this.id = id;
    this.firstName = firstName;
    this.lastName = lastName;
    this.balance = balance;
    return id;
    public void ejbPostCreate(String id, String firstname, String lastname, double blance)
    public String ejbFindByPrimaryKey(String primaryKey)
    throws FinderException
    System.out.println("ejbFindPrimaryKey call...");
    boolean result;
    try {
    result = selectByPrimaryKey(primaryKey);
    } catch (Exception ex) {
    throw new EJBException("ejbFindByPrimaryKey: " +
    ex.getMessage());
    if (result) {
    return primaryKey;
    else {
    throw new ObjectNotFoundException
    ("Row for id " + primaryKey + " not found.");
    public Collection ejbFindByLastName(String lastName)
    throws FinderException
    System.out.println("ejbFindByLastName call...");
    Collection result;
    try {
    result = selectByLastName(lastName);
    } catch (Exception ex) {
    throw new EJBException("ejbFindByLastName " +
    ex.getMessage());
    if (result.isEmpty()) {
    throw new ObjectNotFoundException("No rows found.");
    else {
    return result;
    public Collection ejbFindInRange(double low, double high)
    throws FinderException
    System.out.println("ejbFindRange call ....");
    Collection result;
    try {
    result = selectInRange(low, high);
    } catch (Exception ex) {
    throw new EJBException("ejbFindInRange: " +
    ex.getMessage());
    if (result.isEmpty()) {
    throw new ObjectNotFoundException("No rows found.");
    else {
    return result;
    public void ejbActivate()
    System.out.println("ejbActivate call ...");
    id = (String)context.getPrimaryKey();
    public void ejbLoad()
    System.out.println("ejbLoad call ...");
    try {
    loadRow();
    } catch (Exception ex) {
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
    public void ejbPassivate()
    id = null;
    public void ejbRemove()
    System.out.println("ebjRemove call ...");
    try {
    deleteRow(id);
    } catch (Exception ex) {
    throw new EJBException("ejbRemove: " +
    ex.getMessage());
    public void ejbStore()
    System.out.println("ejbStore call ...");
    try {
    storeRow();
    } catch (Exception ex) {
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
    public void setEntityContext(EntityContext context)
    this.context = context;
    System.out.println("setEntityContext call....");
    try {
    makeConnection();
    System.out.println("Came back from makeConnction call ...");
    } catch (Exception ex) {
    throw new EJBException("Unable to connect to database " +
    ex.getMessage());
    public void unsetEntityContext()
    System.out.println("unsetEntityContext call ...");
    try {
    con.close();
    } catch (SQLException ex) {
    throw new EJBException("unsetEntityContext: " + ex.getMessage());
    /*********************** Database Routines *************************/
    private void makeConnection() throws NamingException, SQLException
    System.out.println("makeConnection call...");
    try
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("java:/MySqlDS");
    con = ds.getConnection();
    catch (Exception ex)
    System.out.println("Something went wrong within makeConnction call .... " + ex);
    private void insertRow (String id, String firstName, String lastName,
    double balance) throws SQLException {
    System.out.println("insertRow call...");
    String insertStatement =
    "insert into account values ( ? , ? , ? , ? )";
    PreparedStatement prepStmt =
    con.prepareStatement(insertStatement);
    prepStmt.setString(1, id);
    prepStmt.setString(2, firstName);
    prepStmt.setString(3, lastName);
    prepStmt.setDouble(4, balance);
    prepStmt.executeUpdate();
    prepStmt.close();
    private void deleteRow(String id) throws SQLException {
    System.out.println("deleteRow call ...");
    String deleteStatement =
    "delete from account where id = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(deleteStatement);
    prepStmt.setString(1, id);
    prepStmt.executeUpdate();
    prepStmt.close();
    private boolean selectByPrimaryKey(String primaryKey)
    throws SQLException {
    System.out.println("selectByPrimaryKey call...");
    String selectStatement =
    "select id " +
    "from account where id = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setString(1, primaryKey);
    ResultSet rs = prepStmt.executeQuery();
    boolean result = rs.next();
    prepStmt.close();
    return result;
    private Collection selectByLastName(String lastName)
    throws SQLException {
    System.out.println("selectByLastName call...");
    String selectStatement =
    "select id " +
    "from account where lastname = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setString(1, lastName);
    ResultSet rs = prepStmt.executeQuery();
    ArrayList a = new ArrayList();
    while (rs.next()) {
    String id = rs.getString(1);
    a.add(id);
    prepStmt.close();
    return a;
    private Collection selectInRange(double low, double high)
    throws SQLException {
    System.out.println("selectInRange call ....");
    String selectStatement =
    "select id from account " +
    "where balance between ? and ?";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setDouble(1, low);
    prepStmt.setDouble(2, high);
    ResultSet rs = prepStmt.executeQuery();
    ArrayList a = new ArrayList();
    while (rs.next()) {
    String id = rs.getString(1);
    a.add(id);
    prepStmt.close();
    return a;
    private void loadRow() throws SQLException {
    System.out.println("loadRow call ....");
    String selectStatement =
    "select firstname, lastname, balance " +
    "from account where id = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setString(1, this.id);
    ResultSet rs = prepStmt.executeQuery();
    if (rs.next()) {
    this.firstName = rs.getString(1);
    this.lastName = rs.getString(2);
    this.balance = rs.getDouble(3);
    prepStmt.close();
    else {
    prepStmt.close();
    throw new NoSuchEntityException("Row for id " + id +
    " not found in database.");
    private void storeRow() throws SQLException {
    System.out.println("storeRow call ...");
    String updateStatement =
    "update account set firstname = ? ," +
    "lastname = ? , balance = ? " +
    "where id = ?";
    PreparedStatement prepStmt =
    con.prepareStatement(updateStatement);
    prepStmt.setString(1, firstName);
    prepStmt.setString(2, lastName);
    prepStmt.setDouble(3, balance);
    prepStmt.setString(4, id);
    int rowCount = prepStmt.executeUpdate();
    prepStmt.close();
    if (rowCount == 0) {
    throw new EJBException("Storing row for id " + id + " failed.");
    2. ejb-jar.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <description>Entity Bean ( BMP )</description>
    <display-name>Account</display-name>
    <ejb-name>Account</ejb-name>
    <home>com.ps.AccountHome</home>
    <remote>com.ps.Account</remote>
    <ejb-class>com.ps.impl.AccountBean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    </entity>
    </enterprise-beans>
    </ejb-jar>
    3. web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <servlet>
    <servlet-name>AccountServlet</servlet-name>
    <servlet-class>com.ps.AccountServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>AccountServlet</servlet-name>
    <url-pattern>/accountservlet</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    4. jboss.xml (i am not sure this is righ maybe this is the problem)
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
    <jboss>
    <resource-managers>
    <resource-manager res-class="">
    <res-name>MySqlDS</res-name>
    <res-jndi-name>java:/MySqlDS</res-jndi-name>
    </resource-manager>
    </resource-managers>
    </jboss>
    5. mysql-service.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- ===================================================================== -->
    <!-- -->
    <!-- JBoss Server Configuration -->
    <!-- -->
    <!-- ===================================================================== -->
    <server>
    <!-- ==================================================================== -->
    <!-- New ConnectionManager setup for mysql using 2.0.11 driver -->
    <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
    <!-- ==================================================================== -->
    <mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=MySqlDS">
    <!-- Include a login module configuration named MySqlDbRealm.
    Update your login-conf.xml, here is an example for a
    ConfiguredIdentityLoginModule:
    <application-policy name = "MySqlDbRealm">
    <authentication>
    <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
    <module-option name = "principal">yourprincipal</module-option>
    <module-option name = "userName">yourusername</module-option>
    <module-option name = "password">yourpassword</module-option>
    <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
    </login-module>
    </authentication>
    </application-policy>
    NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
    module-option name = "managedConnectionFactoryName"
    must match the object name of the ConnectionManager you are configuring here.
    -->
    <!--uncomment out this line if you are using the MySqlDbRealm above
    <attribute name="SecurityDomainJndiName">MySqlDbRealm</attribute>
    -->
    <depends optional-attribute-name="ManagedConnectionFactoryName">
    <!--embedded mbean-->
    <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=MySqlDS">
    <attribute name="JndiName">MySqlDS</attribute>
    <attribute name="ManagedConnectionFactoryProperties">
    <properties>
    <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/pac</config-property>
    <config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property>
    <!--set these only if you want only default logins, not through JAAS -->
    <config-property name="UserName" type="java.lang.String">t100</config-property>
    <config-property name="Password" type="java.lang.String">t200</config-property>
    </properties>
    </attribute>
    <!--Below here are advanced properties -->
    <!--hack-->
    <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper</depends>
    </mbean>
    </depends>
    <depends optional-attribute-name="ManagedConnectionPool">
    <!--embedded mbean-->
    <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=MySqlDS">
    <attribute name="MinSize">0</attribute>
    <attribute name="MaxSize">50</attribute>
    <attribute name="BlockingTimeoutMillis">5000</attribute>
    <attribute name="IdleTimeoutMinutes">15</attribute>
    <!--criteria indicates if Subject (from security domain) or app supplied
    parameters (such as from getConnection(user, pw)) are used to distinguish
    connections in the pool. Choices are
    ByContainerAndApplication (use both),
    ByContainer (use Subject),
    ByApplication (use app supplied params only),
    ByNothing (all connections are equivalent, usually if adapter supports
    reauthentication)-->
    <attribute name="Criteria">ByContainer</attribute>
    </mbean>
    </depends>
    <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
    <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager</depends>
    <attribute name="TransactionManager">java:/TransactionManager</attribute>
    <!--make the rar deploy! hack till better deployment-->
    <depends>jboss.jca:service=RARDeployer</depends>
    </mbean>
    </server>

    In /JBoss/server/default/conf/standardjaws.xml.
    Set
    <datasource>java:/mySqlDS</datasource>
    <type-mapping>mySql</type-mapping>
    In /JBoss/server/default/conf/standardjbosscmp-jdbc.xml.
    Set
    <defaults>
    <datasource>java:/mySqlDS</datasource>
    <datasource-mapping>mySql</datasource-mapping></defaults>

  • JBoss install problem - nothing is installed

    Hello,
    I have installed aur/jboss package
    aur/jboss 5.1.0.GA-1 [installed] (53)
    JBoss Application Server
    But there is no /opt/jboss directory, no service added, nothing. When I try to uninstall it, it says:
    Packages (1): jboss-5.1.0.GA-1
    Total Removed Size: 0,00 MiB
    zip file with jboss is installed correctly, all additional files (build, service..) are too.
    What is the problem with this process ?

    Moving to AUR Issues...

  • JBoss Log4J problem

    Hi all,
    Although Log4J is not exactly about Java, but it is kind of related, so please don't mind me posting this message.
    I am having problems stoping JBoss from reloading the log4j.properties file. Is there anyway to stop it from polling the log4j.properties file every now and then..
    Thx for your help
    Kevin

    Look at ${JBOSS_HOME}/server/default/jboss-service.xml. It has a section with the following code:
       <mbean code="org.jboss.logging.Log4jService"
          name="jboss.system:type=Log4jService,service=Logging">
          <attribute name="ConfigurationURL">resource:log4j.xml</attribute>
          <attribute name="Log4jQuietMode">true</attribute>
          <!-- How frequently in seconds the ConfigurationURL is checked for changes -->
          <attribute name="RefreshPeriod">60</attribute>
       </mbean>You could try setting the refresh periode to 0, but I don't know to what kind of behaviour that will result in.

  • JBoss authentication problem

    Hi all
    i am using jboss - UsernamepasswordLoginModule for username and password authentication. I want to know the way to restrict users after 3 bad logins.
    if user uses wrong password for three times successively then something should happen like he should not be able to login for next 30 minutes.
    It can be done in weblogic, but how to do it in jboss?
    thanx in advance.

    thanx but its not specified thereDid you read this part?:
    How do I configure security with JBoss ?
    JBoss uses JAAS for security. JBoss includes several JAAS login modules allowing applications to get their user info from LDAP servers, databases or property files (the last to simplify testing). There are also login modules for clients, so that they can send security information to the JBoss server. Note that an application that logs into JBoss must use JAAS to give user name and password. It is not possible to use the JNDI lookup information for that in JBoss. How to configure this is shown in chapter 8 of the free getting started guide.
    Did you check the "getting started guide"?
    Did you familiarize yourself with JAAS?
    Did you implement/configure a login module?
    Did you have a specific problem with the login module (errors, etc.)?
    Did you post this question at the JBoss Forum?
    Did you get an answer?
    Did you try anything at all about which you can post the details?
    Are you getting my point?

  • Jboss - Applet problem

    I am connecting to JBoss application server from a signed applet,
    my code is like this
    Hashtable env = new Hashtable();
                   env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" ) ;               
                   env.put("java.naming.provider.url", "SERVER_NAME") ;
                   env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" ) ;
                   env.put("java.naming.security.principal", CBGlobals.USER_NAME);
                   env.put("java.naming.security.credentials", CBGlobals.PASSWORD);
                   Context ic = new InitialContext (env);
    now it gives me an error message
    java.lang.ExceptionInInitializerError
         at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:42)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at ChrBrowser.ChrBrowser.connectToServer(ChrBrowser.java:609)
         at ChrBrowser.ChrBrowser.<init>(ChrBrowser.java:127)
         at ChrBrowser.CBMain.init(CBMain.java:111)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Any hits or help will be cordially appreciated
    Renjith.

    thanks,
    I used the same link
    the problem occured becase i didnt sign jbossclient.jar with the same key with which other required jar files are signed

  • Jboss deploiment problem

    I have try to deploy my ADF application project to Jboss application server 4.2.2 and 5.0.1 and I have the same problem, when i add jboss in jdevelopper and i want to deploy my
    project to jboss this message will appear :
    Presentation not available: JSR-88, Interface: javax.enterprise.deploy.spi.DeploymentManager
    someone can help me!!!!.

    Hi!
    I have the same problem, when I try to deploy to Tomcat. Does any one have a solution to this problem, or a work around for deploying an application to a tomcat server.
    Br
    Casper

  • Jboss starting problem

    E:\jboss\jboss-4.0.5.GA\bin>run -c spend
    ===============================================================================
    JBoss Bootstrap Environment
    JBOSS_HOME: E:\jboss\jboss-4.0.5.GA\bin\\..
    JAVA: C:\Program Files\java\jsdk1.4\bin\java
    JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.g
    cInterval=3600000
    CLASSPATH: C:\Program Files\java\jsdk1.4\lib\tools.jar;E:\jboss\jboss-4.0.5.GA\bin\\run.jar;E:\jboss\jboss-4.0.5.GA\server\
    spend\deploy;E:\jboss\jboss-4.0.5.GA\server\spend\conf;E:\jboss\jboss-4.0.5.GA\server\spend\conf\config;
    ===============================================================================
    log4j:ERROR Could not instantiate class [org.apache.log4j.xml.DOMConfigurator].
    java.lang.ClassNotFoundException: org.apache.log4j.xml.DOMConfigurator
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at org.apache.log4j.helpers.Loader.loadClass(Loader.java:160)
    at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:309)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:449)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
    at org.jboss.logging.Log4jLoggerPlugin.init(Log4jLoggerPlugin.java:77)
    at org.jboss.logging.Logger.getDelegatePlugin(Logger.java:338)
    at org.jboss.logging.Logger.<init>(Logger.java:96)
    at org.jboss.logging.Logger.getLogger(Logger.java:309)
    at org.jboss.system.server.ServerImpl.doInit(ServerImpl.java:166)
    at org.jboss.system.server.ServerImpl.init(ServerImpl.java:147)
    at org.jboss.Main.boot(Main.java:197)
    at org.jboss.Main$1.run(Main.java:490)
    at java.lang.Thread.run(Thread.java:536)
    log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
    log4j:WARN No appenders could be found for logger (org.jboss.system.server.Server).
    log4j:WARN Please initialize the log4j system properly.
    please can any body tell me how to solve this problem

    Problems like this don't cease to amaze me.
    We are in the year of 2009 and this problem is most probably caused because jboss is started from a path which contains one or more space.
    Try move your jboss installation or eclipse installation (i am not familiar how jboss in installed inside eclipse) to a folder with no spaces and the problem should go away.
    It is sad that nice software like jboss has stupid bugs like this. Oh and it migh not be jboss but the JVM. It is silly in any case...

  • JMS - MDB, jboss deployment problem

    Hi everybody,
    I'm new to JMS/MDB and have following problem while deploying MDB under JBOSS:
    22:58:47,735 INFO [EjbModule] Deploying MyPublisher
    22:58:47,745 INFO [EjbModule] Deploying topicMessageBean
    22:58:47,795 WARN [StatelessSessionContainer] message-destination 'PhysicalTopic' has no jndi-name in jboss.xml
    22:58:47,845 INFO [ProxyFactory] Bound EJB Home 'MyPublisher' to jndi 'ejb/MyEj
    bReference'
    22:58:47,865 INFO [EJBDeployer] Deployed: file:/D:/DownLoads/ejb/JBoss/jboss-4.
    0.3/jboss-4.0.3/server/default/deploy/simplemessage.jar
    jboss.xml
    <jboss>
    <enterprise-beans>
    <message-driven>
    <ejb-name>topicMessageBean</ejb-name>
    <destination-jndi-name>topic/MyMDBTopic</destination-jndi-name>
    <mdb-connection-factory>
    <jndi-name>jms/MyTopicConnectionFactory</jndi-name>
    </mdb-connection-factory>
    </message-driven>
    <message-destination>
    <message-destination-name>PhysicalTopic</message-destination-name>
    <jndi-name>topic/MyMDBTopic</jndi-name>
    </message-destination>
    <session>
    <ejb-name>MyPublisher</ejb-name>
    <jndi-name>ejb/MyEjbReference</jndi-name>
    <resource-ref>
    <res-ref-name>jms/MyTopicConnectionFactory</res-ref-name>
    <jndi-name>jms/TopicConnectionFactory</jndi-name>
    <default-resource-principal>
    <name>guest</name>
    <password>guest</password>
    </default-resource-principal>
    </resource-ref>
    </session>
    </enterprise-beans>
    </jboss>
    ejb-jar.xml
    <ejb-jar>
    <display-name>MessageJAR</display-name>
    <enterprise-beans>
    <message-driven>
    <display-name>Topic Message Bean</display-name>
    <ejb-name>topicMessageBean</ejb-name>
    <ejb-class>MessageBean</ejb-class>
    <messaging-type>javax.jms.MessageListener</messaging-type>
    <message-selector></message-selector>
    <transaction-type>Container</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    <message-destination-link>PhysicalTopic</message-destination-link>
    </message-driven-destination>
    <activation-config>
    <activation-config-property>
    <activation-config-property-name>messageSelector</activation-config-property-name>
    <activation-config-property-value>NewsType = 'Sports' OR NewsType = 'Opinion'</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
    <activation-config-property-name>subscriptionDurability</activation-config-property-name>
    <activation-config-property-value>NonDurable</activation-config-property-value>
    </activation-config-property>
    </activation-config>
    </message-driven>
    <session>
    <display-name>MyPublisher</display-name>
    <ejb-name>MyPublisher</ejb-name>
    <home>PublisherHome</home>
    <remote>Publisher</remote>
    <ejb-class>PublisherBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <res-ref-name>jms/MyTopicConnectionFactory</res-ref-name>
    <res-type>javax.jms.TopicConnectionFactory</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <message-destination-ref>
    <!--message-destination-ref-name>topic/TopicName</message-destination-ref-name-->
    <message-destination-ref-name>topic/MyMDBTopic</message-destination-ref-name>
    <message-destination-type>javax.jms.Topic</message-destination-type>
    <message-destination-usage>Produces</message-destination-usage>
    <message-destination-link>PhysicalTopic</message-destination-link>
    </message-destination-ref>
    <security-identity>
    <use-caller-identity/>
    </security-identity>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>topicMessageBean</ejb-name>
    <method-name>onMessage</method-name>
    <method-params>
    <method-param>javax.jms.Message</method-param>
    </method-params>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>MyPublisher</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>publishNews</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <message-destination>
    <message-destination-name>PhysicalTopic</message-destination-name>
    </message-destination>
    </assembly-descriptor>
    </ejb-jar>
    can somebody help???
    Zahid

    Hi,
    if possible, try with "max-bean-in-free-pool=1".
    note: it would be performance impact, as there would be single bean instance.
    Thanks,
    Qumar Hussain

  • ConnectionPool problem

    I have the following problem.
    I use ConnectionPool to access MySQL database. It uses static initializer to initialize connection. I'm tring to solve problem when the parameters for database are wrong, and the system can not access database.In that case the user should set new parameters, and the ConnectionPool should be initialized again, but when I start to access this ConnectionPool I always get an exceptlion "NoClassDefFound". Can anybody give me some suggestion how to solve this problem.
    Thanks.

    Show us the exact exception message. Also get a stack trace of the exception (e.printStackTrace()) and show us that too.

  • Java.lang.NullPointerException and ConnectionPool problem

    refresh page , problem gone
    java.lang.NullPointerException
    at Deferment.UpdatePostgraduate.getStatus(UpdatePostgraduate.java:278)
    at Deferment.UpdatePostgraduate.doPost(UpdatePostgraduate.java:175)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:402)
    at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    UpdatePostgraduate.java:278
    ->while (rs.next()) {
    175-> tarCount=getStatus(userid);
    now I have
    Connection conn = null;
    CallableStatement calstat=null;
    ResultSet rs = null;
    in every of my function
    and my
    public Connection getConnection()         throws SQLException, ServletException       {           Connection conn = null;           try{           pool.getConnection();           }catch (SQLException sqle) {             throw new ServletException(sqle.getMessage());         }           return conn;       }

    private DataSource pool = null; 
        int tarCount;
        int sendMail;
        @Override
        public void init() throws ServletException {
            Context env = null;
            try {
                env = (Context) new InitialContext().lookup("java:comp/env");
                pool = (DataSource) env.lookup("jdbc/test");
                if (pool == null) {
                    throw new ServletException(
                            "'jdbc/test' is an unknown DataSource");            }
            } catch (NamingException ne) {
                throw new ServletException(ne);
          public Connection getConnection()
            throws SQLException, ServletException
              Connection conn = null;
              try{
             conn=pool.getConnection();
              }catch (SQLException sqle) {
                System.out.println("JDBC error:" + sqle.getMessage());
                sqle.printStackTrace();
              return conn;
          }then on every function I call it like
    private int getFound(String UNumber) throws Exception {
            Connection conn = null;
            CallableStatement calstat=null;
            ResultSet rs = null;
            try {
                conn = pool.getConnection();
                calstat = (CallableStatement) conn.prepareCall("{call DuplicatePost(?)}");
                calstat.setString(1, UNumber);
                rs = calstat.executeQuery();
                tarCount = 0;
                while (rs.next()) {
                    tarCount++;
            } catch (SQLException se) {
                System.out.println("JDBC error:" + se.getMessage());
                se.printStackTrace();
            } catch (Exception e) {
                System.out.println("other error:" + e.getMessage());
                e.printStackTrace();
            } finally {
                try {
                    if (rs != null) {
                        rs.close();
                    if (calstat != null) {
                        calstat.close();
                } catch (SQLException e) {
                    e.printStackTrace();
            } //end finally
            return tarCount;
        }// end function
    }// end

  • JBoss ejb problem

    I created a ear file wich contains a jar and war file. The jar contains an entity and session bean. The war file contains my junitee test case.
    When I deploy the file I can surf to the url and my test goes fine. When I move the file from the deploy dir to someplace else (jboss starts undeploying) and move it back couple seconds later (jboss deploys again) I get this error while doing the same test again:
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293) ...........
    The error appears at the line where I try to narrow cast the object to my home interface.
    When I restard jboss , the test runs fine again.
    Anyone ideas ?

    When I move the file from the deploy dir to someplace else (jboss starts undeploying) and move it back couple seconds later (jboss deploys again)
    This feature is called hot redeploy, the deploy directory is a place where you keep the files you want to deploy on the server. Whenever there are any changes in this directory .. moving files etc, the JBoss redeploys the new files, or undeploys the files removed from that place.
    This is needed, because practically the servers are supposed to be up all the time, so if you need to make any updates etc, you could just paste the new files(or new versions) and they are redeployed.
    I get this error while doing the same test again
    When I restard jboss , the test runs fine again
    This is happening because your test case is typically looking at the old version of your beans. But then why are you moving the files ... testing ? or do u really need to do that ?
    If you are changing some implementation, just redploy the bean class and leave the interfaces like that. You should be fine
    Regards
    Meka Toka

  • JBoss Clustering problem

    I am not sure if this issue belongs to this forum. If not, please let me know and I will post it in the appropriate forum.
    My application has clustered remote SLSBs with "FirstAvaliable" policy.
    The BMP Entity Beans are set for cache invalidation as they exist at local level only. They is no clustering of entity beans.
    I am using Commit Option A.
    I want cache to invalidate bean on all nodes except the node it was accessed from.
    Here the cache is being cleared even on the node it was last accessed from.
    I executed a business method on the same node (due to FirstAvailable) and here is the list of methods encountered.
    setEntityContext
    ejbFindByPrimaryKey
    ejbActivate
    ejbLoad
    getAllAccounts
    ejbStore
    setEntityContext
    ejbActivate
    ejbLoad
    getAllAccounts
    ejbStore
    setEntityContext
    ejbActivate
    ejbLoad
    getAllAccounts
    ejbStore
    My expectation is that second and third time, in addition to my business method, only ejbLoad and ejbStore should be executed.
    After info from guides and forum topics, I have configured as under :
    cluster-service.xml
    ============
    I am using the default behaviour of JBoss-Cluster based bridge
    jboss.cache:service=InvalidationManager
    ${jboss.partition.name:DefaultPartition}
    DefaultJGBridge
    jboss:service=${jboss.partition.name:DefaultPartition}
    jboss.cache:service=InvalidationManager
    standardjboss.xml
    ============
    Container Configuration is defined as under : (Commit Option is A)
    <container-configuration>
    <container-name>Standard BMP 2.x EntityBean with cache invalidation</container-name>
    <call-logging>false</call-logging>
    <invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name>
    <sync-on-commit-only>true</sync-on-commit-only>
    <insert-after-ejb-post-create>false</insert-after-ejb-post-create>
    <container-interceptors>
    org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor
    org.jboss.ejb.plugins.LogInterceptor
    org.jboss.ejb.plugins.SecurityInterceptor
    org.jboss.ejb.plugins.TxInterceptorCMT
    org.jboss.ejb.plugins.EntityCreationInterceptor
    org.jboss.ejb.plugins.EntityLockInterceptor
    org.jboss.ejb.plugins.EntityInstanceInterceptor
    org.jboss.ejb.plugins.EntityReentranceInterceptor
    org.jboss.resource.connectionmanager.CachedConnectionInterceptor
    org.jboss.ejb.plugins.EntitySynchronizationInterceptor
    org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor
    org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor
    </container-interceptors>
    <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
    <instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</instance-cache>
    <persistence-manager>org.jboss.ejb.plugins.BMPPersistenceManager</persistence-manager>
    <locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
    <container-cache-conf>
    <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
    <cache-policy-conf>
    <min-capacity>50</min-capacity>
    <max-capacity>1000000</max-capacity>
    <overager-period>300</overager-period>
    <max-bean-age>600</max-bean-age>
    <resizer-period>400</resizer-period>
    <max-cache-miss-period>60</max-cache-miss-period>
    <min-cache-miss-period>1</min-cache-miss-period>
    <cache-load-factor>0.75</cache-load-factor>
    </cache-policy-conf>
    </container-cache-conf>
    <container-pool-conf>
    100
    </container-pool-conf>
    <commit-option>A</commit-option>
    </container-configuration>
    jboss.xml
    ======
    <?xml version="1.0"?>
    <security-domain>java:/jaas/defaultLdap</security-domain>
    <enterprise-beans>
    <ejb-name>ejb/ApplicationService</ejb-name>
    <security-domain>java:/jaas/defaultLdap</security-domain>
    <resource-ref>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
    <jndi-name>java:/jdbc/OracleDS</jndi-name>
    </resource-ref>
    True
    <cluster-config>
    <home-load-balance-policy>
    org.jboss.ha.framework.interfaces.FirstAvailable
    </home-load-balance-policy>
    <bean-load-balance-policy>
    org.jboss.ha.framework.interfaces.FirstAvailable
    </bean-load-balance-policy>
    </cluster-config>
    <ejb-name>ejb/ApplicationEntity</ejb-name>
    <security-domain>java:/jaas/defaultLdap</security-domain>
    <resource-ref>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
    <jndi-name>java:/jdbc/OracleDS</jndi-name>
    </resource-ref>
    <configuration-name>Standard BMP 2.x EntityBean with cache invalidation</configuration-name>
    <cache-invalidation>True</cache-invalidation>
    cache-invalidation.xml (No Change)
    ==============
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE server>
    <!-- $Id: cache-invalidation-service.xml,v 1.4 2003/08/27 04:31:54 patriot1burke Exp $ -->
    <!-- ===================================================================== -->
    <!-- -->
    <!-- Cache Invalidation Service -->
    <!-- -->
    <!-- ===================================================================== -->
    <!--
    Uncomment if you want to activate the cache invalidation mechanism accross
    nodes using the JMS bridge
    PropagationMode can be : IN_OUT = 1, IN_ONLY = 2, OUT_ONLY = 3
    You can also set the ProviderUrl attribute to another IP:port setting if you
    must lookup your JMS information in other JMS trees i.e.
    MyOtherNode:1099
    -->
    <!--
    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager
    jboss.cache:service=InvalidationManager
    jboss.mq.destination:service=Topic,name=JMSCacheInvalidationBridge
    jboss.cache:service=InvalidationManager
    java:/ConnectionFactory
    topic/JMSCacheInvalidationBridge
    1
    -->
    Thanks.

    hi ,
    In this scenario u can use the load balancer instead of fail over clustering .
    I would suggest u to create apache proxy for redirect the request for many jboss instance.
    Rgds
    kathir

  • ConnectionPool problems with WLS 7.0 and Oracle 9.2

    Hi,
    We are using WLS 7.0 SP4, and Oracle 9 and the Oracle thin driver type 4. In our
    application on the productive system (and only there) we constantly encounter
    a whole set of SQLExceptions which have all in common that the Connection from
    the pool is not valid any more when the application tries to use it.
    Typical, recurring error messages are:
    - Exhausted ResultSet
    - Connection has already been closed
    - Closed Statement
    - Transaction is no longer active - status committing
    - NullPointerException at
    weblogic.jdbc.pool.Connection.prepareStatement()
    There are no special Statements which create these errors. They are spread at
    random across practically every query the application creates, and the same queries
    sometimes succeed and sometimes fail.
    I double and triple checked that all Connections, Statements and ResultSets are
    closed immediately after use. As an example, I attached a code snippet and a resulting
    StackTrace which.
    The problem also seems to occur only with an (unknown) minimum of concurrent usern,
    since in the approval tests on an almost identical test system these errors never
    occurred.
    I also followed the advice from Oracle and installed the latest Oracle JDBC driver
    (Oracle 10g) - to no avail.
    What else can I do?
    Another question: Is it correct that my Oracle JDBC driver is in the application
    classpath (via a reference in the Manifest file of the application jar), not in
    the system classpath? There has never been a problem with that, but in a Newsgroup
    answer from Nov 10, 2003 (subject: "ResultSet closes prematurely"), Joe Weinstein
    suggested to "get it listed at the
    front of the -classpath argument that the startWebLogic script creates for the
    java line that starts the server".
    I hesitate to do so, since the driver is in a standard WebApp- directory, WEB-INF/lib.
    Is it possible and safe to add a jar located there to the system classpath? If
    it is possible, why is it necessary?
    Best regards,
    Andreas Zehrt
    [CodeSnippetsAndStackTraceForConnectionPoolProblem.txt]

    Andreas Zehrt wrote:
    Hi Joe,
    Your hint that there is a threading problem was right:
    On further investigation of the code I found out that the class that passes the
    Connection to the DAO not only stores it as a member at some point (which is not
    a good idea anyway) but is also a singleton - then, of course, it's no surprise
    that the Connection gets invalid in a incalculable way when concurrent threads
    share it.
    The singleton instantiation was not so obvious because the way of instantiation
    is controlled by a configuration parameter that can be overridden at different
    levels.
    I changed it and the productive logfiles indicate that the SQLExceptions related
    to that class have disappeared.I am happy to have helped.
    So, thanks a lot for the advice.
    But I am still wondering why this code has worked for so long a time with WLS
    5.1 and Oracle 8 (the system has been productive for over 2 years). Even in the
    approval tests with WLS 7.0 and Oracle 9, we did not run into problems, although
    it was multi-user environment.Mo idea.
    I still believe that there is a difference between WLS 5.1 and 7.0 in the way
    it treats pooled Oracle JDBC Connections. I wished both Oracle and Bea could be
    a little more explicit about those changes and possible version incompatabilities
    beyond the general advice "use the latest thin driver".Though I can think of no change to our pooling which would have had any material
    effect in this case, I will certainly do what I can to see that our documentation
    is explicit about changes.
    Joe
    Best regards, Andreas
    Joe Weinstein <[email protected]> wrote:
    Hi Andreas.
    Andreas Zehrt wrote:
    Hi,
    We are using WLS 7.0 SP4, and Oracle 9 and the Oracle thin driver type4. In our
    application on the productive system (and only there) we constantlyencounter
    a whole set of SQLExceptions which have all in common that the Connectionfrom
    the pool is not valid any more when the application tries to use it.
    Typical, recurring error messages are:
    - Exhausted ResultSetThat is typically if the statement that created it is either re-executed
    or closed.
    - Connection has already been closedAs described. If you give a stacktrace, we could make a debug patch which
    would show
    where it was originally closed.
    - Closed Statementsame as above.
    - Transaction is no longer active - status committingThat implies your code is obtaining a connection from a transactional
    datasource,
    and then later trying to use it after the transaction which it was associated
    with,
    is finished.
    - NullPointerException at
    weblogic.jdbc.pool.Connection.prepareStatement()Maybe any of the above.
    There are no special Statements which create these errors. They arespread at
    random across practically every query the application creates, andthe same queries
    sometimes succeed and sometimes fail.
    I double and triple checked that all Connections, Statements and ResultSetsare
    closed immediately after use. As an example, I attached a code snippetand a resulting
    StackTrace which.
    The problem also seems to occur only with an (unknown) minimum of concurrentusern,
    since in the approval tests on an almost identical test system theseerrors never
    occurred.
    I also followed the advice from Oracle and installed the latest OracleJDBC driver
    (Oracle 10g) - to no avail.
    What else can I do?
    Another question: Is it correct that my Oracle JDBC driver is in theapplication
    classpath (via a reference in the Manifest file of the applicationjar), not in
    the system classpath? There has never been a problem with that, butin a Newsgroup
    answer from Nov 10, 2003 (subject: "ResultSet closes prematurely"),Joe Weinstein
    suggested to "get it listed at the
    front of the -classpath argument that the startWebLogic script createsfor the
    java line that starts the server".
    I hesitate to do so, since the driver is in a standard WebApp- directory,WEB-INF/lib.
    Is it possible and safe to add a jar located there to the system classpath?If
    it is possible, why is it necessary?I was only concerned to ensure we know which driver we are working with.
    We also ship
    an oracle thin driver, which becomes obsolete soon...
    I am concerned that your code creates pool connections to be used later.
    The problems
    can arise if more than one thread ever gets the same connection, or if
    the connection
    is used in the same thread, spanning transactions. It does also seem
    that there may
    be a threading issue, because if two threads each call the code to create
    a connection,
    and two connections are made, but one over-writes the other, the two
    threads can
    end up using the same connection, and closing it. The over-written one
    never gets closed,
    resulting in that leak message you got...
    Joe
    The Connection parameter is opened by a business component class, ComaServiceProviderClassicImpl.It is propagated through
    several classes in the business layer, but not used, until the DAOtakes it to make the query.
    So, the Connection is closed where it was opened, not in the DAO class.
    public class ConcernDAOImpl extends BaseDAO {
         public Collection getConcernsForIncidents(Connection conn, Collectionincidents)
    throws DataAccessException, ConstraintException, ComaParseException{>
    sqlMessage.append(")");
    String sqlStmt = sqlMessage.toString();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try {
    pstmt = conn.prepareStatement(sqlStmt);
    rs = pstmt.executeQuery();
    while (rs != null && rs.next()) {
    final Concern concern =
    new Concern(DAOUtil.getComaOID(rs, ComaDBNames.KDANR));
    concern.setIncidentOID(DAOUtil.getComaOID(rs, ComaDBNames.KDAVGENR));
    return concerns;
    } catch (SQLException sqle) {
    // Wrapps real SQL exception
    String[] message = new String[]{sqle.getMessage(), sqlStmt};
    throw new DataAccessException(ExpCode.S_ORACLE_SQL, message,
    sqle);
    } finally {
    closeAll(rs, pstmt);
    _logger.exitDebug(method);
    Here, the Connection is acquired and finally closed
    public class ComaServiceProviderClassicImpl {
         public void updateComplaint(
    final Request updateRequest,
    final ResponseSingleElement response,
    final Principal principal)
    throws SystemException {
    try {
    logger.info("updateComplaint", "store incident");
    // store the incident in the database
    incidentManager.storeIncident(getConnection(), updateIncident);
    // reload the incident from Cache and / or the databaseto get the ContactReferences.
    Incident returnIncident = incidentManager.loadIncident(//IncidentManager passes the Connection to the DAO
    getConnection(), updateIncident.getOID());
    } catch (RemoteException rex) {
    // remote exceptions
    rollbackIfNecessary();
    CoreUtils.unwrapRemoteException(rex, logger);
    } catch (SystemException e) {
    // all other exceptions --> rollback if necessary and rethrow
    rollbackIfNecessary();
    throw e;
    } finally {
    removeConnection();
    logger.exitDebug("updateComplaint");
    This is the resulting StackTrace:
    sql exception: [Closed Statement: next] - sql statement: [select *
         at de.deutschepost.ubbrief.coma.persistence.dao.ConcernDAOImpl.getConcernsForIncidents(ConcernDAOImpl.java:363)
         at de.deutschepost.ubbrief.coma.persistence.dao.CachingConcernDAOImpl.getConcernsForIncidents(CachingConcernDAOImpl.java:129)
         at de.deutschepost.ubbrief.coma.persistence.incidentmanager.IncidentManagerImpl.loadConcernStructuresIntoIncidents(IncidentManagerImpl.java:1067)
         at de.deutschepost.ubbrief.coma.persistence.incidentmanager.IncidentManagerImpl.loadStructureForIncident(IncidentManagerImpl.java:320)
         at de.deutschepost.ubbrief.coma.persistence.incidentmanager.IncidentManagerImpl.loadIncidents(IncidentManagerImpl.java:264)
         at de.deutschepost.ubbrief.coma.persistence.taskmanager.TaskManagerImpl.selectTasksForUser(TaskManagerImpl.java:299)
         at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Impl.getTaskList(ComaServiceProviderZ2Impl.java:113)
         at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Bean_1dhrj7_EOImpl.getTaskList(ComaServiceProviderZ2Bean_1dhrj7_EOImpl.java:154)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList.runServiceMethod(CMPGetTaskList.java:64)
         at de.deutschepost.ubbrief.coma.sbbx.sp.BasicMethodProvider.execute(BasicMethodProvider.java:145)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl.execute(CMPGetTaskList_9b9mv5_EOImpl.java:46)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLSkel.invoke(UnknownSource)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:159)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:263)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLStub.execute(UnknownSource)
         at de.deutschepost.ubbrief.backbone.jazz.impl.core.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:115)
         at de.deutschepost.ubbrief.backbone.common.impl.core.rpc.server.ServerKernelImpl.handleTransportMessage(ServerKernelImpl.java:270)
         at de.deutschepost.ubbrief.backbone.common.impl.core.messaging.MessageTransport.handleMessage(MessageTransport.java:454)
         at de.deutschepost.ubbrief.backbone.common.impl.core.KernelFacade.handleMessage(KernelFacade.java:209)
         at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean.messageArrived(BackboneBean.java:637)
         at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean_ina9d7_ELOImpl.messageArrived(BackboneBean_ina9d7_ELOImpl.java:105)
         at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.LocalQueueReceiveBean.deliverMessage(LocalQueueReceiveBean.java:43)
         at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.AbstractMessageReceiveBean.onMessage(AbstractMessageReceiveBean.java:127)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:377)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:311)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:286)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2351)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2267)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    ####<May 26, 2004 12:18:43 PM CEST> <Warning> <JDBC> <S0048016> <REMA20Z><Finalizer> <kernel identity> <> <001074> <A JDBC pool connection leak
    was detected. A Connection leak occurs when a connection obtained from
    the pool was not closed explicitly by calling close() and then was disposed
    by the garbage collector and returned to the connection pool. The following
    stack trace at create shows where the leaked connection was created.
    Stack trace at connection create:
         at weblogic.jdbc.pool.Connection.<init>(Connection.java:66)
         at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:294)
         at weblogic.jdbc.pool.Driver.connect(Driver.java:210)
         at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:373)
         at weblogic.jdbc.jts.Driver.connect(Driver.java:129)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:287)
         at de.deutschepost.ubbrief.coma.core.ComaComponentImpl.getConnectionFromPool(ComaComponentImpl.java:163)
         at de.deutschepost.ubbrief.coma.core.ComaComponentImpl.getConnectionInternal(ComaComponentImpl.java:135)
         at de.deutschepost.ubbrief.coma.core.ComaComponentImpl.getConnection(ComaComponentImpl.java:99)
         at de.deutschepost.ubbrief.coma.persistence.customermanager.CurryCustomerManagerImpl.findCustomers(CurryCustomerManagerImpl.java:73)
         at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2BaseImpl.resolveCustomerInstances(ComaServiceProviderZ2BaseImpl.java:808)
         at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Impl.getTaskList(ComaServiceProviderZ2Impl.java:213)
         at de.deutschepost.ubbrief.coma.service.z2.ComaServiceProviderZ2Bean_1dhrj7_EOImpl.getTaskList(ComaServiceProviderZ2Bean_1dhrj7_EOImpl.java:154)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList.runServiceMethod(CMPGetTaskList.java:64)
         at de.deutschepost.ubbrief.coma.sbbx.sp.BasicMethodProvider.execute(BasicMethodProvider.java:145)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl.execute(CMPGetTaskList_9b9mv5_EOImpl.java:46)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLSkel.invoke(UnknownSource)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:159)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:263)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)
         at de.deutschepost.ubbrief.coma.sbba.z2.CMPGetTaskList_9b9mv5_EOImpl_WLStub.execute(UnknownSource)
         at de.deutschepost.ubbrief.backbone.jazz.impl.core.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:115)
         at de.deutschepost.ubbrief.backbone.common.impl.core.rpc.server.ServerKernelImpl.handleTransportMessage(ServerKernelImpl.java:270)
         at de.deutschepost.ubbrief.backbone.common.impl.core.messaging.MessageTransport.handleMessage(MessageTransport.java:454)
         at de.deutschepost.ubbrief.backbone.common.impl.core.KernelFacade.handleMessage(KernelFacade.java:209)
         at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean.messageArrived(BackboneBean.java:637)
         at de.deutschepost.ubbrief.backbone.jazz.impl.backbone.BackboneBean_ina9d7_ELOImpl.messageArrived(BackboneBean_ina9d7_ELOImpl.java:105)
         at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.LocalQueueReceiveBean.deliverMessage(LocalQueueReceiveBean.java:43)
         at de.deutschepost.ubbrief.backbone.jazz.impl.transport.receive.AbstractMessageReceiveBean.onMessage(AbstractMessageReceiveBean.java:127)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:377)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:311)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:286)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2351)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2267)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)

Maybe you are looking for

  • Problems with graphics card with Windows 8 bootcamp on new imac

    I just purchased a new 2013 imac (27inch, with the nvidia geforce gtx 680mx 2gb). I partitioned the drive using bootcamp and successfully installed windows 8 pro 64bit as well as the support softward from Apple for the drivers. My problem is that the

  • How to select the printer and select the ICC profile for printing with VBScript?

    I try to automate my printing procedure in photoshop. The problem is that I don't know how to select the printer and select the icc profile for printing with vbscript like I manually do in the print-menu in photoshop? Anyone has done this before? Tha

  • Warning  6226:

    Hi Chris We today find there were some errores in the ttmesg.log as below, it appears some application processes cannot connect to TT. 23:43:44.85 Info: : 11922: 28689/0x2abb803b3630: Disconnect /opt/TimesTen/tt1122/info/TT_1122 23:43:44.85 Info: : 1

  • IE 10 Will not update photo captions.

    Hi I have updated to IE 10 BUT when I view photos from a web site the photos change but the captions do not. It worked with IE 9 and works with Firefox and Torch but not IE 10 this is a bit annoying when I am trying to vote for my favourite photo. Al

  • IPhoto 2 Cropping Photo

    I used the help feature on how to crop a photo. I loaded a photo from DVD, selected edit and cropped it. But when I dragged the cropped photo to my desktop so I could upload it more quickly, the photo that shows on my desktop is the original photo, u