Return-Path: Delivered-To: apmail-incubator-uima-user-archive@minotaur.apache.org Received: (qmail 18631 invoked from network); 17 Jun 2009 07:50:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jun 2009 07:50:55 -0000 Received: (qmail 58791 invoked by uid 500); 17 Jun 2009 07:51:06 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 58715 invoked by uid 500); 17 Jun 2009 07:51:05 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 58705 invoked by uid 99); 17 Jun 2009 07:51:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 07:51:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of twgoetz@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 17 Jun 2009 07:50:53 +0000 Received: (qmail invoked by alias); 17 Jun 2009 07:50:30 -0000 Received: from blueice4n1.de.ibm.com (EHLO [9.152.14.84]) [195.212.29.187] by mail.gmx.net (mp006) with SMTP; 17 Jun 2009 09:50:30 +0200 X-Authenticated: #25330878 X-Provags-ID: V01U2FsdGVkX1/uLFdxXeHu+JtUB+SXhD42iEXdV2jaT5JyuSbGD5 wZRFR7SFoPNFnB Message-ID: <4A38A046.3020603@gmx.de> Date: Wed, 17 Jun 2009 09:50:30 +0200 From: Thilo Goetz User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: uima-user@incubator.apache.org Subject: Re: Reuse serialized XMI CAS in a dynamic application. References: <4A378147.9070400@gmx.de> In-Reply-To: X-Enigmail-Version: 0.95.7 X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.52 X-Virus-Checked: Checked by ClamAV on apache.org Kai Schlamp wrote: > I compared both type systems (the serialized type system of the CAS with > the original type system). > It seems the problems comes from those definitions that are only present > in the serialized one: > > > org.pubcurator.uima.ts.PubIdentifier[] > > uima.cas.FSArray > > > So it seems that the TypeSystem2Xml produces an not 100% compatible type > system description (at least for deserialization of a CAS). > Can you think of any workarounds? Any chance to get that fixed soon? > Should I create a bug report (if it is one at all)? Yes, this is a bug. Please open a Jira issue, we'll fix it asap. Re Tong's comments: it's odd that we have the same functionality twice, with different implementations. I have no idea how that came about. However, looking at the source code, the alternative should have exactly the same problems. --Thilo > > Regards, > Kai > > > > Kai Schlamp wrote: >> Hi Thilo, >> >> thanks for your help. >> I tried it the way you suggested. I just tested it with one type >> system. And if I use my type system description directly instead of >> the serialized/deserialized type system it works fine. >> But when I use the deserialized type system (serialized by your >> mentioned TypeSystem2Xml) to deserialize the CAS I get a >> CASAdminException. >> Below is the Exception, the original type system description, the >> serialized type description via TypeSystem2Xml, and a little >> serialized CAS test case. >> Do you have an idea why this Exception occurs? >> >> The Exception: >> CASAdminException: Can't derive from type "uima.cas.FSArray" since it >> is inheritance final. >> at >> org.apache.uima.cas.impl.TypeSystemImpl.addType(TypeSystemImpl.java:581) >> at >> org.apache.uima.util.CasCreationUtils.setupTypeSystem(CasCreationUtils.java:733) >> >> at >> org.apache.uima.util.CasCreationUtils.doCreateCas(CasCreationUtils.java:590) >> >> at >> org.apache.uima.util.CasCreationUtils.createCas(CasCreationUtils.java:352) >> >> at >> org.apache.uima.util.CasCreationUtils.createCas(CasCreationUtils.java:304) >> >> at >> org.pubcurator.uima.utils.FullCasDeserializer.deserialize(FullCasDeserializer.java:56) >> >> at >> org.pubcurator.uima.utils.FullCasDeserializerTest.testDeserialize(FullCasDeserializerTest.java:36) >> >> 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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) >> >> at >> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) >> >> at >> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) >> >> at >> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) >> >> at >> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) >> >> at >> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) >> >> at >> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73) >> >> at >> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) >> >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) >> at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) >> at >> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) >> >> at >> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) >> >> at org.junit.runners.ParentRunner.run(ParentRunner.java:220) >> at >> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) >> >> 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.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) >> >> at >> org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) >> >> 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.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:574) >> >> at >> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) >> >> at >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) >> >> at >> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) >> >> at >> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) >> >> at >> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) >> >> 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) >> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) >> at org.eclipse.equinox.launcher.Main.run(Main.java:1311) >> at org.eclipse.equinox.launcher.Main.main(Main.java:1287) >> >> >> >> Orignial Type System Description: >> >> >> >> PubCurator TypeSystem >> This is the type system that PubCurator uses for data >> representation. >> All analysis engines used in PubCurator must output this type >> system. >> 1.0 >> PubCurator >> >> >> org.pubcurator.uima.ts.PubAnnotation >> >> uima.tcas.Annotation >> >> >> annotator >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> >> score >> >> uima.cas.Integer >> >> >> identifiers >> >> uima.cas.FSArray >> org.pubcurator.uima.ts.PubIdentifier >> >> >> spans >> One item for example can be devided in multiple >> spans. For example, the phrase " >> uima.cas.FSArray >> org.pubcurator.uima.ts.PubSpan >> >> >> topic >> >> org.pubcurator.uima.ts.PubTopic >> >> >> >> >> org.pubcurator.uima.ts.PubIdentifier >> >> uima.cas.TOP >> >> >> identifierType >> >> uima.cas.String >> >> >> identifier >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubItem >> >> org.pubcurator.uima.ts.PubAnnotation >> >> >> org.pubcurator.uima.ts.PubItemAssociation >> >> org.pubcurator.uima.ts.PubAnnotation >> >> >> source >> >> org.pubcurator.uima.ts.PubItem >> >> >> destination >> >> org.pubcurator.uima.ts.PubItem >> >> >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> uima.cas.TOP >> >> >> analyzerId >> >> uima.cas.String >> >> >> delegateName >> >> uima.cas.String >> >> >> analyzerVersion >> >> uima.cas.String >> >> >> note >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubEntity >> >> uima.tcas.Annotation >> >> >> annotations >> >> uima.cas.FSArray >> org.pubcurator.uima.ts.PubAnnotation >> >> >> score >> >> uima.cas.Integer >> >> >> annotator >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> >> subEntities >> >> uima.cas.FSArray >> org.pubcurator.uima.ts.PubEntity >> >> >> identifiers >> >> uima.cas.FSArray >> org.pubcurator.uima.ts.PubIdentifier >> >> >> topic >> >> org.pubcurator.uima.ts.PubTopic >> >> >> >> >> org.pubcurator.uima.ts.PubProperty >> >> uima.cas.TOP >> >> >> key >> >> uima.cas.String >> >> >> value >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubSpan >> >> uima.tcas.Annotation >> >> >> org.pubcurator.uima.ts.PubTopic >> >> uima.cas.TOP >> >> >> namespace >> >> uima.cas.String >> >> >> name >> >> uima.cas.String >> >> >> >> >> >> >> >> >> >> Serialized Type System Description: >> >> >> >> >> >> uima.tcas.Annotation >> >> uima.cas.AnnotationBase >> >> >> sofa >> >> uima.cas.Sofa >> >> >> begin >> >> uima.cas.Integer >> >> >> end >> >> uima.cas.Integer >> >> >> >> >> uima.tcas.DocumentAnnotation >> >> uima.tcas.Annotation >> >> >> sofa >> >> uima.cas.Sofa >> >> >> begin >> >> uima.cas.Integer >> >> >> end >> >> uima.cas.Integer >> >> >> language >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubAnnotation >> >> uima.tcas.Annotation >> >> >> sofa >> >> uima.cas.Sofa >> >> >> begin >> >> uima.cas.Integer >> >> >> end >> >> uima.cas.Integer >> >> >> annotator >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> >> score >> >> uima.cas.Integer >> >> >> identifiers >> >> >> org.pubcurator.uima.ts.PubIdentifier[] >> >> >> spans >> >> >> org.pubcurator.uima.ts.PubSpan[] >> >> >> topic >> >> >> org.pubcurator.uima.ts.PubTopic >> >> >> >> >> org.pubcurator.uima.ts.PubIdentifier >> >> uima.cas.TOP >> >> >> identifierType >> >> uima.cas.String >> >> >> identifier >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubItem >> >> >> org.pubcurator.uima.ts.PubAnnotation >> >> >> sofa >> >> uima.cas.Sofa >> >> >> begin >> >> uima.cas.Integer >> >> >> end >> >> uima.cas.Integer >> >> >> annotator >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> >> score >> >> uima.cas.Integer >> >> >> identifiers >> >> >> org.pubcurator.uima.ts.PubIdentifier[] >> >> >> spans >> >> >> org.pubcurator.uima.ts.PubSpan[] >> >> >> topic >> >> >> org.pubcurator.uima.ts.PubTopic >> >> >> >> >> org.pubcurator.uima.ts.PubItemAssociation >> >> >> org.pubcurator.uima.ts.PubAnnotation >> >> >> sofa >> >> uima.cas.Sofa >> >> >> begin >> >> uima.cas.Integer >> >> >> end >> >> uima.cas.Integer >> >> >> annotator >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> >> score >> >> uima.cas.Integer >> >> >> identifiers >> >> >> org.pubcurator.uima.ts.PubIdentifier[] >> >> >> spans >> >> >> org.pubcurator.uima.ts.PubSpan[] >> >> >> topic >> >> >> org.pubcurator.uima.ts.PubTopic >> >> >> source >> >> >> org.pubcurator.uima.ts.PubItem >> >> >> destination >> >> >> org.pubcurator.uima.ts.PubItem >> >> >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> uima.cas.TOP >> >> >> analyzerId >> >> uima.cas.String >> >> >> delegateName >> >> uima.cas.String >> >> >> analyzerVersion >> >> uima.cas.String >> >> >> note >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubEntity >> >> uima.tcas.Annotation >> >> >> sofa >> >> uima.cas.Sofa >> >> >> begin >> >> uima.cas.Integer >> >> >> end >> >> uima.cas.Integer >> >> >> annotations >> >> >> org.pubcurator.uima.ts.PubAnnotation[] >> >> >> score >> >> uima.cas.Integer >> >> >> annotator >> >> >> org.pubcurator.uima.ts.PubAnnotator >> >> >> subEntities >> >> >> org.pubcurator.uima.ts.PubEntity[] >> >> >> identifiers >> >> >> org.pubcurator.uima.ts.PubIdentifier[] >> >> >> topic >> >> >> org.pubcurator.uima.ts.PubTopic >> >> >> >> >> org.pubcurator.uima.ts.PubProperty >> >> uima.cas.TOP >> >> >> key >> >> uima.cas.String >> >> >> value >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubSpan >> >> uima.tcas.Annotation >> >> >> sofa >> >> uima.cas.Sofa >> >> >> begin >> >> uima.cas.Integer >> >> >> end >> >> uima.cas.Integer >> >> >> >> >> org.pubcurator.uima.ts.PubTopic >> >> uima.cas.TOP >> >> >> namespace >> >> uima.cas.String >> >> >> name >> >> uima.cas.String >> >> >> >> >> org.pubcurator.uima.ts.PubIdentifier[] >> >> uima.cas.FSArray >> >> >> org.pubcurator.uima.ts.PubSpan[] >> >> uima.cas.FSArray >> >> >> org.pubcurator.uima.ts.PubAnnotation[] >> >> uima.cas.FSArray >> >> >> org.pubcurator.uima.ts.PubEntity[] >> >> uima.cas.FSArray >> >> >> >> >> >> >> >> >> Serialized CAS: >> >> > xmlns:cas="http:///uima/cas.ecore" xmlns:xmi="http://www.omg.org/XMI" >> xmlns:ts="http:///org/pubcurator/uima/ts.ecore" >> xmlns:tcas="http:///uima/tcas.ecore" xmi:version="2.0">> xmi:id="0"/>> sofaID="_InitialView"/>> begin="10" end="20" score="1000"/>> members="1"/> >> >>