Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] problem with "Access restriction" from compiler

I was reading the thread below along with bug 369187 & bug 367431 however I am still having issues with compiling the source.

One of our bundles uses the packages com.sun.java.swing.plaf.motifcom.sun.java.swing.plaf.windows (not my decisions and would like to remove).  I was able to create the bundle fragment extension, but when I run our Hudson build job it still fails with: 
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.17.0:compile (default-compile) on project com.sample.project: Compilation failure: Compilation failure:
[ERROR] /var/lib/hudson/jobs/Project/workspace/com.sample.project/src/com/sample/project/ui/TDateComboBox.java:[61,0]
[ERROR] import com.sun.java.swing.plaf.motif.MotifComboBoxUI;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I've also tried update our com.sample.project bundle to reflect a required execution environment of JavaSE-1.6:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

This produces errors in the workbench environment (as expected).  So I exported our bundle fragment extension and added the jar to our target platform, but I still receive the workbench compilation errors.
Access restriction: The type MotifComboBoxUI is not accessible due to restriction on required library C:\Program Files\Java\jdk1.7.0_10\jre\lib\rt.jar

So I am a little stuck...  The bundle fragment extension is the same fragment Cristiano uploaded, except with c.s.j.s.p.motif & c.s.j.s.p.windows.  Attached is a sample project displaying my troubles.

Any assistance would be greatly appreciated.

Thanks,

JD


In reply to:

Tom, 

As the red message says, a fragment must not have a bundle activator... remove this sentence: "Bundle-Activator" from your manifest...

A fragment doesn't have it own lifecycle, it is tied to the its host.

about the first green problem... be aware that in PDE you certainly will get errors... unless you install the suggested fragment on your target platform..



On 04/01/12 16:50, Tom Brus wrote:
No luck yet....

I tried to put 

com.sun.xml.internal.bind.marshaller

in the Import-Package section of the manifest: manual eclipse does not allow me and if I put it in the manifest forcefully, I get an error (both from manual eclipse and Tycho). Am I doing something wrong here?

The other suggestion, putting this in the manifest:

Fragment-Host: org.eclipse.osgi;extension:=framework

also does not work: I am getting the error:

A fragment must not declare a bundle activator

any other suggestions....

Tom


On Wed, Jan 4, 2012 at 16:48, Cristiano Gavião <cvgaviao@xxxxxxxxx> wrote:
One question:

the bundle that is accessing this api has a Import-Package to where NamespacePrefixMapper is located ?



On 04/01/12 12:30, Tom Brus wrote:
Hi list,

I am trying to move from Tycho 0.12.0 to 0.14.0-SNAPSHOT (I need some feature fixed in 14).

My project builds just fine under 0.12.0.

When I use 0.14.0-SNAPSHOT I get the following error from the java compiler:

Access restriction: The type NamespacePrefixMapper is not accessible due to restriction on classpath entry /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar

Indeed, my source uses NamespacePrefixMapper and indeed that should not be done.

But why does that suddenly break the build? Or maybe I should ask: why did it not break under 0.12.0?

To fix that I tried to put the following in my pom:

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<ve
rsion>0.14.0-SNAPSHOT</version>
<configuration>
<compilerArgument>
-XDignore.symbol.file=true</compilerArgument>
</c
onfiguration>
</plugin>
</plugins>
</build>


but this does not fix it. I verified that the option is passed to the plugin, the logging shows:

...
[DEBUG]   (f) compileSourceRoots = [.....]
[DEBUG]   (f) compilerArgument = -XDignore.symbol.file=true
[DEBUG]   (f) compilerId = jdt
...

Furthermore I see the following line in the log, which was not there in 0.12.0, does that give a clue:

[DEBUG]   (f) useJDK = SYSTEM

Any ideas?

Thanks,
Tom


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user

Attachment: sample_project.zip
Description: Zip archive


Back to the top