Web Server forum
Back To The Forum Home!Search!Private Messaging System

This is Interesting: Free IT Magazines Now Free shipping to   
Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Application Server > WebSphere 6.0 exception with JDBC datasource (com.ibm.db2.jcc.SQLJContext)




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    WebSphere 6.0 exception with JDBC datasource (com.ibm.db2.jcc.SQLJContext)  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-05 11:09 PM

I'm running Websphere 6.0 with Rational Application Developer 6. I define a 
JDBC DB2 data source and a resource reference (name: test),
then I use a servlet to get the data source and connection, with the code be
low:

try {
InitialContext icx = new InitialContext();
DataSource dataSource =(DataSource)icx.lookup( "java:comp/env/test");
Connection con=dataSource.getConnection("user","password");
con.close();
} catch (Exception e) {
e.printStackTrace();
}

The code throws the exception below:

Exception thrown : java.lang.NoClassDefFoundError: com.ibm.db2.jcc.SQLJConte
xt
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:211)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:147)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:474)
at java.net.URLClassLoader.access$500(URLClassLoader.java:108)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:846)
at java.security.AccessController.doPrivileged(AccessController.java:218)
at java.net.URLClassLoader.findClass(URLClassLoader.java:370)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:103)
at java.lang.ClassLoader.loadClass(ClassLoader.java:601)
at java.lang.ClassLoader.loadClass(ClassLoader.java:560)
at com.ibm.ws.rsadapter.spi.InternalDB2UniversalDataStoreHelper.createJDBCCo
 nnectionWrapper(InternalDB2UniversalData
StoreHelper.java:348)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.getConnection(WSRdbMa
nagedConnectionImpl.java:2559)
at com.ibm.ejs.j2c.MCWrapper.getConnection(MCWrapper.java:1664)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.ja
va:580)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource
.java:328)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource
.java:506)
at sample.Test.doPost(Test.java:44)
at sample.Test.doGet(Test.java:27)

I could not find anywhere the class com.ibm.db2.jcc.SQLJContext, nor is ment
ioned in any WAS/DB2 documentation. The data source has been tested from WAS
 administration and works correctly, and the code & configuration above work
s perfectly on WAS 5.1.x ,
with the same DB2 drivers and configurations. Does anybody have any idea of 
what could be causing this problem ?





[ Post a follow-up to this message ]



    Re: WebSphere 6.0 exception with JDBC datasource (com.ibm.db2.jcc.SQLJContext)  
Ken Hygh


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-11-05 11:09 PM

paolo_dettori@hotmail.com wrote:

>I'm running Websphere 6.0 with Rational Application Developer 6. I define a
 JDBC DB2 data source and a resource reference (name: test),
>then I use a servlet to get the data source and connection, with the code b
elow:
>
>try {
>  InitialContext icx = new InitialContext();
>  DataSource dataSource =(DataSource)icx.lookup( "java:comp/env/test");
>  Connection con=dataSource.getConnection("user","password");
>  con.close();
>} catch (Exception e) {
>	e.printStackTrace();
>}
>
>The code throws the exception below:
>
>Exception thrown : java.lang.NoClassDefFoundError: com.ibm.db2.jcc.SQLJCont
ext
>	at java.lang.ClassLoader.defineClassImpl(Native Method)
>	at java.lang.ClassLoader.defineClass(ClassLoader.java:211)
>	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:147)
>	at java.net.URLClassLoader.defineClass(URLClassLoader.java:474)
>	at java.net.URLClassLoader.access$500(URLClassLoader.java:108)
>	at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:846)
>	at java.security.AccessController.doPrivileged(AccessController.java:218)
>	at java.net.URLClassLoader.findClass(URLClassLoader.java:370)
>	at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:103)
>	at java.lang.ClassLoader.loadClass(ClassLoader.java:601)
>	at java.lang.ClassLoader.loadClass(ClassLoader.java:560)
>	at com.ibm.ws.rsadapter.spi.InternalDB2UniversalDataStoreHelper.createJDBC
 ConnectionWrapper(InternalDB2UniversalDa
taStoreHelper.java:348)
>	at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.getConnection(WSRdb
ManagedConnectionImpl.java:2559)
>	at com.ibm.ejs.j2c.MCWrapper.getConnection(MCWrapper.java:1664)
>	at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.
java:580)
>	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSour
ce.java:328)
>	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSour
ce.java:506)
>	at sample.Test.doPost(Test.java:44)
>	at sample.Test.doGet(Test.java:27)
>
>I could not find anywhere the class com.ibm.db2.jcc.SQLJContext, nor is mentioned i
n any WAS/DB2 documentation. The data source has been tested from WAS administration
 and works correctly, and the code & configuration above works perfectly on WAS 5.1.
x ,
with the same DB2 drivers and configurations. Does anybody have any idea of what could be ca
using this problem ?
>
>
Looks like it's in DB2's db2jcc.jar in my DB2 8.2 installation
Ken





[ Post a follow-up to this message ]



    Re: WebSphere 6.0 exception with JDBC datasource (com.ibm.db2.jcc.SQLJContext)  
Mike Burmeister


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-12-05 11:03 PM

You need to have DB2 8.1.6 or higher or you will get this message. This
class will be in the jar file if you have version 8.1.6 or higher.

Mike

"Ken Hygh" <kenhygh@nc.rr.com> wrote in message
news:d3ej74$6st2$1@news.boulder.ibm.com...
> paolo_dettori@hotmail.com wrote:
> 
> Looks like it's in DB2's db2jcc.jar in my DB2 8.2 installation
> Ken







[ Post a follow-up to this message ]



    Re: WebSphere 6.0 exception with JDBC datasource (com.ibm.db2.jcc.SQLJContext)  
vikas_kumar_24


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-13-05 01:03 PM

Hi Guys,
The same problem i am also getting. I am able to connect to the datasource c
reated through the Websphere Admin Console, and the same setup worked with W
ebsphere 5.1.

1. I am not able to locate that com.ibm.db2.jcc.SQLJContext class in DB28.1.
2 Jars.
2. I tried locating the aboce class in Websphere jars( actually not supposed
 to be here).
3. The only point that looks to be possible is that With Wesphere's 6.0 impl
ementation of DataSource, it looks for that class at the Client side.

So any thing with respect to DB2cc.jar or anything new from DB2 shipped, whe
re we can find the above class?

Rgds
Vikas





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:18 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

Back To The Top
Home | Usercp | Faq | Register