Weblogic.jdbc.extensions.PoolDisabledSQLException
Hi All,
We have one of the ADF application running on our Production system. The ADF application is connecting to Database through ADF BC.
We have configured the datasource on the WLS
The Maximun connection pooling on the WLS is 50.
The configurations on the AM is set to default
The application was working fine for 4 months.
But we suddenly encountered "weblogic.jdbc.extensions.PoolDisabledSQLException"
Caused By: weblogic.jdbc.extensions.PoolDisabledSQLException: weblogic.common.resourcepool.ResourceDisabledException: Pool PNDBConnectionDS is Suspended, cannot allocate resources to applications..
Any Idea as how to fix this issue so that we donot see this exception in the future.
We have used Jdev11.1.1.4.0 for development.
Thanks
Krishnaveni
Hi Timo,
Thanks you for googling .
The actual cause for the Issue was that Connection with database was lost could be due to some issue on the database.
After the database came up,We started getting the Re: weblogic.jdbc.extensions.PoolDisabledSQLException.
The issue was fixed bouncing the application to remove stale connections.
But we still need to investigate as why the connections didn't work after the DB was restarted.
Thanks
Krishnaveni
Similar Messages
-
Many procs results in: weblogic.jdbc.extensions.PoolDisabledSQLException
We have an issue whenever we submit say 100 or more processes at the same time to be started.
The first processes all start and work fine.
But at some point things go wrong.
In the log directory under our SOA project, we find these error messages:
Fault ID service:90091
Fault Time 26-Apr-2011 09:06:20
Non Recoverable System Fault :
Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.4.0) (Build 101210)): oracle.toplink.exceptions.DatabaseException Internal >Exception:
weblogic.jdbc.extensions.PoolDisabledSQLException: weblogic.common.resourcepool.ResourceDisabledException: Pool SOALocalTxDataSource is >Suspended, cannot allocate resources to applications..
Error Code: 0Followed a bit later by this:
Fault ID service:90101
Fault Time 26-Apr-2011 09:06:58
Non Recoverable System Fault :
Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.4.0) (Build 101210)): oracle.toplink.exceptions.DatabaseException >Internal Exception:
weblogic.jdbc.extensions.ConnectionDeadSQLException: weblogic.common.resourcepool.ResourceDeadException: >0:weblogic.common.ResourceException: Could not create pool connection.
The DBMS driver exception was: IO-fout: Socket read timed out Error Code: 0 Call:
SQLCall(INSERT INTO COMPOSITE_INSTANCE (ID, COMPOSITE_DN, CONVERSATION_ID, UPDATED_BY, PARENT_ID, CREATED_TIME, TAGS, ECID, INDEX6, TEST_RUN_NAME, INDEX4, TEST_RUN_ID, INDEX2, TEST_SUITE, BUSINESS_STATUS, TEST_CASE, BATCH_ID, SOURCE_NAME, UPDATED_TIME, SOURCE_TYPE, TITLE, SOURCE_ACTION_TYPE, INDEX3, SOURCE_ACTION_NAME, BATCH_INDEX, STATE, CREATED_BY, LIVE_INSTANCES, INDEX1, STATE_COUNT, INDEX5, VERSION, HAS_ASSOC, PARTITION_DATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))
Query: InsertObjectQuery([email protected]12d437)We have a feeling that we need to throttle the creation of these processes.
Appreciate any ideas we might try to fix this issue.We have set the 'maximum capacity' of that data source to 500.
When we submit 100 BPEL instances to be started, we see (by monitoring v$session inside the database) that the number of sessions opened by BPEL never goes beyond a few (5 to 10) database sessions.
Yet we still encounter this 'pool is suspended' error:
weblogic.jdbc.extensions.PoolDisabledSQLException: weblogic.common.resourcepool.ResourceDisabledException:
Pool SOALocalTxDataSource is uspended, cannot allocate resources to applications..We can then reset the status of this pool back to running. It then runs for a while, but after 5 - 10 minutes the status flips back to 'suspended' again.
In search of some kind of workaround, we have also set (in composite.xml) the minimumDelayBetweenMessages to 2 seconds, just to ensure that we throttle the creation of our BPEL processes:
<service name="ReceiveFlowEvent" ui:wsdlLocation="ReceiveFlowEvent.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/aq/PASSOA/WorkflowDispatcher/ReceiveFlowEvent#wsdl.interface(Dequeue_ptt)"/>
<binding.jca config="ReceiveFlowEvent_aq.jca">
<property name="jca.retry.count">3</property>
<property name="jca.retry.interval">5</property>
<!--property name="jca.retry.interval">20</property-->
<!--property name="jca.retry.backoff">2</property-->
<property name="minimumDelayBetweenMessages">2000</property>
<property name="adapter.aq.dequeue.threads">1</property>
</binding.jca>
</service>
...Any more clues are appreciated.
Edited by: Toon Koppelaars on May 9, 2011 4:45 PM -
I build a servlet applocation which access the data on cloud. But when i ran it it gave me the following error
weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool javatrial5196db to allocate to applications, please increase the size of the pool and retry..
How to overcome it???????????I think this could be caused by connection leaks, are you closing your connections correctly in your code i.e. do you have try / catch / finally to handle graceful release of connections ? If that is not the issue then you will likely need to contact the JCS operations to debug further.
Jani Rautiainen
Fusion Applications Developer Relations
https://blogs.oracle.com/fadevrel/ -
Weblogic.jdbc.extensions.PoolLimitSQLException
Hi,
I am using JDeveloper 11.1.2.4 in this case. Basically I am testing my application by deleting part of the URL of my application for example, if I have:
http://localhost:7103/myApp/faces/pages/myPage.jsf?_afrLoop=714583137314224…
I will delete everything after the question mark;
http://localhost:7103/myApp/faces/pages/myPage.jsf
So I can restart the application. The issue is that after several attempts, I get
weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool myDB to allocate to applications, please increase the size of the pool and retry..
I know I could rise the pool size but is there anything I can do to get rid of this problem in a best practice way?
RegardsIf you wait long enough the problem will solve itself. The problem is that if you start a new session without to close (invalidate) the old one, the resources remain active until they get collected during the session timeout in conjunction with the pooling parameters set for your application module.
You can tweak the framework to minimize the effect. For this you minimize the time the resource are hold, by tweaking the pooling parameters in correlation with the session timeout.
One thing you can do it to configure the application module to return the jdbc connection to the pool directly after the request is finished. This means the connection has to be set up for each request when it's checked out from the pool. On the other side the connection isn't attached to the application module until the application module is 'garbage collected' (which takes some time). For this you can set the 'Release Application Module upon release' to true (set the mark in the checkbox in the configuration of the application module. Then you should read the docs about the other pooling parameters and set them to values which suit your application (sorry there is no set of values which works for all applications).
Use the controlling dashboard (http://server:port/console/dashboard) from the admin console and check the connection and application modules.
Some links for more info: http://www.jobinesh.com/2013/06/did-you-notice-new-am-configuration.html
http://andrejusb.blogspot.de/2011/10/experimenting-with-adf-bc-application.html
Timo -
Which jar Conains weblogic.jdbc.extensions.WLConnection in Weblogic 10.3
Hi,
Thank you in advance for your help.
I am upgrading my application from weblogic 9.2 to weblogic 10.3. My app uses weblogic.jdbc.extensions.WLConnection. This class is in weblogic.jar of weblogic 9.2. Which jar contains this class in weblogic 10.3?
Please advise,
Best Regards.
JohnIt's in the com.bea.core.datasource_1.4.0.0.jar in modules directory.
-
Hi,
We are getting the following exceptions. I am also appending the JDBC settings we are using. This is a high volume transaction application.
weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool <DataSourceName> to allocate to applications, please increase the size of the pool and retry..
ERROR;- Error creating a transaction for database default
org.hibernate.exception.GenericJDBCException: Cannot open connection
ERROR;- Session not found in endSession for database default. This is not okay. refCount=0
FATAL;- Found lingering open database session. referenceCount=-1
<?xml version='1.0' encoding='UTF-8'?>
<jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLocation="ht
tp://www.bea.com/ns/weblogic/910/domain.xsd">
<name>DataSource</name>
<jdbc-driver-params>
<url>jdbc:oracle:thin:@serverName:1521:braz2prd</url>
<driver-name>oracle.jdbc.OracleDriver</driver-name>
<properties>
<property>
<name>user</name>
<value>brsadmin</value>
</property>
</properties>
<password-encrypted>{3DES}RWHcVDJQGsEUeR3LGNjB9A==</password-encrypted>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<initial-capacity>10</initial-capacity>
<max-capacity>30</max-capacity>
<capacity-increment>10</capacity-increment>
<test-connections-on-reserve>true</test-connections-on-reserve>
<test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>bharosaDataSource</jndi-name>
<global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
</jdbc-data-source-params>
</jdbc-data-source>
Thanks in advance. Please suggest..
Thanks,
Shashi.Shashi Yarlagadaa wrote:
Hi,
We are getting the following exceptions. I am also appending the JDBC settings we are using. This is a high volume transaction application.
weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool <DataSourceName> to allocate to applications, please increase the size of the pool and retry..
ERROR;- Error creating a transaction for database default
org.hibernate.exception.GenericJDBCException: Cannot open connection
ERROR;- Session not found in endSession for database default. This is not okay. refCount=0
FATAL;- Found lingering open database session. referenceCount=-1
<?xml version='1.0' encoding='UTF-8'?>
<jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLocation="ht
tp://www.bea.com/ns/weblogic/910/domain.xsd">
<name>DataSource</name>
<jdbc-driver-params>
<url>jdbc:oracle:thin:@serverName:1521:braz2prd</url>
<driver-name>oracle.jdbc.OracleDriver</driver-name>
<properties>
<property>
<name>user</name>
<value>brsadmin</value>
</property>
</properties>
<password-encrypted>{3DES}RWHcVDJQGsEUeR3LGNjB9A==</password-encrypted>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<initial-capacity>10</initial-capacity>
<max-capacity>30</max-capacity>
<capacity-increment>10</capacity-increment>
<test-connections-on-reserve>true</test-connections-on-reserve>
<test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>bharosaDataSource</jndi-name>
<global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
</jdbc-data-source-params>
</jdbc-data-source>
Thanks in advance. Please suggest..
Thanks,
Shashi.Hi. I suggest turning on the pool's idle connection timeout to
something slightly longer than you'd expect your longest invocation
to take, and see if the problem goes away. Also, it is better to
make your init capacity = 30 rather than ask the pool to grow
at runtime. Also, keep the capacityIncrement = 1.
Joe -
Workaround for using Oracle JDBC extension with WLS pooling
Reading the newsgroup I saw that many of us encountered the problems
with ClassCastException when tried to use Oracle JDBC extension
with WLS pooling. I also had.
In this case BEA recommends to use dangerous
method getVendorConnection() which exposes
the physical connection object to your code.
Yes it's really dangerous because of unsafe usage may breaks
WLS pooled connection(s).
Moreover, this practice will make your JDBC code
unportable (your JDBC code in addition to Oracle dependence
became Weblogic dependent):
void doSmth() {
Connection con = ...;
Connection vCon = ((WLConnection)con).getVendorConnection();
// + mess of usage con in one places and vCon in others
// (where Oracle extensions are needed)
// !Don't forget to don't close vCon!
Sux.
I found the workaround.
Introduction
============
Yes the real cause of ClassCastException is that
in depth of Oracle driver the casting
to class oracle.jdbc.driver.OracleConnection
(not to interface oracle.jdbc.OracleConnection)
is performed.
Someone can say that this is bug or pure desing.
Weblogic pooled connection provide dynamic
implementation for all public interfaces
which real physical (wrapped) connection object implements.
Great feature!
But I guess that all interface methods implemented
by simple call-delegation to physical (wrapped) connection object.
In case of oracle.jdbc.OracleConnection interface
this approach doesn't work for at least one its method:
public OracleConnection unwrap()
WLS pooled connection shoudn't implement this method by
delegation to physical connection object BUT should
return physical connection object itself!
// Wrong implementation of unwrap()
// delegation is used
public OracleConnection unwrap() {
return physicalConnection.unwrap();
// Right implementation of unwrap()
// physical connection returned
public OracleConnection unwrap() {
return physicalConnection;
Workaround
==========
1. Develop your own OracleConnection wrapper class:
import oracle.jdbc.OracleConnection;
import weblogic.jdbc.extensions.WLConnection;
public class MyOracleConnectionImpl implements OracleConnection {
private OracleConnection con;
public MyOracleConnectionImpl(OracleConnection connection)
throws SQLException
this.con = connection;
public OracleConnection unwrap() {
return (OracleConnection)
((WLConnection)con).getVendorConnection();
/* Implement all other methods by delegation to con object */
2. Don't get Connections directly from DataSource --
develop your own simple (may be static) utility
class which retrives Connections from dataSource
and returns them wrapped into your MyOracleConnectionImpl
to your code from some method:
puclic abstract class MyConnectionSource {
public static Connection getConnection() {
Connection con = // get it from DataSource
return new MyOracleConnectionImpl((OracleConnection)con);
3. Add attribute RemoveInfectedConnectionsEnabled="false"
to definition of your JDBCConnectionPool within config.xml
You may do it because of you `safely` use vendorConnection --
you don't expose it to application code.
4. Enjoy the Oracle JDBC extensions in your code!
Example:
Connection con = MyConnectionSource.getConnection;
ArrayDescriptor add =
ArrayDescriptor.createDescriptor("your_type", con);
Hope it helps to someone.
Best regards,
Eugene VoytitskyHello Eugene Voytitsky,
Thanks Eugene Voytitsky for your idea
I have tried the solution suggested by You, but it did not work.
It still throws ClassCastException.
I am sorry for posting the whole code of two classes below.
I did this to give you more clarity.
I am also indicating the place where the exception was thrown..
Please let me know if I am doing something wrong.
OracleConnection Wrapper class
package ejbTesting;
// sql imports
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
// util imports
import java.util.Map;
import java.util.Properties;
// imports from Oracle Driver Classes
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleOCIFailover;
import oracle.jdbc.OracleSavepoint;
// import from Weblogic extensions
import weblogic.jdbc.extensions.WLConnection;
public class WeblogicConnectionWrapper implements OracleConnection
// oracle connection object
private OracleConnection connection;
public WeblogicConnectionWrapper (OracleConnection orclConnection)
try
this.connection = orclConnection;
catch(Exception unexpected )
unexpected.printStackTrace();
public OracleConnection unwrap()
try
// The datasource returns a weblogic.jdbc.pool.Connection
// This needs to be type casted to weblogic.jdbc.extensions.WLConnection
// Only this weblogic.jdbc.extensions.WLConnection CAN BE type casted
// to OracleConnection
return (OracleConnection) ((WLConnection) connection).getVendorConnection();
catch(Exception sqlException )
sqlException.printStackTrace ();
return null;
/* Implement all other methods by delegation to connection object */
public Connection _getPC()
return connection._getPC();
public void archive(int i, int j, String s)
throws SQLException
connection.archive(i, j, s);
public void assertComplete()
throws SQLException
connection.assertComplete();
public void clearWarnings()
throws SQLException
connection.clearWarnings();
public void close()
throws SQLException
connection.close();
public void commit()
throws SQLException
connection.commit();
public Statement createStatement()
throws SQLException
return connection.createStatement();
public Statement createStatement(int i, int j)
throws SQLException
return connection.createStatement(i, j);
public boolean getAutoClose()
throws SQLException
return connection.getAutoClose();
public boolean getAutoCommit()
throws SQLException
return connection.getAutoCommit();
public CallableStatement getCallWithKey(String s)
throws SQLException
return connection.getCallWithKey(s);
public String getCatalog()
throws SQLException
return connection.getCatalog();
public boolean getCreateStatementAsRefCursor()
return connection.getCreateStatementAsRefCursor();
public int getDefaultExecuteBatch()
return connection.getDefaultExecuteBatch();
public int getDefaultRowPrefetch()
return connection.getDefaultRowPrefetch();
public Object getDescriptor(String s)
return connection.getDescriptor(s);
public boolean getExplicitCachingEnabled()
throws SQLException
return connection.getExplicitCachingEnabled();
public boolean getImplicitCachingEnabled()
throws SQLException
return connection.getImplicitCachingEnabled();
public boolean getIncludeSynonyms()
return connection.getIncludeSynonyms();
public Object getJavaObject(String s)
throws SQLException
return connection.getJavaObject(s);
public DatabaseMetaData getMetaData()
throws SQLException
return connection.getMetaData();
public Properties getProperties()
return connection.getProperties();
public boolean getRemarksReporting()
return connection.getRemarksReporting();
public boolean getRestrictGetTables()
return connection.getRestrictGetTables();
public String getSQLType(Object obj)
throws SQLException
return connection.getSQLType(obj);
public String getSessionTimeZone()
return connection.getSessionTimeZone();
public int getStatementCacheSize()
throws SQLException
return connection.getStatementCacheSize();
public PreparedStatement getStatementWithKey(String s)
throws SQLException
return connection.getStatementWithKey(s);
public int getStmtCacheSize()
return connection.getStmtCacheSize();
public short getStructAttrCsId()
throws SQLException
return connection.getStructAttrCsId();
public boolean getSynchronousMode()
return connection.getSynchronousMode();
public int getTransactionIsolation()
throws SQLException
return connection.getTransactionIsolation();
public Map getTypeMap()
throws SQLException
return connection.getTypeMap();
public String getUserName()
throws SQLException
return connection.getUserName();
public boolean getUsingXAFlag()
return connection.getUsingXAFlag();
public SQLWarning getWarnings()
throws SQLException
return connection.getWarnings();
public boolean getXAErrorFlag()
return connection.getXAErrorFlag();
public boolean isClosed()
throws SQLException
return connection.isClosed();
public boolean isLogicalConnection()
return connection.isLogicalConnection();
public boolean isReadOnly()
throws SQLException
return connection.isReadOnly();
public String nativeSQL(String s)
throws SQLException
return connection.nativeSQL(s);
public Object openJoltConnection(String s, short word0, short word1)
return connection.openJoltConnection(s, word0, word1);
public void oracleReleaseSavepoint(OracleSavepoint oraclesavepoint)
throws SQLException
connection.oracleReleaseSavepoint(oraclesavepoint);
public void oracleRollback(OracleSavepoint oraclesavepoint)
throws SQLException
connection.oracleRollback(oraclesavepoint);
public OracleSavepoint oracleSetSavepoint()
throws SQLException
return connection.oracleSetSavepoint();
public OracleSavepoint oracleSetSavepoint(String s)
throws SQLException
return connection.oracleSetSavepoint(s);
public int pingDatabase(int i)
throws SQLException
return connection.pingDatabase(i);
public CallableStatement prepareCall(String s)
throws SQLException
return connection.prepareCall(s);
public CallableStatement prepareCall(String s, int i, int j)
throws SQLException
return connection.prepareCall(s, i, j);
public CallableStatement prepareCallWithKey(String s)
throws SQLException
return connection.prepareCallWithKey(s);
public PreparedStatement prepareStatement(String s)
throws SQLException
return connection.prepareStatement(s);
public PreparedStatement prepareStatement(String s, int i, int j)
throws SQLException
return connection.prepareStatement(s, i, j);
public PreparedStatement prepareStatementWithKey(String s)
throws SQLException
return connection.prepareStatementWithKey(s);
public void purgeExplicitCache()
throws SQLException
connection.purgeExplicitCache();
public void purgeImplicitCache()
throws SQLException
connection.purgeImplicitCache();
public void putDescriptor(String s, Object obj)
throws SQLException
connection.putDescriptor(s, obj);
public void registerApiDescription(String s, short word0, short word1, String
s1)
connection.registerApiDescription(s, word0, word1, s1);
public void registerSQLType(String s, Class class1)
throws SQLException
connection.registerSQLType(s, class1);
public void registerSQLType(String s, String s1)
throws SQLException
connection.registerSQLType(s, s1);
public void registerTAFCallback(OracleOCIFailover oracleocifailover, Object
obj)
throws SQLException
connection.registerTAFCallback(oracleocifailover, obj);
public void rollback()
throws SQLException
connection.rollback();
public void setAutoClose(boolean flag)
throws SQLException
connection.setAutoClose(flag);
public void setAutoCommit(boolean flag)
throws SQLException
connection.setAutoCommit(flag);
public void setCatalog(String s)
throws SQLException
connection.setCatalog(s);
public void setCreateStatementAsRefCursor(boolean flag)
connection.setCreateStatementAsRefCursor(flag);
public void setDefaultExecuteBatch(int i)
throws SQLException
connection.setDefaultExecuteBatch(i);
public void setDefaultRowPrefetch(int i)
throws SQLException
connection.setDefaultRowPrefetch(i);
public void setExplicitCachingEnabled(boolean flag)
throws SQLException
connection.setExplicitCachingEnabled(flag);
public void setImplicitCachingEnabled(boolean flag)
throws SQLException
connection.setImplicitCachingEnabled(flag);
public void setIncludeSynonyms(boolean flag)
connection.setIncludeSynonyms(flag);
public void setReadOnly(boolean flag)
throws SQLException
connection.setReadOnly(flag);
public void setRemarksReporting(boolean flag)
connection.setRemarksReporting(flag);
public void setRestrictGetTables(boolean flag)
connection.setRestrictGetTables(flag);
public void setSessionTimeZone(String s)
throws SQLException
connection.setSessionTimeZone(s);
public void setStatementCacheSize(int i)
throws SQLException
connection.setStatementCacheSize(i);
public void setStmtCacheSize(int i)
throws SQLException
connection.setStmtCacheSize(i);
public void setStmtCacheSize(int i, boolean flag)
throws SQLException
connection.setStmtCacheSize(i, flag);
public void setSynchronousMode(boolean flag)
connection.setSynchronousMode(flag);
public void setTransactionIsolation(int i)
throws SQLException
connection.setTransactionIsolation(i);
public void setTypeMap(Map map)
throws SQLException
connection.setTypeMap(map);
public void setUsingXAFlag(boolean flag)
connection.setUsingXAFlag(flag);
public void setWrapper(OracleConnection oracleconnection)
connection.setWrapper(oracleconnection);
public void setXAErrorFlag(boolean flag)
connection.setXAErrorFlag(flag);
public void shutdown(int i)
throws SQLException
connection.shutdown(i);
public void startup(String s, int i)
throws SQLException
connection.startup(s, i);
Util class to get Wrapped Connections from
datasource
package ejbTesting;
// j2ee imports
import javax.naming.InitialContext;
import javax.sql.DataSource;
// sql imports
import java.sql.Connection;
// imports from Oracle Driver Classes
import oracle.jdbc.OracleConnection;
* Wrapper class for the DataSource Connection from Weblogic pool
public class DataSourceConnectionWrapper
// datasource variable
private static transient DataSource datasource = null;
private static String dbName = "jdbc/workbench";
* Method that returns the database connection
public static Connection getConnection()
try
// initialsing the datasource object
initialiseDataSource ();
// Getting a connection from the datasource
Connection con = datasource.getConnection( );
// wrapping it custom wrapper class and
// returning the connection object
return new WeblogicConnectionWrapper((OracleConnection)con);
catch(Exception exception )
exception.printStackTrace();
return null;
private static void initialiseDataSource( ) throws Exception
if ( datasource == null )
try
InitialContext ic = new InitialContext( );
datasource = (DataSource) ic.lookup( dbName );
catch (Exception ne )
throw new Exception( "NamingException while looking up DataSource with
JNDI name" +
dbName + ": \n" + ne.getMessage( ) );
Exception Stack Trace
The line 46 in DataSourceConnectionWrapper
corresponds to
return new WeblogicConnectionWrapper((OracleConnection)con);
Which I feel is logical as the connection which we get from Weblogic
datasource cannot be type casted to OracleConnection
java.lang.ClassCastException: weblogic.jdbc.pool.Connection
at ejbTesting.DataSourceConnectionWrapper.getConnection(DataSourceConnectionWrapper.java:46) -
Hi,
I'm trying to run examples.jdbc.datasource.simplesql with Weblogic 5.1sp8,
but am hitting this problem when it executes:
An exception was caught. javax.naming.NamingException [Root exception is
weblogic.rmi.ServerError: A Rem
oteException occurred in the server method
- with nested exception:
[java.lang.NoSuchMethodError: weblogic.rmi.extensions.WRMIOutputStream:
method writeObject(Ljava/lang/Ob
ject;)V not found]]
An exception was caught. java.lang.NullPointerException:
Any pointers would be appreciated.
Thanks,
-TrietHi..
I guess itzz more of the service pack problems.
Jars built on the later version won't work in the previous version (service packs) of weblogic.
Try building a jar on the oldest version (service pack) u have and then try deploying it to the later version , i think it won't give u any problems.
Try it out and let me know if u face any problems -
hello,everyone.
I have a problem.please help me.
My application is running on weblogic 9.2. My oracle is oracle10g. system:linux redhat4.
my weblogic's log have a problem.
java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
at weblogic.jdbc.rmi.SerialStatement.close(SerialStatement.java:109)
at com.goldpalm.common.jdbc.DBController.releaseConn(DBController.java:273)
at com.goldpalm.sale.team.TeamXml.exeTeamLog(TeamXml.java:762)
at jsp_servlet._ctssale.__teamline_show._jspService(__teamline_show.java:264)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:230)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at filters.AuthFilter.doFilter(AuthFilter.java:95)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3200)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1844)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)Hi
Looking at the error stack trace, you are getting this error when trying to close the statement object from your own java code (not weblogic code...) - DBController.releaseConn(...)
at com.goldpalm.common.jdbc.DBController.releaseConn(DBController.java:273)
java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
at weblogic.jdbc.rmi.SerialStatement.close(SerialStatement.java:109)
at com.goldpalm.common.jdbc.DBController.releaseConn(DBController.java:273)
at com.goldpalm.sale.team.TeamXml.exeTeamLog(TeamXml.java:762)
Well check the code you have at this location. Usually the way we release/close the db resources are like first close ResultSet, then Statement, then Connection. But if you close connection first, then try to close the Statement object, it throws errors like what you see.
I am giving 2 methods code snippet. One method is caleld like closeAll(..). This method gets called in finally block of all other db methods that does the actual db code to connect and get data etc etc.
// Sample main method that does all db stuff...This is just code snippet only and NOT the full code. Focus on try catch finally block
public static void getCustomerProfile(long custId) throws Exception {
Connection aConnection = getConnection();
CallableStatement aCallableStatement = null;
ResultSet aResultSet = null;
try {
aCallableStatement = aConnection.prepareCall("{ call someFunction(?, ?) }");
aCallableStatement.execute();
aResultSet = (ResultSet) aCallableStatement.getObject("variable_name_from_sp");
while(aResultSet.next()) {
// get all data for each record etc...
} catch (Exception e) {
e.printStackTrace();
throw e;
} finally {
closeAll(aConnection, aCallableStatement, aResultSet);
// While closing RS, Statment, Connection, enclose them in their own try/catch block and ofcourse check for nulls first
public static void closeAll(Connection aConn, Statement aStmt, ResultSet aRS) {
if (aRS != null) {
try {
aRS.close();
} catch (Exception e) {
System.out.println("Not Able To Close The ResultSet");
//e.printStackTrace();
if (aStmt != null) {
try {
aStmt.close();
} catch (Exception e) {
System.out.println("Not Able To Close The Statement");
//e.printStackTrace();
if (aConn != null) {
try {
aConn.close();
} catch (Exception e) {
System.out.println("Not Able To Close The Connection");
//e.printStackTrace();
}Thanks
Ravi Jegga -
Hi,
I am facing following issue in my one environment. but in other environment same class path is working fine. I have compared all jar and classpath for both weblogic server.
I am using weblogic 11g.
27 Mar 2013 15:21:09,507 ERROR XXXServlet:293 - oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
java.lang.ClassCastException: oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
at com.emc.nems.wsd.ui.beans.reports.mpapi.FacilityBeanType.nullSafeGet(FacilityBeanType.java:126)
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
at org.hibernate.loader.Loader.getRow(Loader.java:1230)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
at org.hibernate.loader.Loader.doQuery(Loader.java:724)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at com.emc.nems.oms.dao.hibernate.util.OMSHibBaseDAO.executeNamedQueryWithoutTransaction(Unknown Source)
at com.emc.nems.wsd.dao.hibernate.reports.mpapi.MpapiReportHibDAO.findMCR020(Unknown Source)
at com.emc.nems.wsd.ui.handler.reports.ReportsHandler.getMPAPIData(Unknown Source)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.executeReport(XXXServlet.java:1009)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.generateAuditFile(XXXServlet.java:318)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.execute(XXXServlet.java:273)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.doGet(XXXServlet.java:207)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3731)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3695)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2285)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2184)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1459)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Regards,
AbhishekCreating my Oracle connection works fine ... code as follows:
<i>Context ctxt = getInitialContext();
DataSource dataSource = (DataSource) ctxt.lookup(poolName);
Connection conn = dataSource.getConnection();
OracleConnection oracleConn = (OracleConnection)((WLConnection)conn).getVendorConnection();</i>
I also have reviewed documentation:
http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html. In section 'Using OracleStruct Extension Methods' it highlights that
<i>java.sql.Struct struct =(weblogic.jdbc.vendor.oracle.OracleStruct)(rs.getObject(2));</i>
None of the documentation actually mentions <b>oracle.sql.STRUCT</b>. For Weblogic to truely provide support for Oracle it needs an easy way of converting to this data type. At present I cannot interact with Oracle APIs until I can create an oracle.sql.STRUCT. -
How can i use the weblogic jdbc driver for sqlserver?
hello
i have downloaded and installed the weblogic on my windows2000 server,then i want to use the weblogic jdbc driver for sqlserver2000 outside of the weblogic,as follow:
1 add following string to my classpath environment of the wndows2000: E:\bea\wlserver6.1\lib\mssqlserver4v65.jar
2 then i write a test program as:
import weblogic.jdbc.mssqlserver4.Driver;
import java.sql.*;
public class test{
public static void main(String argv[]){
try{ Class.forName("weblogic.jdbc.mssqlserver4.Driver");
Connection
conn=DriverManager.getConnection"jdbc:weblogic:mssqlserver4:localhost:1433","sa",""); }catch(Exception e){ System.out.println(e.getMessage()); }
4 when i execute it,it throw a exception:
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/version at weblogic.jdbc.mssqlserver4.TdsStatement.getLicenseStr(TdsStatement.java:2665) at weblogic.jdbc.mssqlserver4.TdsStatement.microsoftLogin(TdsStatement.java:2474) at weblogic.jdbc.mssqlserver4.MicrosoftConnection.beginLogin(MicrosoftConnection.java:42) at weblogic.jdbc.mssqlserver4.TdsConnection.login(TdsConnection.java:57) at weblogic.jdbc.mssqlserver4.MicrosoftConnection.login(MicrosoftConnection.java:53) at weblogic.jdbc.mssqlserver4.BaseConnection.prepareConnection(BaseConnection.java:187) at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:34) at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:177) at test.main(test.java:7)
who can help me?thank you!Hi,
Mail me the jar file as I am using Weblogic 6.1 to my email id [email protected]
Else tell me the site from where u have downloaded and i will do the same.
I will test the same and let you know.
Thanks,
Seetesh -
OIM 9.1.0.2 - Weblogic JDBC Multi Data Sources for Oracle RAC
Does OIM OIM 9.1.0.2 BP07 support Weblogic JDBC Multi Data Sources (Services>JDBC>Multi Data Sources) for Oracle RAC instead of inserting the "Oracle RAC JDBC URL" on JDBC Data Sources for xlDS and xlXADS (Services>JDBC>Data Sources> xlDS|xlXADS > Connection Poll> URL) ?
If yes, is there are any other modifications that need to be made on OIM, or just changing the data sources?Yes, it's supported. You install against one instance directly of the Rac Server. Then you update the config.xml file and the jdbc resource in your weblogic server with the full rac address. It is documented for installation against RAC. http://docs.oracle.com/cd/E14049_01/doc.9101/e14047/database.htm#insertedID2
-Kevin -
Hi All,
I am getting below build error. I am migrating weblogic 10. Which jar file contains this interface: weblogic.jdbc.vendor.oracle.OracleThinClob?
Error:
package weblogic.jdbc.vendor.oracle does not exist [javac] if (theClob instanceof weblogic.jdbc.vendor.oracle.OracleThinClob)
I already got weblogic.jar file from weblogic 10.
Thanks,
SrinivasSrinivas U wrote:
Hi All,
I am getting below build error. I am migrating weblogic 10. Which jar file contains this interface: weblogic.jdbc.vendor.oracle.OracleThinClob?
Error:
package weblogic.jdbc.vendor.oracle does not exist [javac] if (theClob instanceof weblogic.jdbc.vendor.oracle.OracleThinClob)
I already got weblogic.jar file from weblogic 10.
Thanks,
SrinivasIt's in the datasource module/jar: modules/com.bea.core.datasource_1.0.0.0.jar -
Hello,
we are running WLS 6.1 SP2. The following code sometimes (rather rarely) throws
a NullPointerException:
Connection dbConnection = DBUtil.getDBConnection();//here we get the Connection
stmt = dbConnection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);//it's
where NPE happens
The error report says:
java.sql.SQLException:
java.lang.NullPointerException at
weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:396)
So, I think, this is something in WebLogic's code... Is this a known issue (I
couldn't find a similar report in the newsgroup)? Is there a workaround?
regards,
VitalyVitaly Sourikov wrote:
"Vitaly Sourikov" <[email protected]> wrote:
The patches that we use with SP2 are
CR061106_61sp2.jar
CR072612_61sp2.jar
CR077919_61sp2.jar
As far as we know, those fixes (or some of them) were not introduced in SP4. Are
there new versions of the patches for SP4?I have found that all these bugs are fixed in sp4, so no patches are needed if you
upgrade to 6.1sp4.
Joe
>
>
regards,
Vitaly
Hi Joseph,
Thank you for the reply. Unfortunately, we cannot move to SP3 or SP4
- they have
conflicts with other patches from WebLogic we use. This error happens
rather rarely.
In most of cases this very stuff works. But it would be intresing to
have this
patch for diagnostics, in case of future failures. Would you send it
to me, please?
Thank you in advance,
Vitaly
Joseph Weinstein <[email protected]> wrote:
Vitaly Sourikov wrote:
Hello,
we are running WLS 6.1 SP2. The following code sometimes (rather rarely)throws
a NullPointerException:
Connection dbConnection = DBUtil.getDBConnection();//here we get theConnection
stmt = dbConnection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);//it's
where NPE happens
The error report says:
java.sql.SQLException:
java.lang.NullPointerException at
weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:396)
So, I think, this is something in WebLogic's code... Is this a knownissue (I
couldn't find a similar report in the newsgroup)? Is there a workaround?Hi. The NPE is probably happening in the actual DBMS driver. What is
happening
is that the rmi driver is having to catch any non-SQLException, andthrow
a SQLException
with the message of the original exception. Unfortunately, the fullstacktrace
of the
original NPE is lost. If you want, I can send you a small diagnostic
patch, which will
just make the rmi object retain the whole original stacktrace in the
exception it throws,
and that will help lead to the real problem.
This may well be a bug that was fixed in sp3 or 4. Is it possible
for you to upgrade to
the latest stuff?
Joe
regards,
Vitaly -
ClassCastException: weblogic.jdbc.rmi.SerialResultSet
HI,
I am using WebLogic 6.0 SP2 connection pooling to get CLOB data from Oracle database.
It is working fine to get the connection and get non-CLOB data like string, but
when I retrieve the CLOB column in my program such as, theClob = ((oracle.jdbc.OracleResultSet)
rs).getCLOB(1),
Weblogic throws ClassCastException: weblogic.jdbc.rmi.SerialResultSet, does anybody
experience the same problem ? How can I get around this problem ?
Thanks
JohnHi,
I've got the same error. The only diference is that I read BLOBs out of the table
((oracle.jdbc.OracleResultSet)rset).getBLOB(1) from oracle.jdbc.OracleResultSet).
Best regards,
Kai
"John Chen" <[email protected]> wrote:
>
HI,
I am using WebLogic 6.0 SP2 connection pooling to get CLOB data from
Oracle database.
It is working fine to get the connection and get non-CLOB data like string,
but
when I retrieve the CLOB column in my program such as, theClob = ((oracle.jdbc.OracleResultSet)
rs).getCLOB(1),
Weblogic throws ClassCastException: weblogic.jdbc.rmi.SerialResultSet,
does anybody
experience the same problem ? How can I get around this problem ?
Thanks
John
Maybe you are looking for
-
Hi friends, Please help, I have some fields missing in my data source , but they are available in the extract structure of that data source..what do I do now, to see the same fields in my data source also?? should I ahve to append the data
-
Hi. I want to wipe the entire phone clean. Not just apps and memory but "clean". As in nothing. Nadda. poof. I want to brick it. I have an issue and I need to try and start from the very beginning.
-
Variable substitution in text formating
Hello everybody! I'm a real beginner in APEX without Java knowledge. In my aplication I have a text-field P8_KONTA and a hidden text P8_COLOR containing a colorname (red, yellow or green). Depending on the value of P8_color I want to format the color
-
Crash only with ESPN3 ("watchespn") live game COMMERCIALS
Hello. I have had no problems with this for years until 3 weeks ago after getting the Flash player 11 update. Ever since then, video from all sites and sources run fine with the exception of espn3.com. During live college football games, the live ga
-
Hi All If 100 items Goods are Receipted with a Purchase Order using Inbound Delivery. It is then discovered that the entire 100 items are damaged, what is the transaction to return these items Vishnu