Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Access restriction: The field 'XXX' is not API (restriction on required lib XXX) (After importing Scout project to another computer)
Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1719063] Mon, 04 January 2016 19:46 Go to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Hello and a happy new year to everybody!

I have a problem with the dependencies of my Scout project. I imported it with the wizard to a fresh version of Eclipse Mars for Scout Developers on a windows machine.
I have those dependency problems only in the mobile and the swt plugin. The server for example can be started.
I played around with the build path settings and the manifest files of the projects, but couldn't solve the problems. All access restriction problems have to do with scout-related packages.

One of 120 error descriptions as example:
Access restriction: The field 'ContributionCommand.Continue' is not API (restriction on required library 'E:\Workspaces\EclipseProjects\Scout\.metadata\.plugins\org.eclipse.pde.core\.bundle_pool\plugins\org.eclipse.scout.rt.client_5.0.100.20150902-1531.jar')

I'm wondering why it tries to access the resource in the workspace and not in the eclipse directory...

Best regards,
Jannik
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1719091 is a reply to message #1719063] Tue, 05 January 2016 07:34 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Can you please check which target platform is active?
Preferences > Plug-in development > Target Platform
index.php/fa/24485/0/

Eclipse will only take the dependencies provided in your Eclipse folder if you are using the "Running Platform" target platform.
BUT: the Eclipse RAP Framework is not available in the "Running Platform" target provided by your Eclipse IDE. This is why we have started to use an external target platform definition. You have probably a file <xxx>.target in your workspace. You should use this one.

Using target is mandatory:
* For Scout Applications using RAP
* If you want another version of Equinox/Eclipse RCP for your Application (most of the SWT I know still use Eclipse 3.8.2 as runtime platform)
* If you need libraries that are not provide by your "Running Platform"
* ...
I consider it as a good practice for all other cases.

I do not know exactly what you error is, my guess is that it is related to your target platform. Please provide more information about it (what does it contains?) and about the versions you want to use (Eclipse IDE Version, Scout Version, Eclipse RCP version for the Scout Application...)
  • Attachment: Prefs.png
    (Size: 58.45KB, Downloaded 5404 times)
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1719112 is a reply to message #1719091] Tue, 05 January 2016 11:59 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Hi,

thank you for the hint. Actually I forgot where to change the target settings. I'm sure you are right that the target definition is somehow corrupted, but I'm not able to figure what the problem is.
As you can see the elasticsearchviewer target is selected.

index.php/fa/24489/0/

The content of the target file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="elasticsearchviewer" sequenceNumber="15">
	<locations>
		<location path="${eclipse_home}\" type="Directory"/>
		<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
			<unit id="org.eclipse.rap.feature.feature.group" version="3.0.0.20150602-0950"/>
			<unit id="org.eclipse.scout.rt.rap.source.feature.group" version="5.0.0.20150610-0823"/>
			<repository location="http://download.eclipse.org/releases/mars"/>
		</location>
		<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
			<unit id="org.eclipse.osgi" version="3.10.101.v20150820-1432"/>
		</location>
		<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
			<unit id="org.eclipse.osgi" version="3.10.101.v20150820-1432"/>
		</location>
		<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
			<unit id="org.eclipse.scout.rt.client" version="5.0.100.20150902-1531"/>
		</location>
		<location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
			<unit id="org.eclipse.scout.rt.client" version="5.0.100.20150902-1531"/>
		</location>
	</locations>
	<launcherArgs>
		<vmArgs>-Xms256m -Xmx512m </vmArgs>
	</launcherArgs>
</target>


Update: Just deleted the duplicate tags. Still the same errors...

I'm using the lates Eclipse for Scout Developers (Mars) on Windows 8.1

[Updated on: Tue, 05 January 2016 14:42]

Report message to a moderator

Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722126 is a reply to message #1719112] Tue, 02 February 2016 20:54 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Hi,

It's now 4 weeks later and I couldn't figure out how to fix the access restrictions. Of course I didnt't try it the complete month, but it's still very annoying.

Here you can see my current target platform:
index.php/fa/24866/0/

The error messages (around 1000 ) are all of the type:
Access restriction: The type 'Plugin' is not API (restriction on required library 'C:\Users\userXYZ\.p2\pool\plugins\org.eclipse.core.runtime_3.11.1.v20150903-1804.jar')


So eclipse tries to load the plugins from the Equinox bundle pool in my home directory and fails due to access restrictions. I'm no expert on plugin development and can't explain why the libraries can't be accessed and if it has something to do with the target platform.

Hoping for some further help
Jannik

[Updated on: Tue, 02 February 2016 21:23]

Report message to a moderator

Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722226 is a reply to message #1722126] Wed, 03 February 2016 14:19 Go to previous messageGo to next message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 208
Registered: June 2015
Senior Member
have you already tried to change the java compiler settings according to this stackoverflow [1] post? i haven't tried this but you might have the same problem...

the setting is located on the preferences dialog
index.php/fa/24880/0/

