RE: Porting to L7.2 Unresolved requirement: Import-Package

thumbnail
alex wom, modified 5 Years ago. Regular Member Posts: 218 Join Date: 5/4/09 Recent Posts
I'm porting an OSGI module to Liferay 7.2 CE, at module start I receive Unresolved requirement: Import-Package: com.sun.org.apache.xml.internal.utils.I know how to resolve the problem "Unresolved requirement" in this case the problem is the package com.sun.org.apache.xml.internal.utils. In Liferay 7.0 I didn't have this problem and the jar seems not available anywhere.
thumbnail
Dominik Marks, modified 5 Years ago. Regular Member Posts: 149 Join Date: 8/29/12 Recent Posts
In general you should not rely on internal classes like "com.sun.org.apache.xml.internal.utils". Those may be changed or removed in later Java versions.
If you do not use that package explicitly in your code, maybe some of the dependencies of your module use it. You can exclude the import of packages in your bnd.bnd file like this:
Import-Package: !com.sun.org.apache.xml.internal.utils,*
Note the "*" at the end. That is required so that the bndtools still analyse all the other imports in your module.