Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java.lang.NoClassDefFoundError: Weblogic looks for wrong drivers

38 views
Skip to first unread message

vas pulipati

unread,
Jun 26, 2003, 1:00:27 PM6/26/03
to

Hi all,
I have a strange problem with weblogic. I use weblogic7.0 with MS SQLServer database.
All my jdbc related code from anywhere within my web application works without
a problem.
But when I try to access the database as a client using weblogic's datasource(obtained
by JNDI lookup), I get the NoClassDefFoundError. Weblogic seems to be looking
for some Oracle drivers strangely, where as I don't have any thing related to
Oracle at all. It breaks on getConnection() call on data source. My connection
pool and data source are defined properly and I have the JDBC drivers for SQLServer
in weblogic's classpath and also in client's classpath(although not required).
Again, all the database access code within my session beans using the same datasource
works fine. Weblogic server and the client application are running on the same(local)
machine.

Any help would be appreciated.

Thanks in advance.
Vas

Here's the stack trace.
------------------------------------------
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleStatement
at java.lang.Class.getMethods0(Native Method)
at java.lang.Class.getMethods(Class.java:737)
at weblogic.rmi.utils.Utilities.getRemoteMethods(Utilities.java:382)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:79)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:60)
at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:637)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:656)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:651)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:59)
at weblogic.common.internal.RemoteObjectReplacer.resolveObject(RemoteObjectReplacer.java:249)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:134)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectStreamClass.invokeMethod(ObjectStreamClass.java:1610)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:388)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:140)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:91)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:161)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:128)
at weblogic.jdbc.common.internal.RmiDataSource_WLStub.getConnection(Unknown Source)
at com.actiontech.jmetro.server.core.DBSession.executeQuery(DBSession.java:109)
at com.actiontech.jmetro.server.query.NamespaceMappings.loadMappings(NamespaceMappings.java:76)
at com.actiontech.jmetro.server.query.NamespaceMappings.<init>(NamespaceMappings.java:56)
at com.actiontech.jmetro.server.query.NamespaceMappings.getInstance(NamespaceMappings.java:50)
at com.actiontech.jmetro.server.query.NamespaceMappingsTest.testSave(NamespaceMappingsTest.java:21)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:360)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:246)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:146)


vas pulipati

unread,
Jun 26, 2003, 1:00:42 PM6/26/03
to

Slava Imeshev

unread,
Jun 26, 2003, 1:29:41 PM6/26/03
to
Hi Vas,

Make sure you have classes12.zip available for eclipse classloader. Try just
making it a part of classpath.

Regards,

Slava Imeshev

"vas pulipati" <vpul...@actiontech.com> wrote in message
news:3efb26ba$1...@newsgroups.bea.com...

Joseph Weinstein

unread,
Jun 26, 2003, 1:38:25 PM6/26/03
to vas pulipati

vas pulipati wrote:

> Hi all,
> I have a strange problem with weblogic. I use weblogic7.0 with MS SQLServer database.
> All my jdbc related code from anywhere within my web application works without
> a problem.
> But when I try to access the database as a client using weblogic's datasource(obtained
> by JNDI lookup), I get the NoClassDefFoundError.

Would you please show me your jdbc code? Are you using our pools and datasources?
Let me see your pool definition.
thanks,
Joe

vas pulipati

unread,
Jun 26, 2003, 2:18:56 PM6/26/03
to

Excellent, it works!
So its a problem with Eclipse IDE?
I understand that jdbc drivers should be in eclipse's classpath as the client
code
does something with ResultSet etc.(I was wrong before)
But, why is eclipse looking for Oracle classes? My database is SQL Server, and

I have the jdbc driver for SQL server in eclipse classpath.

Thanks a lot for the help.

Vas

>..java:146)
>>
>>
>
>

vas pulipati

unread,
Jun 26, 2003, 2:39:57 PM6/26/03
to

Joseph,
Here's my connection pool and data source definitions-

