10

I got the following error when I am trying to check coverage using EclEmma, please help me out:

Error while loading coverage session (code 5001). Error while analyzing package fragment root java at F/solo-repository/target/test-classes (code 5007). File not found: D:\RDM Services\solo-repository\target\test-classes\com\charter\solo\account\repository\AccountBillInformationRepositoryTest.class. D:\RDM Services\solo-repository\target\test-classes\com\charter\solo\account\repository\AccountBillInformationRepositoryTest.class (The system cannot find the path specified)

RCB
  • 775
  • 1
  • 6
  • 29

9 Answers9

9

I had the same error. The suggestions in this answer did not fix it for me. The thing that finally did fix it was:

  • Right click a source folder and select Build Path > Configure Output Folder...
  • Select "Project's default output folder" (even if it happens to be the same path entered in "Specific output folder")
  • Click OK
  • Refresh the project

It seems a bit nonsensical, but did the trick for me.

RCB
  • 775
  • 1
  • 6
  • 29
  • FWIW, in a similar case an exception trace correctly named a Java source file that had gone missing, and, actually, I had re-generated Java sources after changing a name. But the original `.class` file was still present in the output folder. Deleting the stale file and refreshing the source package view fixed it. – B98 Jun 03 '18 at 10:28
  • I faced this issue while running the junits. So I added junit jar in the libraries and the issue was resolved. – PriyaS Aug 12 '22 at 04:54
5

I had similar problem. This is what I did.

  1. Refreshed the project.
  2. Updated the maven project.
  3. Configured the Coverage. You may want to include some additional jars if you are trying to get the coverage over some dependencies.

It worked for me.

Gray
  • 115,027
  • 24
  • 293
  • 354
Priyesh
  • 131
  • 1
  • 1
  • 12
3

I had the exact same problem, here is how i fixed it:

  • Update maven project
  • Build the project with mvn clean install and make sure 'Skip Tests' is unchecked
  • Now run the coverage

The reason for this error is that it can't find the class in the target folder which it won't until you build the project along with all the test case class files that you want coverage on. Hope this helps!

JavaGeek
  • 475
  • 5
  • 14
1

another tips that work for me was delete the temporal eclipse folder .metadata... etc.

Then i delete my project from my Workspace(Not the disk), I have imported the project again en voila !! Its Work my coverage!!!!

1

Simply Cleaning or Updating the project works in most of the cases!

  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 10 '22 at 07:12
0

This worked for me.

Right click a source folder select Build Path > Configure Output Folder... Select "Project's default output folder" (even if it happens to be the same path entered in "Specific output folder") Click OK Refresh the project.

Swaty
  • 59
  • 1
  • 1
0

Keep 'skip test' checkbox un-checked during project build using eclipse-maven plugin. And after that run the coverage. This worked for me.

Salman
  • 11
0

for me just go to source(below build path) and click on format and its fine.

-1

Go to Coverage Configurations-> select only required one.