ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Flather" <AID9...@idpa.state.il.us>
Subject Re: Mapping the following SQLException, with ErrorCode -30,082 and SQLState 08001, to a StaleConnect
Date Tue, 04 Apr 2006 20:05:59 GMT
Thanks Jeff. I will let you know how it works. Are you still with CIBER?

Rob

>>> jeffgbutler@gmail.com 04/04/06 2:55 PM >>>
The problem is in your sqlmapconfig.xml file.  You specify JNDI as the
datasource, but set all the properties for SIMPLE datasource as well as JNDI
datasource.

If you mean to use JNDI, you only specify the DataSource property - all
other items (driver class, userid, password, etc.) need to be specified in
the WebSphere configuration.

If you mean to use SIMPLE datasource, then you don't need the DataSource
property.

Jeff Butler


On 4/4/06, Rob Flather <AID9F20@idpa.state.il.us> wrote:
>
>  Has anybody run into this problem?  I searched the archives, but couldn't
> find anything.  I am using java 1.4 on Websphere.   I am not using the
> properties file in the SqlMapConfig (I have actually tried it both ways, but
> neither seems to work), but I do use it in the SqlMapConfig.java class.  I
> am not getting any errors from iBatis reading the xml files, etc.  I'm not
> sure whether the error is the StaleConnectionException or the Password
> Missing, but the error code 30082 would seem to point to a missing
> password.  I have tested the user id and password, and they are correct.
> Any help would be appreciated!  Thanks in advance.
>
> Here is my AppDao.xml file
>
> <daoConfig>
>
>   <context>
>
> <transactionManager type="SQLMAP">
>  <property name="SqlMapConfigResource"
>         value="common/ibatis/SqlMapConfig.xml"/>
> </transactionManager>
>
>     <dao interface="common.dao.BusinessDAOInterface"
>       implementation="common.ibatis.dao.IbatisBusinessDAO"/>
>
>   </context>
>
> </daoConfig>
>
> *Here is my SqlMapConfig.xml transaction manager section:*
>
> <transactionManager type="JDBC">
>  <dataSource type="JNDI">
>   <property name="DataSource" value="jdbc/myDB" />
>   <property name="JDBC.Driver" value="COM.ibm.db2.jdbc.app.DB2Driver"/>
>   <property name="JDBC.ConnectionURL" value="jdbc:db2:myDB"/>
>   <property name="JDBC.Username" value="myuserid"/>
>   <property name="JDBC.Password" value="mypwd"/>
>  </dataSource>
> </transactionManager>
>
> *my SqlMapConfig.java static initializer and daoManager methods*
>
> static {
> Properties props = Resources.getResourceAsProperties
> ("US/common/resources/dbconfig.properties");
> daoManager = buildDaoManager(null);
> }
>
> public static DaoManager getDaoManager() {
>    return daoManager;
>  }
>  public static DaoManager buildDaoManager(Properties props) throws
> DaoException {
>    try {
>   Reader reader = Resources.getResourceAsReader(resource);
>   return DaoManagerBuilder.buildDaoManager(reader, props);
>    } catch (Exception e) {
>   throw new DaoException("Could not initialize DaoConfig.  Cause: " +
> e.getClass().getName() + " " +  e.getMessage());
>   }
> }
>
> *my DAOFactory method:*
>
> return (BusinessDAOInterface) IbatisSqlConfig.getDaoManager().getDao(
> common.dao.BusinessDAOInterface.class);
>
> *my BusinessDAO method:*
>
> try {
>     Integer busPk = new Integer(busOid);
>     return
> (Business)getSqlMapExecutor().queryForObject("getBusinessByOID", busPk);
> }
> catch (Exception e){
>  throw DAOException(e.getMessage());
> }
>
> *Here is the exception trace from the business method:*
>
> [4/4/06 13:35:52:391 CDT] 6cb95871 StaleConnecti A CONM7007I: Mapping the
> following SQLException, with ErrorCode -30,082 and SQLState 08001, to a
> StaleConnectionException: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver]
> SQL30082N  Attempt to establish connection failed with security reason "3"
> ("PASSWORD MISSING").  SQLSTATE=08001
>
>  at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown
> Source)
>  at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown
> Source)
>  at COM.ibm.db2.jdbc.app.DB2Connection.connect(Unknown Source)
>  at COM.ibm.db2.jdbc.app.DB2Connection.<init>(Unknown Source)
>  at COM.ibm.db2.jdbc.app.DB2ReusableConnection.<init>(Unknown Source)
>  at COM.ibm.db2.jdbc.DB2PooledConnection.getConnection(Unknown Source)
>  at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getConnection(
> WSRdbDataSource.java:695)
>  at
> com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection
> (WSManagedConnectionFactoryImpl.java:727)
>  at
> com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper(
> FreePool.java:1261)
>  at com.ibm.ejs.j2c.poolmanager.FreePool.createOrWaitForConnection(
> FreePool.java:1067)
>  at com.ibm.ejs.j2c.poolmanager.PoolManager.reserve(PoolManager.java:1671)
>  at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(
> ConnectionManager.java:677)
>  at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(
> ConnectionManager.java:461)
>  at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(
> WSJdbcDataSource.java:241)
>  at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(
> WSJdbcDataSource.java:214)
>  at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(
> JdbcTransaction.java:48)
>  at
> com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(
> JdbcTransaction.java:89)
>  at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject
> (GeneralStatement.java:104)
>  at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(
> SqlMapExecutorDelegate.java:561)
>  at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(
> SqlMapExecutorDelegate.java:536)
>  at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(
> SqlMapSessionImpl.java:93)
>  at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(
> SqlMapClientImpl.java:70)
>  at common.ibatis.dao.IbatisBusinessDAO.getBusiness(IbatisBusinessDAO.java
> :43)
>
>
>

Mime
View raw message