<JDBCConnectionPool CapacityIncrement="2"
DriverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
InitialCapacity="4" LoginDelaySeconds="1"
Name="MyJDBC Connection Pool" Password="{3DES}WBgxI691AWU="
PreparedStatementCacheSize="10"
Properties="user=jmetro;database=jmetro" RefreshMinutes="1"
SupportsLocalTransaction="true" Targets="myserver"
TestTableName="AW_PROCESS" URL="jdbc:microsoft:sqlserver://localhost:1433;selectMethod=cursor"/>
<JDBCTxDataSource JNDIName="JMetroJDBCDataSource"
Name="MyJDBC Tx Data Source" PoolName="MyJDBC Connection Pool" Targets="myserver"/>


Its hard present the jdbc code here as its spread over multiple classes.
Basically I use an abstraction class DBSession that looks for data source
by JNDI name 'JMetroJDBCDataSource', gets connection with getConnection()
call on the data source, and uses it to execute statements.

conn = ds.getConnection(); // ds is obtained by JNDI lookup
stmt = conn.createStatement();
rs = stmt.executeQuery(sqlString);

vas pulipati

unread,
Jun 26, 2003, 2:28:04 PM6/26/03
to

I would like to correct myself again-
Its weblogic's classes that are looking for Oracle drivers(of course eclipse has
nothing to do with it). But, I still don't understand why weblogic looks for Oracle
classes. Can you please explain?

Thanks

vas pulipati

unread,
Jun 26, 2003, 4:24:40 PM6/26/03
to

I guess the mistery here is why do weblogic stubs use Oracle jdbc classes?
As you can see there's person from BEA trying to resolve this, so lets hope we
get this clear very soon.

Thanks again for you help. The response was much quicker than I expected.
I have another unresolved jdbc/weblogic problem, I'll post it here soon with all
the stack trace.

Vas

"Slava Imeshev" <ime...@yahoo.com> wrote:
>"vas pulipati" <vpul...@actiontech.com> wrote in message

>news:3efb3910$1...@newsgroups.bea.com...
>> Excellent, it works!
>
>Glad to help.


>
>
>> So its a problem with Eclipse IDE?
>> I understand that jdbc drivers should be in eclipse's classpath as
>the
>client
>> code
>> does something with ResultSet etc.(I was wrong before)
>> But, why is eclipse looking for Oracle classes? My database is SQL
>Server,
>and
>

>It's because weblogic stubs refere to oracle classes.


>
>> I have the jdbc driver for SQL server in eclipse classpath.
>

>Regards,
>
>Slava Imeshev
>
>

vas pulipati

unread,
Jun 26, 2003, 4:13:44 PM6/26/03
to

Nope. There's no way any Oracle related settings could've gotten into config.xml.
We never even bothered about Oracle so far. We plan to work with Oracle in future
and when we do it we might see more problems, but at this point I'm very sure
that we don't have any Oracle related stuff.

Does weblogic internally use classes12.zip no matter what database you use?

Thanks

Joseph Weinstein <joe.rem...@bea.com.remove_this> wrote:
>Ok, is there any oracle stuff defined in your config.xml?
>What version of 7.0? sp2?
>thanks,
>Joe

Joseph Weinstein

unread,
Jun 26, 2003, 3:54:53 PM6/26/03
to vas pulipati
Ok, is there any oracle stuff defined in your config.xml?
What version of 7.0? sp2?
thanks,
Joe

Slava Imeshev

unread,
Jun 26, 2003, 4:00:51 PM6/26/03
to
"vas pulipati" <vpul...@actiontech.com> wrote in message
news:3efb3910$1...@newsgroups.bea.com...
> Excellent, it works!

Glad to help.


> So its a problem with Eclipse IDE?
> I understand that jdbc drivers should be in eclipse's classpath as the
client
> code
> does something with ResultSet etc.(I was wrong before)
> But, why is eclipse looking for Oracle classes? My database is SQL Server,
and

It's because weblogic stubs refere to oracle classes.

> I have the jdbc driver for SQL server in eclipse classpath.

Regards,

Slava Imeshev


vas pulipati

unread,
Jun 26, 2003, 4:34:05 PM6/26/03
to

