ClassCastException: weblogic.jdbc.rmi.SerialPreparedStatement
I am attempting to retrieve CLOBs and XMLTypes in a servelet from a 9i release
2 database. Using sampe code from oracle, I am getting ClassCastException when
I attempt to cast ...
oracle.jdbc.OraclePreparedStatement stmt =
(oracle.jdbc.OraclePreparedStatement) conn.prepareStatement( sql );
The connection pool sets up fine, no errors. I am getting the connection in the
servlet through the JNDI lookup ... (see code)
From the config.xml, the jdbc setup ...
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="3" MaxCapacity="10" Name="9iR2Pool"
Properties="user=kr;password=*****;dll=ocijdbc9;protocol=oci8"
Targets="myserver" URL="jdbc:oracle:oci8:@ora9i"/>
Has anyone done this before? Is there another way? Does bea have 9i release
2 jdbc drivers?
[huh.java]
Hi Rick,
JDBC objects obtained via a connection pool
can not be cast to anything oracle.jdbc.*.
In order to use oracle-specific functions of
prepared statements you need to use oracle
extensions provided by weblogic. Documentation
and examples can be found here:
http://e-docs.bea.com/wls/docs61/jdbc/thirdparty.html#1043705
Regards,
Slava Imeshev
"Rick Bradshaw" <[email protected]> wrote in message
news:3d6cfa2c$[email protected]..
>
I am attempting to retrieve CLOBs and XMLTypes in a servelet from a 9irelease
2 database. Using sampe code from oracle, I am getting ClassCastExceptionwhen
I attempt to cast ...
oracle.jdbc.OraclePreparedStatement stmt =
(oracle.jdbc.OraclePreparedStatement) conn.prepareStatement( sql );
The connection pool sets up fine, no errors. I am getting the connectionin the
servlet through the JNDI lookup ... (see code)
From the config.xml, the jdbc setup ...
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="3" MaxCapacity="10" Name="9iR2Pool"
Properties="user=kr;password=*****;dll=ocijdbc9;protocol=oci8"
Targets="myserver" URL="jdbc:oracle:oci8:@ora9i"/>
Has anyone done this before? Is there another way? Does bea have 9irelease
2 jdbc drivers?
Similar Messages
-
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 -
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 -
Hello. I'm trying to bring back a BLOB object from a PL/SQL procedure. I keep getting a class cast exception when I do it
java.lang.ClassCastException: weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB cannot be cast to oracle.sql.BLOB
I get similar results with oracle.sql.BLOB or java.sql.Blob.
What I've noticed is that when I'm not using a JDBC URL with my AM to do the SQL it does not fail. It's when I change to a JDBC Datasource I get the class cast exception. Any ideas?
Thanks, Graeme.In the connection pool uncheck the property "Wrap Data Types".
By default, data type objects for Array, Blob, Clob, NClob, Ref, SQLXML, and Struct, plus ParameterMetaData and ResultSetMetaData objects are wrapped with a WebLogic wrapper. This allows for features like debugging and connection usage to be done by the server.
The wrapping can be turned off by setting this value to false. This improves performance, in some cases significantly, and allows for the application to use the native driver objects directly. -
You can try this as a work around :
// CLOB clob = ((OracleResultSet) rs).getCLOB (2); this causes the exception
// this is the work around (assuming thin drivers)
java.sql.Clob clobFromDB = (java.sql.Clob) rs.getObject("MYCLOBCOL");
int len = (int) clobFromDB.length();
String str = clobFromDB.getSubString (Long.parseLong("1"), len );hi, all.
I also encounter this problem.but I can't see your message body on this subject. can you help me to resolve this problem? Please send to me by email. Thanks! -
Weblogic.jdbc20.rmi.SerialConnection fail to prepareCall()
Hi, I have a stateless session bean calling an oracle8i stored procedure. The java.sql.Connection is obtained via weblogic DataSource (non-transactional). and this line is failing:CallableStatement cstmt = conn.prepareCall(qstr);Start of the stack is this:java.sql.SQLException: java.lang.NullPointerException: at weblogic.jdbc20.rmi.SerialConnection.prepareCall(SerialConnection.java:44)I tested printing conn.toString() and it gave me "weblogic.jdbc20.rmi.SerialConnection@43074758", but any other method on this Connection object will fail.Yet, same program runs just fine in servlet. Any idea why? How does weblogic.jdbc20.rmi.SerialConnection come to into play? What is it?Any help is appreciated!Alan
Potluri wrote:
>
WLS 6.1 on Win 2000 and trying to connect Oracle database on remote Unix machine.Let me know if you're at the latest service pack level. This feels like a bug that
has been fixed...
Joe
>
Joseph Weinstein <[email protected]> wrote:
Potluri wrote:
Hi ,
I am using CallableStatement to update the database. When i tried tocreate the
callable statement it is throwing the following exception. can anysuggest some
solution for this....
java.sql.SQLException: java.lang.NullPointerException
at weblogic.jdbc.rmi.SerialConnection.prepareCall(SerialConnection.java:
106)
PotluriWhat version of the server are you running?
B.E.A. is now hiring! (12/14/01) If interested send a resume to [email protected]
DIRECTOR OF PRODUCT PLANS AND STRATEGY San Francisco, CA
E-SALES BUSINESS DEVELOPMENT REPRESENTATIVE Dallas, TX
SOFTWARE ENGINEER (DBA) Liberty Corner, NJ
SENIOR WEB DEVELOPER San Jose, CA
SOFTWARE ENGINEER (ALL LEVELS), CARY, NORTH CAROLINA San Jose, CA
SR. PRODUCT MANAGER Bellevue, WA
SR. WEB DESIGNER San Jose, CA
Channel Marketing Manager - EMEA Region London, GBR
DIRECTOR OF MARKETING STRATEGY, APPLICATION SERVERS San Jose, CA
SENIOR SOFTWARE ENGINEER (PLATFORM) San Jose, CA
E-COMMERCE INTEGRATION ARCHITECT San Jose, CA
QUALITY ASSURANCE ENGINEER Redmond, WA
Services Development Manager (Business Development Manager - Services) Paris, FRA; Munich, DEU
SENIOR SOFTWARE ENGINEER (PLATFORM) Redmond, WA
E-Marketing Programs Specialist EMEA London, GBR
BUSINESS DEVELOPMENT DIRECTOR - E COMMERCE INTEGRATION San Jose, CA
MANAGER, E-SALES Plano, TX -
Hey Guys,
We are running our application on weblogic8.1 server (AIX box). Our application keeps throwing this error. Has anyone of you come across this error before.
java.sql.SQLException: This JDBC 2.0 method is not implemented at weblogic.jdbc.mssqlserver4.TdsResultSet.getType(TdsResultSet.java:684) at weblogic.jdbc.wrapper.ResultSet_weblogic_jdbc_mssqlserver4_TdsResultSet.getType(Unknown Source) at weblogic.jdbc.rmi.internal.ResultSetImpl.isResultSetCacheable(ResultSetImpl.java:140) at weblogic.jdbc.rmi.internal.ResultSetImpl.isRowCaching(ResultSetImpl.java:109) at weblogic.jdbc.rmi.internal.ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_weblogic_jdbc_mssqlserver4_TdsResultSet_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477) at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144) at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415) at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code)) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) Thanks Regards RichiRachith Srinivas wrote:
Hey Guys,
We are running our application on weblogic8.1 server (AIX box).
Our application keeps throwing this error. Has anyone of you come across
this error before.
java.sql.SQLException: This JDBC 2.0 method is not implemented
at weblogic.jdbc.mssqlserver4.TdsResultSet.getType(TdsResultSet.java:684)
...Hi. That old driver is telling you the truth. That JDBC 2.0 method is not implemented.
There has been no development of that driver since soon after the JDBC 2.0 spec was
finalized. We provide the weblogic.jdbc.sqlserver.SQLServerDriver in the 8.1 server,
and heartily recommend you switch to it. It's a much superior driver, and has the
considerable benefit if being fully supported and updated. The old ms4 driver is
strongly deprecated and won't exist in the next release of WebLogic.
Joe -
WLS 10.3 ClassCastException obtaining JDBC connection
I have a problem obtaining a JDBC connection in a java client application, using a WLS Datasource.
- I've configured a JDBC datasource in a WLS 10.3 instance, using the Oracle thin driver (not the XA version) - and have successfully targetted this to my server and tested the connection via the console.
- When viewing the JNDI Tree for the server, the Datasource is visible as expected.
However, when I attempt to use a simple client program to obtain a datasource and JDBC connection I get the following error :
java.lang.ClassCastException : weblogic.jdbc.common.internal.ConnectionEnv cannot be cast to java.io.Serializable
Debugging shows a datasource is obtained and that the ClassCastException is thrown when an attempt is made to get a connection from the datasource. Note this code has been used successfully for previous WLS versions to obtain and test a connection (WLS 8.1 - WLS 10) and follows the expected steps :
Hashtable<String, String> ht = new Hashtable<String, String>();
ht.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
ht.put( Context.PROVIDER_URL, "t3://localhost:7001");
javax.naming.Context ctx = new InitialContext( ht );
ds = (javax.sql.DataSource) ctx.lookup( pDataSourceName );
Connection con = ds.getConnection();
The client app has the following Jars on the classpath :
wlclient.jar
jdk1.6.0_07 runtime jar
The client code has been built using jdk1.6.0_07
i) Can you confirm if any additional libraries are required on the classpath
ii) Please indicate if there are any special steps required to obtain a JDBC connection in WLS 10.3
Thanks for your help.
Edited by: user554713 on 23-Dec-2008 02:27In a Java client the HashTable properties are required to be set.
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
try { ctx = new InitialContext(ht);
// Use the context in your program }
catch (NamingException e) { // a failure occurred }
finally { try {ctx.close();} catch (Exception e)
{ // a failure occurred } }Edited by: dvohra16 on Dec 10, 2009 5:39 PM -
Hi I am getting the following exception:
java.lang.ClassCastException: weblogic.rmi.internal.MethodDescriptor
at weblogic.rjvm.MsgAbbrevInputStream.readClassDescriptor(MsgAbbrevInputStream.java:186)
at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.readClassDescriptor(ChunkedObjectInputStream.java:300)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:901)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:110)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:123)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
can any body explain the Cause for this exception and what will be the impact on the server.
but if i restart the server the error is not comingHi I am getting the following exception:
java.lang.ClassCastException: weblogic.rmi.internal.MethodDescriptor
at weblogic.rjvm.MsgAbbrevInputStream.readClassDescriptor(MsgAbbrevInputStream.java:186)
at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.readClassDescriptor(ChunkedObjectInputStream.java:300)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:901)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:110)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:123)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
can any body explain the Cause for this exception and what will be the impact on the server.
but if i restart the server the error is not coming -
Major performance problem in weblogic jdbc
I ran a test which selected ~1000 rows from an oracle database table. The
code ran in 4 seconds when I used the Oracle driver directly:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection = DriverManager.getConnection(URL, "XXX", "XXX");
When I changed the code to get the connection from weblogic, it took 128
SECONDS!!!!
weblogic.jdbc.connectionPool.pointclick=\
url=jdbc:oracle:thin:@XXX:dev,\
driver=oracle.jdbc.driver.OracleDriver,\
initialCapacity=1,\
maxCapacity=2,\
capacityIncrement=1,\
props=user=XXX;password=XXX
weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.pointclick=pointclick
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
Context context = new InitialContext(properties);
try
DataSource dataSource = (DataSource)context.lookup(NAME);
Connection connection = dataSource.getConnection();
// if(!autoCommit)
// connection.setAutoCommit(false);
return connection;
finally
context.close();
The strangest thing is that when I used the weblogic pool, if I executed
"select column from table" it took 128 seconds, but "select * from table"
only took 32 seconds. Why would it take longer to process less data?
And more importantly, why does the weblogic connection take so damn long?
Thanks for your help.
Sean RoheadHey, I finally managed to get JDBC logging up and running! Had to do with
permission setting, adding the following entry to weblogic.policy:
permission java.sql.SQLPermission "setLog";
Boy are you right; JDBC logging is slow as mud! Good thing we use BMP
entity beans, so I guess I can log JDBC calls myself in the
ejbCreate/Load/Store/Remove hooks!
Gene Chuang
Teach the world. Join Kiko!
http://www.kiko.com/profile/join.jsp?refcode=TAF-gchuang
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
>
>
Gene Chuang wrote:
Hey, I've tried setting weblogic.jdbc.enableLogFile=true before and
can't
even get the server to start up! Since JDBC logging is not only slow,but
buggy,JDBC logging is slow for the reasons described, but not buggy as such.
is there a possibility Weblogic can implement a JDBC log for a future
release?
Seems like Weblogic can catch SQL calls much easier than we can,
especially for CMP!It is conceivable that our pool drivers (pool,jts,rmi etc) couldindependently
log SQL for debugging purposes, but we need to retain the semantics ofturning
on jdbc logging, which in any case will continue to emanate from any JDBCdriver.
In any case, we wouldn't do anything differently that DriverManager doesfor
simply writing to a file, which would be serialized by the stream anyway.
Joe
Gene Chuang
Teach the world. Join Kiko!
http://www.kiko.com/profile/join.jsp?refcode=TAF-gchuang
"Joseph Weinstein" <[email protected]> wrote in message
news:[email protected]...
Sean Rohead wrote:
OK, disregard everything I said in my last post. The REAL reason
for
the
slowdown is that I had "weblogic.jdbc.enableLogFile=true" in my
weblogic.properties. So, there is nothing wrong with the JNDIDataSource
object. Sorry if I misled anyone.
Still, it does seem rather excessive for logging to cause a 30Xslowdown.
Someone at BEA ought to take a closer look at that...Known issue, not ours.
JDBC logging collect anything logged by any JDBC driver or by anySQLException.
These all call DriverManager.println() which is class synchronized in
the
JVM,
so this will serialize most JDBC threads, and slow the server down a
lot,
independently of the disk I/O needed to grow the file.
Joe
Sean Rohead
"Sean Rohead" <[email protected]> wrote in message
news:[email protected]...
Nice work, Charlie!
When I just connected to the pool directly, it ran fine. I am
guessing
that
the DataSource returns a connection that connects first to the
server
via
RMI and then to the database. I am trying to obtain a JDBC
connection
for
use in EJB and servlets, so this is clearly overkill. The
question I
now
have is what is the best way to obtain a transactional
connection
without
the overhead described above? Can I somehow create a
transactional
DataSource that doesn't go over RMI? Or, should I just use thejts
driver
directly? I tried the following code, but got an error:
Driver driver = new weblogic.jdbc.jts.Driver();
Properties properties = new Properties();
properties.put("connectionPoolID", "pointclick");
Connection connection = driver.connect("jdbc:weblogic:jts",properties);
The error was:
java.sql.SQLException: The url cannot be null
atjava.sql.DriverManager.getConnection(DriverManager.java:434)
atjava.sql.DriverManager.getConnection(DriverManager.java:106)
at weblogic.jdbcbase.jts.Driver.connect(Driver.java:213)
at
pointclick.jdbc.ConnectionFactory.getConnection(ConnectionFactory.java:24)
atpointclick.servlet.TestServlet.doGet(TestServlet.java:36)
atjavax.servlet.http.HttpServlet.service(HttpServlet.java:740)
atjavax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:124)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:744)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:692)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:251)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
atweblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>>>>>
>>>>>
I copied the code above from
http://www.weblogic.com/docs51/classdocs/jts_driver.html and there
was
no
mention of setting any other properties. If I create the
connection
this
way from an EJB, will it still participate in the transaction
started
by
the
EJB container?
Sean Rohead
"Charlie Crook" <[email protected]> wrote in message
news:[email protected]...
Your Oracle example is also using JNDI to obtain the connection;
not
just
getting a connection from a pool. So you've actually changed 2conditions
( non-pool to pool, non-JNDI to JNDI ). So both of these should
be
considered as suspects for the performance.
"Sean Rohead" <[email protected]> wrote in message
news:[email protected]...
I ran a test which selected ~1000 rows from an oracle database
table.
The
code ran in 4 seconds when I used the Oracle driver directly:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection = DriverManager.getConnection(URL,
"XXX",
"XXX");
When I changed the code to get the connection from weblogic,
it
took
128
SECONDS!!!!
weblogic.jdbc.connectionPool.pointclick=\
url=jdbc:oracle:thin:@XXX:dev,\
driver=oracle.jdbc.driver.OracleDriver,\
initialCapacity=1,\
maxCapacity=2,\
capacityIncrement=1,\
props=user=XXX;password=XXX
weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.pointclick=pointclick
>>>>>>>
>>>>>>>
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
Context context = new InitialContext(properties);
try
DataSource dataSource = (DataSource)context.lookup(NAME);
Connection connection = dataSource.getConnection();
// if(!autoCommit)
// connection.setAutoCommit(false);
return connection;
finally
context.close();
The strangest thing is that when I used the weblogic pool, ifI
executed
"select column from table" it took 128 seconds, but "select *
from
table"
only took 32 seconds. Why would it take longer to process
less
data?
And more importantly, why does the weblogic connection take sodamn
long?
Thanks for your help.
Sean Rohead
PS: Folks: BEA WebLogic is in S.F., and now has some entry-level
positions
for
people who want to work with Java and E-Commerce infrastructure
products.
Send
resumes to [email protected]
The Weblogic Application Server from BEA
JavaWorld Editor's Choice Award: Best Web Application Server
Java Developer's Journal Editor's Choice Award: Best Web ApplicationServer
Crossroads A-List Award: Rapid Application Development Tools for
Java
Intelligent Enterprise RealWare: Best Application Using a ComponentArchitecture
http://www.bea.com/press/awards_weblogic.html
PS: Folks: BEA WebLogic is in S.F., and now has some entry-level positionsfor
people who want to work with Java and E-Commerce infrastructure products.Send
resumes to [email protected]
The Weblogic Application Server from BEA
JavaWorld Editor's Choice Award: Best Web Application Server
Java Developer's Journal Editor's Choice Award: Best Web ApplicationServer
Crossroads A-List Award: Rapid Application Development Tools for Java
Intelligent Enterprise RealWare: Best Application Using a ComponentArchitecture
http://www.bea.com/press/awards_weblogic.html -
JDBC/RMI driver does not support BLOB data type
WLS 5.1 JDBC/RMI driver does not support BLOB data type. It is said in the Weblogic e-doc.
I am using DataSource for database connections, meaning JDBC/RMI driver is actually producing
database connections. I need several columns of BLOB types in my Oracle tables.
Should I use the "JTS" driver instead in order to have the BLOB types supported ?
Thanks for help.
[att1.html]The error java.rmi.UnmarshalException seems to indicate you are somehow accessing the data-source over RMI, this seems odd. Are you running TopLink on a client and trying to connect to a WebLogic DataSource on the server?
Maybe try connecting directly to the DataSource without going through TopLink and see if you encounter the same issue.
You could also look at the TopLink WebLogic Examples and see how their configuration is different than your own. -
At startup: "Unable to resolve weblogic.jdbc.connectionPool"
WLS 6.0 SP1 on Solaris 8
Oracle 8.1.7 using JDBC Thin driver from Oracle.
At startup of WebLogic, just after WLS creates the pool, I get a JNDI
NameNotFoundException, as shown below.
However, this does not seem to cause any problems for us.
####<Jun 20, 2001 10:16:17 AM GMT+10:00> <Info> <JDBC Pool ora817Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Pool: 'ora817Pool'
will be tested at: '10 minute intervals.>
####<Jun 20, 2001 10:16:20 AM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:21 AM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:22 AM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:23 AM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:24 AM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:24 AM GMT+10:00> <Info> <Adapter> <pssydsun01>
<myserver> <main> <system> <> <000000> <Exception thrown by rmi
server(class weblogic.jndi.internal.RootNamingNode)
[-4918694186591914732S:192.168.0.52:[7001,7001,7002,7002,7001,7002,-1]/9]:
weblogic.jndi.internal.RootNamingNode@1fea8a>
javax.naming.NameNotFoundException: Unable to resolve
weblogic.jdbc.connectionPool Resolved: 'weblogic' Unresolved:'jdbc' ;
remaining name 'connectionPool'
at
weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:803)
at
weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
at
weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:129)
at
weblogic.jndi.internal.BasicNamingNode.list(BasicNamingNode.java:496)
at
weblogic.jndi.internal.BasicNamingNode.list(BasicNamingNode.java:500)
at
weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(RootNamingNode_WLSkel.java:230)Just installed SP2 on top of WebLogic Server 6.0 SP1.
I still get the same message in weblogic.log while it was starting up:
####<Jun 28, 2001 12:53:00 PM GMT+10:00> <Info> <WebLogicServer>
<pssydsun01> <myserver> <main> <> <> <000000> <IIOP subsystem enabled.>
####<Jun 28, 2001 12:53:10 PM GMT+10:00> <Info> <WebLogicServer>
<pssydsun01> <myserver> <main> <system> <> <000214> <WebLogic Server (6.0
Service Pack 2 05/24/2001 11:55:28 #117037) "myserver"
(c) 1995, 1996, 1997, 1998 WebLogic, Inc.
(c) 1999, 2000 BEA Systems, Inc.>
####<Jun 28, 2001 12:53:23 PM GMT+10:00> <Info> <JDBC Pool ora817Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Pool: 'ora817Pool'
will be tested at: '10 minute intervals.>
####<Jun 28, 2001 12:53:26 PM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 28, 2001 12:53:27 PM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 28, 2001 12:53:28 PM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 28, 2001 12:53:29 PM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 28, 2001 12:53:30 PM GMT+10:00> <Info> <JDBC Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Connection for pool
"ora817Pool" created.>
####<Jun 28, 2001 12:53:30 PM GMT+10:00> <Info> <Adapter> <pssydsun01>
<myserver> <main> <system> <> <000000> <Exception thrown by rmi
server(class weblogic.jndi.internal.RootNamingNode)
[7126974831161186990S:192.168.0.52:[7001,7001,7002,7002,7001,7002,-1]/9]:
weblogic.jndi.internal.RootNamingNode@504ec1>
javax.naming.NameNotFoundException: Unable to resolve jdbc. Resolved: ''
Unresolved:'jdbc' ; remaining name ''
at
weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:803)
at
weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
at
weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:129)
Daniel Hoppe wrote:
Hi,
it's a problem in SP1, doesn't seem to cause any harm. Afaik it's fixed
in RP1 and in SP2
Daniel
-----Urspr?ngliche Nachricht-----
Von: Jesus M. Salvo Jr. [mailto:[email protected]]
Bereitgestellt: Mittwoch, 20. Juni 2001 02:17
Bereitgestellt in: jndi
Unterhaltung: At startup: "Unable to resolve
weblogic.jdbc.connectionPool"
Betreff: At startup: "Unable to resolve weblogic.jdbc.connectionPool"
WLS 6.0 SP1 on Solaris 8
Oracle 8.1.7 using JDBC Thin driver from Oracle.
At startup of WebLogic, just after WLS creates the pool, I get a JNDI
NameNotFoundException, as shown below.
However, this does not seem to cause any problems for us.
####<Jun 20, 2001 10:16:17 AM GMT+10:00> <Info> <JDBC Pool
ora817Pool>
<pssydsun01> <myserver> <main> <system> <> <000000> <Pool:
'ora817Pool'
will be tested at: '10 minute intervals.>
####<Jun 20, 2001 10:16:20 AM GMT+10:00> <Info> <JDBC
Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000>
<Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:21 AM GMT+10:00> <Info> <JDBC
Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000>
<Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:22 AM GMT+10:00> <Info> <JDBC
Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000>
<Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:23 AM GMT+10:00> <Info> <JDBC
Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000>
<Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:24 AM GMT+10:00> <Info> <JDBC
Connection Pool>
<pssydsun01> <myserver> <main> <system> <> <000000>
<Connection for pool
"ora817Pool" created.>
####<Jun 20, 2001 10:16:24 AM GMT+10:00> <Info> <Adapter>
<pssydsun01>
<myserver> <main> <system> <> <000000> <Exception thrown by rmi
server(class weblogic.jndi.internal.RootNamingNode)
[-4918694186591914732S:192.168.0.52:[7001,7001,7002,7002,7001,
7002,-1]/9]:
weblogic.jndi.internal.RootNamingNode@1fea8a>
javax.naming.NameNotFoundException: Unable to resolve
weblogic.jdbc.connectionPool Resolved: 'weblogic' Unresolved:'jdbc' ;
remaining name 'connectionPool'
at
weblogic.jndi.internal.BasicNamingNode.newNameNotFoundExceptio
n(BasicNamingNode.java:803)
at
weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingN
ode.java:209)
at
weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamin
gNode.java:129)
at
weblogic.jndi.internal.BasicNamingNode.list(BasicNamingNode.java:496)
at
weblogic.jndi.internal.BasicNamingNode.list(BasicNamingNode.java:500)
at
weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(RootNaming
Node_WLSkel.java:230) -
My connector wants XA, Weblogic gives RMI
Hello,
First, yes I know Cloudscape may not be the best database for production and
XA, but anyway, I have to use it, and it supports XA.
Now my question :
I'm using WLS 6.1 SP1.
I defined a Cloudscape XA pool which seems to initialize well (the server
logs shows initial connections creations for the XA pool successfully). For
this pool, the driver classname I use is COM.cloudscape.core.XADataSource.
Over this pool I defined a Tx Data Source which some JNDI name, let's say
"MyXADataSource".
This works well and I can get and use connections from this "MyXADataSource"
datasource while I use it as a javax.sql.DataSource (from a BMP for
example).
However this DataSource is not XA. I mean that it does not implement
javax.sql.XADataSource (the concrete class is actually
weblogic.jdbc.common.internal.RmiDataSource). This is a problem for example
when a connector (let's say the BlackBoxXA sample connector) tries to use
this datasource as an XA datasource, leading to a ClassCastException.
So why the concrete weblogic.jdbc.common.internal.RmiDataSource class is not
an XA class ? Did I configure something wrong or forget something ?
Thanks for your help.
Jérôme.
Jérôme.
Hello,
First, yes I know Cloudscape may not be the best database for production and
XA, but anyway, I have to use it, and it supports XA.
Now my question :
I'm using WLS 6.1 SP1.
I defined a Cloudscape XA pool which seems to initialize well (the server
logs shows initial connections creations for the XA pool successfully). For
this pool, the driver classname I use is COM.cloudscape.core.XADataSource.
Over this pool I defined a Tx Data Source which some JNDI name, let's say
"MyXADataSource".
This works well and I can get and use connections from this "MyXADataSource"
datasource while I use it as a javax.sql.DataSource (from a BMP for
example).
However this DataSource is not XA. I mean that it does not implement
javax.sql.XADataSource (the concrete class is actually
weblogic.jdbc.common.internal.RmiDataSource). This is a problem for example
when a connector (let's say the BlackBoxXA sample connector) tries to use
this datasource as an XA datasource, leading to a ClassCastException.
So why the concrete weblogic.jdbc.common.internal.RmiDataSource class is not
an XA class ? Did I configure something wrong or forget something ?
Thanks for your help.
Jérôme.
Jérôme.
-
DataSource is XA but Weblogic gives RMI
Hello,
First, yes I know Cloudscape may not be the best database for production and
XA, but anyway, I have to use it, and it supports XA.
Now my question :
I'm using WLS 6.1 SP1.
I defined a Cloudscape XA pool which seems to initialize well (the server
logs shows initial connections creations for the XA pool successfully). For
this pool, the driver classname I use is COM.cloudscape.core.XADataSource.
Over this pool I defined a Tx Data Source which some JNDI name, let's say
"MyXADataSource".
This works well and I can get and use connections from this "MyXADataSource"
datasource while I use it as a javax.sql.DataSource (from a BMP for
example).
However this DataSource is not XA. I mean that it does not implement
javax.sql.XADataSource (the concrete class is actually
weblogic.jdbc.common.internal.RmiDataSource). This is a problem for example
when a connector (let's say the BlackBoxXA sample connector) tries to use
this datasource as an XA datasource, leading to a ClassCastException.
So why the concrete weblogic.jdbc.common.internal.RmiDataSource class is not
an XA class ? Did I configure something wrong or forget something ?
Thanks for your help.
Jérôme.
Thanks Priscilla,
But, so, why the BlackBoxXA connector tries to cast the datasource it
lookups to XADataSource ?
Jérôme.
"Priscilla Fung" <[email protected]> a écrit dans le message de news:
[email protected]...
> Hi,
>
> The javax.sql.XADataSource, XAConnection interfaces are for container uses
> only, and are not exposed to applications. Applications should only see
and
> use javax.sql.DataSource and java.sql.Connection etc. Refer to the JDBC
2.0
> Standard Extension spec or JDBC 3.0 spec for more info.
>
> Regards,
> Priscilla
>
> Jérôme Beau <[email protected]> wrote in message
> news:[email protected]...
> > Hello,
> >
> > First, yes I know Cloudscape may not be the best database for production
> and
> > XA, but anyway, I have to use it, and it supports XA.
> >
> > Now my question :
> >
> > I'm using WLS 6.1 SP1.
> >
> > I defined a Cloudscape XA pool which seems to initialize well (the
server
> > logs shows initial connections creations for the XA pool successfully).
> For
> > this pool, the driver classname I use is
COM.cloudscape.core.XADataSource.
> >
> > Over this pool I defined a Tx Data Source which some JNDI name, let's
say
> > "MyXADataSource".
> >
> > This works well and I can get and use connections from this
> "MyXADataSource"
> > datasource while I use it as a javax.sql.DataSource (from a BMP for
> > example).
> >
> > However this DataSource is not XA. I mean that it does not implement
> > javax.sql.XADataSource (the concrete class is actually
> > weblogic.jdbc.common.internal.RmiDataSource). This is a problem for
> example
> > when a connector (let's say the BlackBoxXA sample connector) tries to
use
> > this datasource as an XA datasource, leading to a ClassCastException.
> >
> > So why the concrete weblogic.jdbc.common.internal.RmiDataSource class is
> not
> > an XA class ? Did I configure something wrong or forget something ?
> >
> > Thanks for your help.
> >
> > Jérôme.
> >
> >
>
>
-
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.
Maybe you are looking for
-
I have uploaded an excel file from my desk top to the Windows Live (HOTMAIL?) office suite. When I try to open the file I get an error that says my system is not supported. My system passes all of the listed criteria except for one. That is a plug in
-
Windows Vista 64, MP3 Player Recovery Tool for Creative MP3 Players, Zen Nano P
Hi, On this page : http://fr.europe.creative.com/landing/MP3PlayerRecoveryTool/welcome.asp we can read : "Vous devez disposer de Windows XP? 32 bits ou Windows Vista? 32 bits." I have Windows Vista 64 bits and I need to use the recovery tool. What am
-
Problems booting from install disk with MacBook Air
(I'm posting this here b/c it's been three days since I posted this in the /MacBook Air/Networking section and no one's touched it...) Somehow, the hard disk in my MBA has been corrupted, or something. First symptom I noticed - when booting up, I get
-
Computer Crashed, need to reload Itunes
Hi, My computer crashed and it looks like I'm going to have to reformat my harddrive. I am going to attempt to slave the h/d to another pc in order to save some of my files before I reformat. Will saving my entire Itunes directory, installing Itunes
-
Keyfigures values are not displaying
Hi Experts, There is an issue that when the user is trying to execute the report (maybe workbook) he is not able to see the keyfigures values.Keyfigures are not hidden and they are in display mode in designer.He is getting blank values But when I exe