Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem: Access restriction(Whats this error and how can i solve it?)
icon5.gif  Problem: Access restriction [message #1737648] Mon, 11 July 2016 14:44 Go to next message
Felix Engl is currently offline Felix EnglFriend
Messages: 2
Registered: July 2016
Junior Member
Hello Eclipse Community,

first of all: i'm new to XText and XTend. Furthermore i'm relatively new to eclipse. (C#-Developer with Visual Studio)
Right now i'm stuck with a strange eclipse error.

What eclipse does:
It marks the import "org.xtext.example.typing.TestClass." as error; besides the autocomplete-feature of eclipse shows the function "Hello" in its context.

The error text:
Access restriction: The type TestClass is not accessible due to restriction on required project org.xtext.example.exp


Installed Eclipse Version:
Eclipse DSL Tools
Version: Neon Release (4.6.0)
Build id: 20160613-1800
Xtext version: 2.10


What i tried:
package org.xtext.example.typing

class TestClass {
	static def void Hello(Object e){
		
	}
}


/*
 * generated by Xtext 2.10.0
 */
package org.xtext.example.tests

import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.junit.Test
import org.junit.runner.RunWith

import static extension org.xtext.example.typing.TestClass.*

@RunWith(XtextRunner)
@InjectWith(ExpInjectorProvider)
class ExpParsingTest{
	
	@Test
	def void testSimple(){
		"s".Hello
	}

}


mwe2-File
module org.xtext.example.GenerateExp

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {
	
	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "org.xtext.example.exp"
				rootPath = rootPath
				runtimeTest = {
					enabled = true
				}
				eclipsePlugin = {
					enabled = true
				}
				eclipsePluginTest = {
					enabled = true
				}
				createEclipseMetaData = true
				
				
			}
			code = {
				encoding = "UTF-8"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			name = "org.xtext.example.Exp"
			fileExtensions = "exp"

			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}
			
			
		}
	}
}



After some resultless fix attempts (google, stackoverflow), i tried it with Eclipse Mars and XText 2.9.1, same error.
I'm very sure that i did something wrong, but i don't know what. Confused
Thank you very much in advance for your answers.
Re: Problem: Access restriction [message #1737672 is a reply to message #1737648] Mon, 11 July 2016 20:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13709
Registered: July 2009
Senior Member
are you sure you did adapt the manifest (exported packages)?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem: Access restriction [message #1737727 is a reply to message #1737672] Tue, 12 July 2016 09:38 Go to previous message
Felix Engl is currently offline Felix EnglFriend
Messages: 2
Registered: July 2016
Junior Member
It worked! I just had to add "org.xtext.example.mydsl.typing" in the Export-Package section of the MANIFEST.MF.
Thank you.

[Updated on: Tue, 12 July 2016 09:40]

Report message to a moderator

Previous Topic:Annoying exceptions during XText build
Next Topic:Glitch in xtext generated code editor while typing "enter"
Goto Forum:
  


Current Time: Sat Jan 16 13:03:59 GMT 2021

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

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

Back to the top