[1] http://stackoverflow.com/questions/25222811/access-restriction-the-type-application-is-not-api-restriction-on-required-l
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722234 is a reply to message #1722226] Wed, 03 February 2016 14:57 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Thank you for your reply.
I tried this one out. But since this a compiler setting and my problems are eclipse workspace errors, in has no effect in my case.
Furthermore I would rather tackle the problem at it's roots than to avoid the symptoms by changing the rules.
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722239 is a reply to message #1722234] Wed, 03 February 2016 15:10 Go to previous messageGo to next message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 208
Registered: June 2015
Senior Member
would you be able to shared a zipped workspace that can be used to reproduce the issue at our end?
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722244 is a reply to message #1722239] Wed, 03 February 2016 15:23 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Well, I would have to prepare and send it via private message to you. I can't post it in the forum...
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722263 is a reply to message #1722244] Wed, 03 February 2016 16:11 Go to previous messageGo to next message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 208
Registered: June 2015
Senior Member
Ok, let's try. please send the download link to scout (at) bsi-software.com.
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722355 is a reply to message #1722263] Thu, 04 February 2016 09:34 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
I sent an e-mail yesterday evening. I'm not sure whether this will help, as there are many others factors that may come in to play producing my errors.
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1722363 is a reply to message #1722355] Thu, 04 February 2016 10:08 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Thanks for all this information. I hope Matthias Zimmermann will be able to help you.

My advice: you should make your target file independent from your installation. Do not use "${eclipse_home}" or any absolute path to any of your folder. Instead you should work only with P2 update sites (it will also help you, if you want to build your application with Maven & Tycho).

The target platform used in our demo application (Mars) is a good starting point: s40_e44.target (5.0.x Branch)

Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723069 is a reply to message #1719063] Thu, 11 February 2016 11:14 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
To hold this thread up to date and maybe get some additional help:

I sent Matthias my workspace and he could reproduce the same restriction erros on his system. Unlike me he somehow managed to get the project running by creating a scout project from scratch and moving over my workspace content.
At this point I want to thank him again for his efforts!

Unfortunately this hasn't helped me so far. No matter what I did, there where always serveral restriction access errors.
I tried the common solutions I found for those kinds of errors like readding the JRE library, changing the order of the plugin dependencies, set forbidden reference signal from error to warning, setup new projects in new workspaces, tried various target definitions etc., but the right combination was obviously not among them.

I promised myself the most of getting the workspace that Matthias sent me running, because I know it already worked on his system.
When I start a eclipse scout instance in this workspace the target definition doesn't work, because the "scout_rap_target" configured there points to a directory on Matthias' system. To get rid of it I changed it to point to the folder "rap_target" in my eclipse installation directory to look like this:
index.php/fa/24953/0/
Does anyone know, what to do next? I don't want to mess this workspace up too by doing something I'm not completely familiar with. So I hope for some advice. I have other workspaces and projects I can tinker with Wink

[Updated on: Thu, 11 February 2016 11:16]

Report message to a moderator

Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723093 is a reply to message #1723069] Thu, 11 February 2016 14:30 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
You can change the "scout_rap_target" by hand.

Preferences > Run/Debug > String Substitution.
Select the variable in the table and click on Edit.

The value you need is probablly
{your eclipse installation folder}/rap_target

More details: https://wiki.eclipse.org/Scout/NewAndNoteworthy/3.9#Variable_Local_RAP_Target_Location

-------------

I will try to check with Matthias, when I see him. You should definitivelly use a target file that contains only P2 Repositories. This way it will work everywhere.
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723112 is a reply to message #1723093] Thu, 11 February 2016 17:51 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Yeah, I already did that. This is what you see on the screenshot.

And in another project I created a target file like this, which is pretty much the same as in your demo target:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="elasticsearchviewer" sequenceNumber="55">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.server.jetty.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.ecore.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.common.feature.group" version="0.0.0"/>
<unit id="org.eclipse.mylyn.wikitext_feature.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/releases/mars"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.scout.rt.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.rap.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.rap.testing.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.testing.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.spec.source.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/scout/releases/5.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rap.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.rap.equinox.target.feature.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/rt/rap/3.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.apache.commons.logging" version="1.1.1.v201101211721"/>
<unit id="org.apache.commons.logging.source" version="1.1.1.v201101211721"/>
<unit id="org.apache.httpcomponents.httpclient" version="4.2.6.v201311072007"/>
<unit id="org.apache.httpcomponents.httpclient.source" version="4.2.6.v201311072007"/>
<unit id="org.apache.httpcomponents.httpcore" version="4.2.5.v201311072007"/>
<unit id="org.apache.httpcomponents.httpcore.source" version="4.2.5.v201311072007"/>
<unit id="org.apache.commons.codec" version="1.6.0.v201305230611"/>
<unit id="org.apache.commons.codec.source" version="1.6.0.v201305230611"/>
<unit id="org.junit" version="4.11.0.v201303080030"/>
<unit id="org.junit.source" version="4.11.0.v201303080030"/>
<unit id="org.hamcrest.core" version="1.3.0.v201303031735"/>
<unit id="org.hamcrest.core.source" version="1.3.0.v201303031735"/>
<unit id="org.jsoup" version="1.7.2.v201411291515"/>
<unit id="com.thoughtworks.selenium" version="2.25.0.v201212071504"/>
<unit id="com.thoughtworks.selenium.source" version="2.25.0.v201212071504"/>
<unit id="com.google.guava" version="15.0.0.v201403281430"/>
<unit id="com.google.guava.source" version="15.0.0.v201403281430"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.mockito.mockito-all" version="0.0.0"/>
<repository location="http://download.eclipse.org/scout/releases/4.0/testing"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="com.bsiag.scout.rt.ui.swing.laf.rayo.source.feature.group" version="0.0.0"/>
<repository location="http://tools.bsiag.com/marketplace/rayo/5.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.scout.docx4j.core.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.docx4j.client.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.docx4j.libs.feature.group" version="0.0.0"/>
<repository location="http://tools.bsiag.com/marketplace/docx4j/5.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.scout.logging.bridges.source.feature.group" version="0.0.0"/>
<repository location="http://tools.bsiag.com/marketplace/logging_bridge/5.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.scout.rt.server.rabbitmq.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.server.activemq.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.server.redis.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.scout.rt.server.memcached.source.feature.group" version="0.0.0"/>
<repository location="http://tools.bsiag.com/marketplace/cloud/5.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="com.bsiag.scout.rt.server.jdbc.mysql5117.source.feature.group" version="0.0.0"/>
<repository location="http://tools.bsiag.com/marketplace/jdbc/5.0"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_73"/>
<launcherArgs>
<vmArgs>-Xms256m -Xmx512m</vmArgs>
</launcherArgs>
</target>