Its 7.0.2.0

Joseph Weinstein

unread,
Jun 26, 2003, 5:15:37 PM6/26/03
to Slava Imeshev, vpul...@actiontech.com

Slava Imeshev wrote:

> "vas pulipati" <vpul...@actiontech.com> wrote in message

> news:3efb5688$1...@newsgroups.bea.com...


> > I guess the mistery here is why do weblogic stubs use Oracle jdbc classes?
> > As you can see there's person from BEA trying to resolve this, so lets
> hope we
> > get this clear very soon.
>

> Remote client gets SerialResultSet. This guy implements oracle's
> OracleResultSet. In order to load this class client classloader must
> have OracleResultSet. This class resides in classes12.zip.
>
> I don't think this "issue" can be resolved at the vesion of weblogic
> you've got.

Yep. Slava has it right on the button. For 7.X, you are going to need
some verson of the oracle driver in the client classpath, in order to
use our RMI driver for any DBMS at the WLS!
Joe

>
>
> Regards,
>
> Slava Imeshev

Slava Imeshev

unread,
Jun 26, 2003, 4:42:53 PM6/26/03
to
"vas pulipati" <vpul...@actiontech.com> wrote in message
news:3efb5688$1...@newsgroups.bea.com...

> I guess the mistery here is why do weblogic stubs use Oracle jdbc classes?
> As you can see there's person from BEA trying to resolve this, so lets
hope we
> get this clear very soon.

Remote client gets SerialResultSet. This guy implements oracle's


OracleResultSet. In order to load this class client classloader must
have OracleResultSet. This class resides in classes12.zip.

I don't think this "issue" can be resolved at the vesion of weblogic
you've got.

Regards,

Slava Imeshev


vas pulipati

unread,
Jun 26, 2003, 6:43:25 PM6/26/03
to

Thanks for the clarification.
Is this true in later versions as well? Can you please confirm?

Vas

Joseph Weinstein

unread,
Jun 26, 2003, 6:51:07 PM6/26/03
to vas pulipati

vas pulipati wrote:

> Thanks for the clarification.
> Is this true in later versions as well? Can you please confirm?

8.1 removes this restriction. In fact, could make a tiny jar that would suffice
instead of the whole oracle driver... Let me know if that helps...
Joe

vas pulipati

unread,
Jun 26, 2003, 8:08:05 PM6/26/03
to

we plan to move to 8.1 anyway, that solves the problem i guess.
In the meantime we can continue to depend on classes12.zip

Thanks a lot for all the help.

Wayne W. Scott

unread,
Jun 30, 2003, 6:41:29 PM6/30/03
to

I am working with a customer on an issue that has a slight twist to this.

They are trying to use the OracleThinClob interface and rmi extensions to work with CLOBs.

===

The method, getChars should return a character array for us to use.


However, when trying to use this method, the following error occurs.

Exception occured, first catch
blockweblogic.rmi.extensions.RemoteRuntimeExcepti
on: Unexpected Exception - with nested exception:
[java.rmi.ServerError: A error occurred the server; nested exception is:
java.lang.AbstractMethodError:
weblogic.jdbc.rmi.internal.OracleTClobImpl_
weblogic_jdbc_wrapper_Clob_oracle_sql_CLOB.getChars(JI)[C]


It seems as if this method is still defined as abstract. How do we read(get
data out) the objects cast to this interface?


===

Could this happen if they simply forgot to add an import statement?

Thanks,
Wayne Scott

Joseph Weinstein

unread,
Jun 30, 2003, 6:50:48 PM6/30/03
to Wayne W. Scott

"Wayne W. Scott" wrote:

> I am working with a customer on an issue that has a slight twist to this.
>
> They are trying to use the OracleThinClob interface and rmi extensions to work with CLOBs.
>
> ===
>
> The method, getChars should return a character array for us to use.
>
> However, when trying to use this method, the following error occurs.

Could you show me the full serverside SQLException stacktrace? It would be
in the jdbc.log file.
thanks,
Joe

0 new messages