Skip to main content



      Home
Home » Modeling » MoDisco » Prohibited package name: java(Loading XMI model base on JavaMM)
Prohibited package name: java [message #865901] Mon, 30 April 2012 12:29 Go to next message
Eclipse UserFriend
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 13:02 Go to previous messageGo to next message
Eclipse UserFriend
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 03:11 Go to previous messageGo to next message
Eclipse UserFriend
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 06:00 Go to previous messageGo to next message
Eclipse UserFriend
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 12:23 Go to previous message
Eclipse UserFriend
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: Thu May 15 13:15:04 EDT 2025

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

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

Back to the top