[Updated on: Thu, 11 February 2016 18:01]

Report message to a moderator

Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723117 is a reply to message #1723112] Thu, 11 February 2016 18:56 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
In the screenshot I see 2 Folders and 0 P2 Update Sites in your target Platform:
* ${eclipse_home}: somehow broken, you have 0 plugins loaded from there.
* ${scout_rap_target}: seems to work. 23 plugins available seems good to me.

Your other target platform containing only update sites seems OK. Doesn't it work for your elasticsearchviewer workspace?
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723118 is a reply to message #1723117] Thu, 11 February 2016 19:25 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
No, unfortunately nothing works without errors...
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723143 is a reply to message #1723118] Fri, 12 February 2016 06:46 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
I can not imagine that you have exactly the same error with 2 different target platform.
Or something else is broken in your workspace.

An other thing you can try to force PDE to reload from the target platform:
* close eclipse.
* open the folder {your workspace}\.metadata\.plugins\org.eclipse.pde.core (in windows explorer)
* delete the folders: .bundle_pool, .caches and other cache folders (in .p2/org.eclipse.equinox.p2.core and .p2/org.eclipse.equinox.p2.repository)
* reopen Eclipse
* open your target file with the target editor
* wait until the editor has loaded everything (you should see the number of plugins found in each update site)
* select "Set as target platform"
* open "Project > Clean..." menu and then select "clean all projects" to force a complete rebuild.
Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723162 is a reply to message #1723143] Fri, 12 February 2016 09:28 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
I didn't mean they produce the exact same errors, but the result is pretty much the same: hundreds of erros because of access restrictions - or (as you see on the screenshot in my last post) the plugins can't even be resolved, because eclipse_home is wrong.
When setting the target with the remote locations, eclipse loads target information and rebuilds the workspace. Only client, client.mobile and the server have access errors like you see in the appended screenshot

[Updated on: Fri, 12 February 2016 09:42]

Report message to a moderator

Re: Access restriction: The field 'XXX' is not API (restriction on required lib XXX) [message #1723431 is a reply to message #1723162] Mon, 15 February 2016 15:51 Go to previous message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
With Matthias' help I found out, why I couldn't get his workspace running on my system. As you see on one of the previous screenshots, the problem was that the 'eclipse_home' target couldn't resolve any plugins, although the directory it pointed to was fine.
I found out that in the target file it was declared as a location of the type 'Directory' instead of 'Profile'.
So I deleted and readded it with the target editor via
'Add...'->select 'Installation'->'Next >'->'Variables...'->select 'eclipse_home'->'OK'->'Finish'.
This should produce the location entry
<location path="${eclipse_home}" type="Profile"/>
in the traget file.
After these fixes the workspace was running without errors. My old workspace still doesn't work with the same target file and the same eclipse installation. I don't know what's going wrong.
It would be great If I could get my old workspace running again, as there is a git repository and some other documents which I would have to carefully move over to the new workspace potentially causing new errors.

Matthias recommended to spend not too much time for the target issues and trying to migrate to Scout Neon instead. I'm not sure whether this would be sufficient for me, as I rely on a (standalone ) desktop build of my application. My latest information is that there will no longer be a desktop renderer in Scout Neon.

[Updated on: Mon, 15 February 2016 16:45]

Report message to a moderator

Previous Topic:[NEON] CLone a git projecto to test Scout
Next Topic:[Neon] Validation on a date field
Goto Forum:
  


Current Time: Sat Apr 27 02:16:59 GMT 2024

Powered by FUDForum. Page generated in 0.04273 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top