0

Here I'm getting Access restriction error while building my multi-module maven project.

Adding the error details:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project my.project.ui.core.communication: Compilation failure: Compilation failure:
[ERROR] C:\HOME\SOME_DIR\my.project.ui.core.communication\src\my\project\ui\core\communication\logic\RequirementLibraryDelegate.java:[474]
[ERROR] LOGGER.severe(IRequirementLibraryLogIds.REQLIBMSGID0009, e.getMessage() + e);
[ERROR] ^^^^^^^^^^^^^^
[ERROR] Access restriction: The method 'EJBException.getMessage()' is not API (restriction on classpath entry 'C:\HOME\SOME_DIR\my.project.common.server\lib\j2ee.jar')

Reference which i have already tried: Access restriction: Is not accessible due to restriction on required library ..\jre\lib\rt.jar

Can anyone help me on this?

Thanks in advance :)

Ashwani
  • 485
  • 2
  • 9
  • 23

1 Answers1

0

Try to set the following target in pom.xml.

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

If it doesn't help, use in MANIFEST.MF a specific OSGi depedency via Import-Package like this:

Import-Package: org.eclipse.jface.contentassist
batinex
  • 33
  • 8