Error while trying to run IntelliJ UnitTest Debugger | Community
Skip to main content
Level 6
December 16, 2021
Solved

Error while trying to run IntelliJ UnitTest Debugger

  • December 16, 2021
  • 1 reply
  • 634 views

While running a UnitTest debugger, I am getting this error


Error:osgi: [site.core] Classes found in the wrong directory: {META-INF/versions/9/javax/xml/bind/ModuleUtil.class=javax.xml.bind.ModuleUtil}

How do I solve this?

 

There is nothing on Google that can help me.

 

 

Java 11, and we are not using any bnd-maven-plugin; does not exist. 

we are using:

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by milind_bachani

Hi @supportmember ,

I read certain articles on this when you reported on previous thread and seems like we face such issue where we have multi-release JARs.
I found some ugly workarounds mentioned here :
https://github.com/bndtools/bnd/issues/2227
https://issues.apache.org/jira/browse/FELIX-5592

I would recommend you to add bnd-mvn-plugin dependency as well in your project post that you can add fix-ups in the configuration as mentioned in the JIRA ticket shared above.

<configuration>
            <instructions>
              <_fixupmessages>"Classes found in the wrong directory";is:=warning</_fixupmessages>
            </instructions>
          </configuration>

Another ugly fix would be to search for older releases which doesn't have such multi version jars.

I tried adding the jaxb-api with Java8 & Java11,and tried debugging test classes in Intellij but worked fine for me. However, I dont have a servlet using the imported api, I can test further if you can share the servlet as well or if you want we can connect for depth digging of the issue.

Thanks


1 reply

milind_bachani
Adobe Employee
milind_bachaniAdobe EmployeeAccepted solution
Adobe Employee
December 17, 2021

Hi @supportmember ,

I read certain articles on this when you reported on previous thread and seems like we face such issue where we have multi-release JARs.
I found some ugly workarounds mentioned here :
https://github.com/bndtools/bnd/issues/2227
https://issues.apache.org/jira/browse/FELIX-5592

I would recommend you to add bnd-mvn-plugin dependency as well in your project post that you can add fix-ups in the configuration as mentioned in the JIRA ticket shared above.

<configuration>
            <instructions>
              <_fixupmessages>"Classes found in the wrong directory";is:=warning</_fixupmessages>
            </instructions>
          </configuration>

Another ugly fix would be to search for older releases which doesn't have such multi version jars.

I tried adding the jaxb-api with Java8 & Java11,and tried debugging test classes in Intellij but worked fine for me. However, I dont have a servlet using the imported api, I can test further if you can share the servlet as well or if you want we can connect for depth digging of the issue.

Thanks