• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NoClassDefFoundError for driver in db2java.zip

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Windows 2000, WAS Express 5.0.2, WSAD5.1

I have deployed my first application with some servlets in WAS5.0.2 as an ear with only a web-module in it. jars and zips that this application uses are under WEB-INF/lib directory. This lib also has db2java.zip that the seemingly missing class is in! I am stumped why lib directory is not being looked up! I printed "java.class.path" in a SnoopServlet and was surprised to find that none of the jars under WEB-INF/lib are listed! A section of error-trace is included below.

I'll appreciate any help.


java.lang.NoClassDefFoundError: COM/ibm/db2/jdbc/app/DB2Driver
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java(Compiled Code))
at com.company.database.DatabaseConnectionPool.makeNewConnection(DatabaseConnectionPool.java:686)


Thanks
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Double check Properties --> Java Build Path --> Libraries that the jars/zips in /lib are listed. If they are and its still failing, try dropping db2jcc.jar (newer DB2 driver) in there too.
 
Anne Forumer
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply.

But that won't help because our application is looking for COM/ibm/db2/jdbc/app/DB2Driver and db2jcc.jar has com/ibm/db2/jcc/DB2Driver!

Any comments?

Do you know if "zip" in db2java.zip, instead of "jar" could be causing problems? I have seen some mention of it in other postings.

What else could I do to test?

Thanks
 
emm raha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't really think of what the issue could be - zip/jar shouldn't matter. How have you created the datasource on your server instance? I did the following which worked for me:
(1) JDBC Provider - DB2 Universal JDBC Driver Provider
(2) make sure the DB2UNIVERSAL_JDBC_DRIVER_PATH is set
(3) drop db2jcc.jar into the project's lib folder, for some reason it can't see it if its elsewhere

HTH.
 
Anne Forumer
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not using a datasource created in AppServer. I am porting a working application from WAS3.5. The application has it's own datasource and connection-pooling.

By the way, do you know if there is a faster way to "export" an application to ear in WSAD5.1. When I export it seems to rebuild the application from scratch, which takes a long time.

Thanks for your help.
 
emm raha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm all out of suggestions - last resort you could create the datasources on the server instance and edit your code to do JNDI lookups for the datasources.
 
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic