Hmmm... the error doesn't seem obvious to me but indeed, perhaps it is a
versioning issue. In the past I have also gotten around strange happenings
like this by modifying the generated code accordingly. Not sure if that
will work in this case though.
On Fri, Nov 30, 2012 at 1:19 PM, Andrea Aime
<[email protected]>wrote:
> Hi,
> I was trying to get some of the capabilities parsing working in order to
> do schema validation of what we're generating in wcs 2.0 and got into
> a EMF related trouble.. basically it seems the code generated does not
> really work.
>
> With this simple test:
>
> package org.geotools.ows.v2_0;
>
> import net.opengis.ows20.Ows20Factory;
>
> import org.junit.Test;
>
> public class OnlineResourceTest {
>
> @Test
> public void testOnlineResource() {
> Ows20Factory factory = Ows20Factory.eINSTANCE;
> // boom
> factory.createOnlineResourceType();
> }
> }
>
>
> I get the following exception:
>
> java.lang.ExceptionInInitializerError
> at
> net.opengis.ows20.impl.Ows20FactoryImpl.createOnlineResourceType(Ows20FactoryImpl.java:605)
> at
> org.geotools.ows.v2_0.OnlineResourceTest.testOnlineResource(OnlineResourceTest.java:13)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
> at
> org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
> at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
> at
> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
> at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
> at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
> at
> org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
> at
> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
> at
> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
> at
> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
> at
> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
> at
> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: java.lang.IllegalArgumentException: The value 'simple' is
> invalid.
> at
> org.eclipse.emf.ecore.impl.EFactoryImpl.createFromString(EFactoryImpl.java:462)
> at
> net.opengis.ows20.impl.Ows20FactoryImpl.createTypeTypeFromString(Ows20FactoryImpl.java:1214)
> at
> net.opengis.ows20.impl.Ows20FactoryImpl.createFromString(Ows20FactoryImpl.java:182)
> at
> net.opengis.ows20.impl.OnlineResourceTypeImpl.<clinit>(OnlineResourceTypeImpl.java:186)
> ... 24 more
>
> Long story short, the code is not able to generate an instance of TypeType
> form "simple".
> Looked at that EFactoryImpl.createFromString and it can handle EENum, but
> TypeType is
> a Enumerator instead... not sure what the difference is,
> but EFactoryImpl.createFromString
> misses a case for that class
>
> Maybe a more recent version of ecore would work... given that the emf
> model was re-generated
> using a recent Eclipse... and maybe I'm completely off the mark.
>
> Ideas?
>
> Cheers
> Andrea
>
> --
> ==
> Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
> information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net
> _______________________________________________
> GeoTools-Devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel