0

I am executing a code that does some database operations.

It performs well when I execute it using the Run command in Eclipse.

But when I execute it in debug mode, I get the source not found

The JAR file mysql-connector-java-5.1.39-bin.jar has no source attachment

3 Answers 3

1

You're trying to step into code provided by mysql-connector-java, and you haven't linked in an source code for Eclipse to actually step-in-to.

The easiest thing to do would be to step over that line (since you probably don't care about it) rather than trying to debug the connector code. You may also want to tweak your debugger settings to prevent exceptions from pausing your execution.

As @nitind points out you can also filter types, packages, and patterns so the debugger avoids stepping through them.

If that doesn't work or you do need to step into the connector code you'll need to download a source jar (from Maven) and attach it in your project's build configuration.

Sign up to request clarification or add additional context in comments.

4 Comments

I keep running into such situations... I downloaded a class decompiler plugin... No I don't care about source codes :P
@dimo414 But then wouldn't the code require the source file during execution using the Run command? Where does it fetch the source code for mysql-connector then?
No, you already have the binary jar installed, but it doesn't contain any source code. Projects often distribute separate binary and source jars rather than one much larger jar containing both to reduce file sizes.
To clarify a little more, it only wants the source when debugging specifically to show it to you as you step through it. You can have it just not bother trying to step into those classes by enabling and listing them among your Step Filters on the Step Filtering preference page. help.eclipse.org/neon/…
0

Debugging in eclipse program works with the class actually loaded.

The problem you posted looks like the class you are using was not found in the project, but is present without debug info in a distribution jar.

This can be solved most likely by altering the build path of the project to stop using this jar and have the JVM using the project.

or you can try mvn clean eclipse:eclipse

Comments

0

This is happening because the debugger is running into some class file...

To view this, either download the source code and attach it or install some class decompiler plugin (I am using JAD Eclipse Plugin). The first solution is better.

1 Comment

Yea sure... I will link up what I use

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.