Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unresolved proxy classpath.. Make sure the EPackage has been registered.
Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733569] Mon, 30 May 2016 08:25 Go to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
I have an xtext grammar, and I created an xcore model for my grammar.

In my .xtext file, I removed this line:
generate myDsl "http://mydsl.org"


and I added this line:
import "mydsl"


In my GenerateMydsl.mwe2 file:
I added the following:
    bean = StandaloneSetup {
            scanClassPath = true
            platformUri = "${runtimeProject}/.."
            // The following two lines can be removed, if Xbase is not used.
            registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
            // Register my packages
            registerGeneratedEPackage = "mydsl.MydslPackage"
          
            registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
            registerGenModelFile = "platform:/resource/xtext/model/generated/Mydsl.genmodel"
        }

MyDslPackage is in emf-gen directory, which is automatically generated from my mydsl.xcore file.
I have read that I would need to register the GenModel, so I created a new genmodel from mydsl.xcore by doing this:
right click on mydsl.xcore -> new -> other -> EMF generator model -> Mydsl.genmodel -> xcore -> load -> tick the entry in root packages -> finish.
I am not sure if this is still needed, though.

Inside the Generator component for language, I added these:
loadedResource = "platform:/resource/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore"
            	loadedResource = "platform:/resource/xtext/model/generated/mydsl.ecore"
            	loadedResource = "platform:/resource/xtext/src/org/MyDsl.xcore"


I have also commented this line:
//fragment = ecore.EMFGeneratorFragment auto-inject {}


My plugin.xml also have this entry:
   <extension point="org.eclipse.emf.ecore.generated_package">
      <!-- @generated Mydsl -->
      <package
            uri="mydsl"
            class="mydsl.MydslPackage"
            genModel="src/org/Mydsl.xcore"/>
   </extension>


I was able to generate the jar file, but when I run it, I get this error:
java.lang.IllegalStateException: Unresolved proxy classpath:/org/mydsl#//Directory. Make sure the EPackage has been registered.


What am I doing wrong? Sad
I am not very familiar with xcore and would appreciate any suggestions.
Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733570 is a reply to message #1733569] Mon, 30 May 2016 08:40 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13271
Registered: July 2009
Senior Member
which xtext version do you use and which style of workflow?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733578 is a reply to message #1733570] Mon, 30 May 2016 09:39 Go to previous messageGo to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Hi Christian,
This is the xtext version I am using.
Xtext Complete SDK 2.9.1.v201512180746 org.eclipse.xtext.sdk.feature.group Eclipse Xtext
EMF - Eclipse Modeling Framework Xcore SDK 1.3.2.v20160209-0349 org.eclipse.emf.ecore.xcore.sdk.feature.group Eclipse Modeling Project

What do you mean by "which style of workflow"? I am still new in this xcore stuffs so I am not sure of the style of workflow.
Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733580 is a reply to message #1733578] Mon, 30 May 2016 09:43 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13271
Registered: July 2009
Senior Member
if you create a new project using the wizard in 29x+ youll get something like

module org.xtext.example.mydsl.GenerateMyDsl

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.mydsl"
				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 {
		
			referencedResource = "platform:/resource/demox/model/demox.xcore"
			name = "org.xtext.example.mydsl.MyDsl"
			fileExtensions = "mydsl"

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



which i customized with a single line

referencedResource = "platform:/resource/demox/model/demox.xcore"



Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733591 is a reply to message #1733580] Mon, 30 May 2016 10:47 Go to previous messageGo to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Hi Christian,

This is the contents of my workflow. It looks different from what you are showing me.

Workflow {
    bean = StandaloneSetup {
            scanClassPath = true
            platformUri = "${runtimeProject}/.."
            // The following two lines can be removed, if Xbase is not used.
            registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
          // Register my packages
            registerGeneratedEPackage = "mydsl.MydslPackage"
          
            registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
            registerGenModelFile = "platform:/resource/xtext/model/generated/Mydsl.genmodel"
        }
    
        component = DirectoryCleaner {
            directory = "${runtimeProject}/src-gen"
        }
        
        component = DirectoryCleaner {
            directory = "${runtimeProject}.ui/src-gen"
        }
        
        component = Generator {
            pathRtProject = runtimeProject
            projectNameRt = projectName
            language = auto-inject {
            	loadedResource = "platform:/resource/org.eclipse.emf.ecore.xcore.lib/model/XcoreLang.xcore"
            	loadedResource = "platform:/resource/xtext/model/generated/mydsl.ecore"
                loadedResource = "platform:/resource/xtext/src/org/MyDsl.xcore"
                uri = "platform:/resource/xtext/src/org/MyDsl.xtext"
                // Java API to access grammar elements (required by several other fragments)
                fragment = grammarAccess.GrammarAccessFragment auto-inject {}
    
                // generates Java API for the generated EPackages
                // switch to xcore
                // fragment = ecore.EMFGeneratorFragment auto-inject {}
                
                // Serializer 2.0
                fragment = serializer.SerializerFragment auto-inject  {
                    generateStub = false
                }
                
                // the serialization component (1.0)
                // fragment = parseTreeConstructor.ParseTreeConstructorFragment {}
    
                // a custom ResourceFactory for use with EMF
                fragment = resourceFactory.ResourceFactoryFragment auto-inject {}
    
                // The antlr parser generator fragment.
                fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject {
                  options = {
                      	backtrack = true
                        classSplitting=true
                        fieldsPerClass = "1200" 
                        methodsPerClass = "1200"
                  }
                }
    
                // java-based API for validation
                fragment = validation.JavaValidatorFragment auto-inject {
                //    composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
                //    composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
                }
    
                // generator API
                fragment = generator.GeneratorFragment auto-inject {
                    generateMwe = false
                    generateJavaMain = true
                }
    
                // rename refactoring
                fragment = refactoring.RefactorElementNameFragment auto-inject {}
    
                // provides the necessary bindings for java types integration
                fragment = types.TypesGeneratorFragment auto-inject {}
    
                // generates the required bindings only if the grammar inherits from Xbase
                fragment = xbase.XbaseGeneratorFragment auto-inject {}
    
                // provides a compare view
                fragment = compare.CompareFragment auto-inject {}
            }
        }
        


Does this mean I have to change my workflow to the one you gave me?
I did not create a new project. My project is already existing from an older version, and I just exported it to the newer Eclipse version that I have.

[Updated on: Mon, 30 May 2016 10:48]

Report message to a moderator

Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733592 is a reply to message #1733591] Mon, 30 May 2016 10:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13271
Registered: July 2009
Senior Member
Sry I don't know the answer to this question

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733797 is a reply to message #1733592] Wed, 01 June 2016 03:16 Go to previous messageGo to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Thanks Christian! I will just update my workflow and see if it works.

Just wondering, is it necessary to set the resourceSet?

[Updated on: Wed, 01 June 2016 03:17]

Report message to a moderator

Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733802 is a reply to message #1733797] Wed, 01 June 2016 04:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13271
Registered: July 2009
Senior Member
it was is the old <= 2.8.4 style workflow

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Unresolved proxy classpath.. Make sure the EPackage has been registered. [message #1733803 is a reply to message #1733802] Wed, 01 June 2016 05:36 Go to previous message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Somebody might be interested..

I managed to get it working by following the steps here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=379999 (see comment#12).
Basically, I missed the EPackage registration in the MyDslStandAloneSetup (Step 6).

Previous Topic:quickfix for referenced object not found
Next Topic:How to register Packages in the global EPackage.Registry Instance?
Goto Forum:
  


Current Time: Wed Dec 11 22:54:19 GMT 2019

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

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

Back to the top