Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Error while trying to run IntelliJ UnitTest Debugger

AEMWizard
Level 4
Level 4

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>

 

1 Accepted Solution
milind_bachani
Correct answer by
Level 5
Level 5

Hi @AEMWizard ,

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


View solution in original post

1 Reply
milind_bachani
Correct answer by
Level 5
Level 5

Hi @AEMWizard ,

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