Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » XSD to EMF Cannot Find *ecore File
XSD to EMF Cannot Find *ecore File [message #602277] Mon, 09 April 2007 17:56
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 71
Registered: July 2009
Member
All,

Thanks for helping.

I have generated EMF from XSD before and all went well. This time,
however, it generates without but won't run. I don't understand. I will
say that this a very complex schema, w3c compliant, but complex
nevertheless.

It generates without error and compiles without error.

The generator created a file called xhtml.ecore but apparently cannot find
it at runtime.

Where must xhtml.ecore be to be found?

The generator also created a file called mif.ecore. Both *.ecore files
were placed in a folder called model. But the generator placed a copy of
mif.ecore in one of the generated packages with the source code. I tried
placing a copy of xhtml.ecore in the same place but to no avail.

I have also tried placing xhtml.ecore on the runtime classpath.

The code line that provokes the error is:

MifPackageImpl theMifPackage =
(MifPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_ URI)
instanceof MifPackageImpl ?
EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MifPackageImpl());

The complaint about the missing xhtml.ecore is near the end of the trace.
The output trace is:

java.lang.ExceptionInInitializerError
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unkn own Source)
at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
at java.lang.reflect.Field.get(Unknown Source)
at
org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:168)
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:112)
at org.hl7.v3.mif.impl.MifPackageImpl.init(MifPackageImpl.java: 2670)
at org.hl7.v3.mif.MifPackage.<clinit>(MifPackage.java:270)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unkn own Source)
at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source)
at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source)
at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
at java.lang.reflect.Field.get(Unknown Source)
at
org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or.getEPackage(RegistryReader.java:168)
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:112)
at
org.hl7.v3.mif.impl.MifPackageImplTest.testInit(MifPackageIm plTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:128)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:58)
at
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:24)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.RuntimeException: Missing serialized package:
xhtml.ecore
at
org.w3._1999.xhtml.impl.XhtmlPackageImpl.loadPackage(XhtmlPa ckageImpl.java:4780)
at
org.w3._1999.xhtml.impl.XhtmlPackageImpl.init(XhtmlPackageIm pl.java:707)
at org.w3._1999.xhtml.XhtmlPackage.<clinit>(XhtmlPackage.java:192)
... 51 more
Previous Topic:OpenXSD
Next Topic:XSD to EMF Cannot Find *ecore File
Goto Forum:
  


Current Time: Mon Nov 24 14:17:58 GMT 2014

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

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