Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 184867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:22:07+00:00 2026-05-11T15:22:07+00:00

I’m working with a legacy WebLogic application that contains a web-service application and a

  • 0

I’m working with a legacy WebLogic application that contains a web-service application and a standalone, command-line application. Both need access to a common database and I would like to try and get the command-line application use a pooled connection to the web-server’s JDBC connection. (The standalone application can only be run when the server is active and both will be run on the same physical machine.)

I’ve been trying to use a JNDI lookup to the JDBC driver as follows:

try {     Context ctx = null;     Hashtable ht = new Hashtable();     ht.put(Context.INITIAL_CONTEXT_FACTORY,            'weblogic.jndi.WLInitialContextFactory');     ht.put(Context.PROVIDER_URL, 't3://localhost:7001');      ctx = new InitialContext(ht);     DataSource ds = (DataSource) ctx.lookup ('dbOracle');     Connection conn = null;     conn = ds.getConnection();  // <-- Exception raised here     // conn = ds.getConnection(username, password); // (Also fails)      // ...  } catch (Exception e) {     // Handle exception... } 

I’ve confirmed the JNDI name is correct. I am able to connect to the database with other web-applications but my standalone application continues to have difficulties. – I got the idea for this from a WebLogic app note.

Any ideas on what I have overlooked?

EDIT 1.1: I’m seeing a ‘java.lang.ClassCastException: java.lang.Object’ exception.

EDIT 2: When I perform the following:

Object dsObj = ctx.lookup('dbOracle'); System.out.println('Obj was: ' + dsObj.getClass().getName()); 

In the standalone-application, it reports:

'Obj was: weblogic.jdbc.common.internal._RemoteDataSource_Stub' 

I attempted to test the same chunk of code (described in original question) in the web-application and was able to connect to the datasource (i.e. it seems to ‘work’). This working test reports:

'Obj was: weblogic.jdbc.common.internal.RmiDataSource' 

Also, here’s a stack-trace for when it’s failing:

####<Apr 22, 2009 10:38:21 AM EDT> <Warning> <RMI> <mlbdev16> <cgServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1240411101452> <BEA-080003> <RuntimeException thrown by rmi server: weblogic.jdbc.common.internal.RmiDataSource.getConnection()  java.lang.ClassCastException: java.lang.Object. java.lang.ClassCastException: java.lang.Object     at weblogic.iiop.IIOPOutputStream.writeAny(IIOPOutputStream.java:1584)     at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2222)     at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)     at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)     at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:225)     at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)     at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1957)     at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1992)     at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2253)     at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)     at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)     at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)     at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:479)     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)     at weblogic.security.service.SecurityManager.runAs(Unknown Source)     at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)     at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:59)     at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)     at weblogic.work.ExecuteThread.run(ExecuteThread.java:172) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:22:08+00:00Added an answer on May 11, 2026 at 3:22 pm

    This exception looks like it is generated on the server side. The first thing I would do is verify the version of WebLogic Server and check the classpath of the client application. You need to make sure your client app has the same version of the WebLogic client jar files as the WebLogic Server. You are including weblogic client jar files in the classpath of your client, right? Since your are using WebLogic’s RMI driver, I don’t believe you need any Oracle jar files in the classpath of the client. Your client is essentially speaking RMI to the WebLogic Server. The WebLogic Server connection pool you configured knows how to speak to Oracle. It shouldn’t matter what JDBC driver you use in your connection pool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want use html5's new tag to play a wav file (currently only supported
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.