Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Prohibited package name: java(Loading XMI model base on JavaMM)
Prohibited package name: java [message #865901] Mon, 30 April 2012 16:29 Go to next message
Juan Castel is currently offline Juan CastelFriend
Messages: 20
Registered: April 2012
Junior Member
Hi, all.

I downloaded the Java metamodel Ecore file and generated the genmodel based on that file; then I generated the Model code from the genmodel and when I try to register the package, the ClassLoader says: Prohibited package name: java

ResourceSet resourceSet = new ResourceSetImpl();
		
		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
		resourceSet.getPackageRegistry().put(JavaPackage.eNS_URI,JavaPackage.eINSTANCE);
		File file = new File("C:\\Users\\Dc3AdminEJB\\Dc3AdminEJB_java.xmi");
		//System.out.println(file);
URI uri = URI.createFileURI(file.getAbsolutePath());
//System.out.println(uri);
Resource resource = resourceSet.getResource(uri, true);
System.out.println("Loaded " + uri + "  " + resource);


How could I get rid of this?
Re: Prohibited package name: java [message #865949 is a reply to message #865901] Mon, 30 April 2012 17:02 Go to previous messageGo to next message
Juan Castel is currently offline Juan CastelFriend
Messages: 20
Registered: April 2012
Junior Member
Well, it looks like no package can be named as java; makes sense. What I did was change the package Name, NsPrefix and NsURI in the Ecore file to javamm:

www eclipse org/MoDisco/Java/0.2.incubation/javamm

This is just to make it work through EMF locally.
Re: Prohibited package name: java [message #868537 is a reply to message #865949] Wed, 02 May 2012 07:11 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
Hi,

you may also change the "basePackage" property in java.genmodel file to avoid the creation of root "java" package. Have a look in org.eclipse.gmt.modisco.java for instance.

Fabien.
Re: Prohibited package name: java [message #870940 is a reply to message #865949] Thu, 10 May 2012 10:00 Go to previous messageGo to next message
Gregoire Dupe is currently offline Gregoire DupeFriend
Messages: 75
Registered: September 2009
Location: France
Member
Hello,

Why do you try to regenerated the EMF implementation of ecore.java ? One is already provided by MoDisco as a plug-in (org.eclipse.gmt.modisco.java).

MoDisco's plug-ins installation is documented in : http://wiki.eclipse.org/MoDisco/Installation

Regards,
Grégoire
Re: Prohibited package name: java [message #871048 is a reply to message #870940] Thu, 10 May 2012 16:23 Go to previous message
Juan Castel is currently offline Juan CastelFriend
Messages: 20
Registered: April 2012
Junior Member
Hi, thanks for your responses. Gregoire, I had to dowload the java.ecore and generate the model code in order to register packages for XMIResource and load the model discovered by MoDisco because in order to transform that model to another one in ATL I had a lot of problems with OCL; it is so much simpler to navigate the model in EMF than in ATL and its, in my opinion, unintuitive OCL. Thank you.
Previous Topic:JSP MoDisco discoverer with JSP files from Struts Project
Next Topic:Problems with webApp MoDisco model and ATL transformation
Goto Forum:
  


Current Time: Tue Apr 16 19:54:26 GMT 2024

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

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

Back to the top