Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Error "the JAR file db2jcc.jar has no source attachment"

 
Ranch Hand
Posts: 193
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have imported a working project to my local system however when I try to run it or debug it I get the error "the JAR file db2jcc.jar has no source attachment".
Here are my troubleshooting steps:
  • I removed all the JAR files from my build path and then added them back in to ensure they were the ones on my local system
  • Ensured the JAR files were the same size as the working ones in the remote system
  • Ensured the project actually runs on a different system


  • Not sure where to go from here as it seems to work just fine on other systems.

    Any suggestions?
     
    Saloon Keeper
    Posts: 2688
    342
    Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Is this error message coming from Eclipse?
     
    John Morgan
    Ranch Hand
    Posts: 193
    2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Ron McLeod wrote:Is this error message coming from Eclipse?



    Yes
     
    Ron McLeod
    Saloon Keeper
    Posts: 2688
    342
    Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    What do you see in the Java Build Path section for that library?  Does it show that there is a source attachment?

     
    John Morgan
    Ranch Hand
    Posts: 193
    2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Ron McLeod wrote:What do you see in the Java Build Path section for that library?  Does it show that there is a source attachment?



    Mine looks exactly like the picture you posted... checking the other machine.
     
    John Morgan
    Ranch Hand
    Posts: 193
    2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Confirmed that it is the same on both PCs with this code and the JREs are the same.
     
    Master Rancher
    Posts: 4223
    47
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Do you have the source jar for this code?

    Note: since this is the JDBC driver for DB2 it's quite possible IBM has not made the source code available.
    This is often the case for proprietary databases.
     
    John Morgan
    Ranch Hand
    Posts: 193
    2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Dave Tolls wrote:Do you have the source jar for this code?

    Note: since this is the JDBC driver for DB2 it's quite possible IBM has not made the source code available.
    This is often the case for proprietary databases.



    That was my first thought except it works fine on one PC with the same version of eclipse as I am running on a second. I do not believe this is a configuration issue more than driver issue.
     
    Dave Tolls
    Master Rancher
    Posts: 4223
    47
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Then I would guess the other one has access to the source code?

    Does the source code in the Elipse that has the source look like proper (valid) source code, or does it look like it might be decompiled code?
    Just wondering if that one has some decompiler plugin at work.
     
    John Morgan
    Ranch Hand
    Posts: 193
    2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Sorry for the delayed response... real life stuff got in the way.
    Not sure what was changed but after I came back from some time off I started up my PC and eclipse and low and behold the error is gone. I guess my system needed a break too.

    Dave Tolls wrote:Then I would guess the other one has access to the source code?

    Does the source code in the Elipse that has the source look like proper (valid) source code, or does it look like it might be decompiled code?
    Just wondering if that one has some decompiler plugin at work.

     
    Bartender
    Posts: 21003
    128
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    John Morgan wrote:

    Dave Tolls wrote:Do you have the source jar for this code?

    Note: since this is the JDBC driver for DB2 it's quite possible IBM has not made the source code available.
    This is often the case for proprietary databases.

    .



    I'm virtually certain that IBM has not made the source code available. Their days of freely publishing source ended somewhere around 1985, With some exceptions, such as Eclipse, which used to be an IBM product itself.

    In fact, the internal structures in a DB2 JDBC stacktrace are about as cryptic as you can get. So, in other words, there never was a source attachment anywhere.

    My best guess on the message is that it got triggered because either an exception was thrown from the DB2 driver or an attempt was made to step into or breakpoint something in the driver (which can happen accidentally if the source and executable are out of sync).

    Any time you attempt to examine Java code relating to a compiled class, Eclipse is going to attempt to match the class binary back to the class source. If there is no correlation on file, it will ask you to make one. Obviously if there is no available source code, that's going to lead nowhere, but the message is not so much an error as it is an indication that you're out of luck in examining the indicated source statements and you'll just have to live with it.
     
    I've never won anything before. Not even a tiny ad:
    create, convert, edit or print DOC and DOCX in Java
    https://products.aspose.com/words/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!