You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Guilherme Armigliatto <gu...@gmail.com> on 2011/07/29 15:41:34 UTC

[GSoC] XML Schema validation error when running a new implementation type

Hi,

I have created a simple test case to test the implementation.scala.
However, when a I try to execute it I get the following error:
SEVERE: XMLSchema validation error occured in: helloworld.composite
,line = 30, column = 9, Message = cvc-complex-type.2.4.a: Invalid
content was found starting with element
'tuscany:implementation.scala'. One of
'{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation,
"http://docs.oasis-open.org/ns/opencsa/sca/200912":implementation}' is
expected.
I created the "org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor"
at src/main/resources of implementation.scala module with the content:
"org.apache.tuscany.sca.implementation.scala.xml.ScalaImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementation.scala,model=org.apache.tuscany.sca.implementation.scala.ScalaImplementation"
Is not it enough to get a correct XML schema validation?

Thanks,

---
Guilherme Moraes Armigliatto

Re: [GSoC] XML Schema validation error when running a new implementation type

Posted by Guilherme Armigliatto <gu...@gmail.com>.
Hi,

Yes, it works...
=))

Thanks,

---
Guilherme Moraes Armigliatto



2011/8/4 Simon Laws <si...@googlemail.com>

> On Fri, Jul 29, 2011 at 2:55 PM, ant elder <an...@gmail.com> wrote:
> > On Fri, Jul 29, 2011 at 2:41 PM, Guilherme Armigliatto
> > <gu...@gmail.com> wrote:
> >> Hi,
> >>
> >> I have created a simple test case to test the implementation.scala.
> However,
> >> when a I try to execute it I get the following error:
> >> SEVERE: XMLSchema validation error occured in: helloworld.composite
> ,line =
> >> 30, column = 9, Message = cvc-complex-type.2.4.a: Invalid content was
> found
> >> starting with element 'tuscany:implementation.scala'. One of
> >> '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation,
> >> "http://docs.oasis-open.org/ns/opencsa/sca/200912":implementation}' is
> >> expected.
> >>
> >> I created the
> >> "org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor" at
> >> src/main/resources of implementation.scala module with the content:
> >>
> "org.apache.tuscany.sca.implementation.scala.xml.ScalaImplementationProcessor;qname=
> http://tuscany.apache.org/xmlns/sca/1.1#implementation.scala,model=org.apache.tuscany.sca.implementation.scala.ScalaImplementation
> "
> >>
> >> Is not it enough to get a correct XML schema validation?
> >>
> >
> > That StAXArtifactProcessor is the bit that gives Tuscany  the code to
> > process the xml but it doesn't provide the new xsd to define its
> > schema. To do that you need a couple more files, the .xsd for the new
> > element and another meta-inf/services file so Tuscany can discover the
> > .xsd. You can see examples of that in some of the other Tuscany
> > extensions, for example, <implementation.jaxrs> is defined with the
> > two files:
> >
> >
> https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/org/apache/tuscany/sca/implementation/jaxrs/tuscany-sca-1.1-implementation-jaxrs.xsd
> >
> > and
> >
> >
> https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
> >
> >   ...ant
> >
>
> Hi Guilhereme
>
> Did you get past your problem?
>
> Simon
>
> --
> Apache Tuscany committer: tuscany.apache.org
> Co-author of a book about Tuscany and SCA: tuscanyinaction.com
>

Re: [GSoC] XML Schema validation error when running a new implementation type

Posted by Simon Laws <si...@googlemail.com>.
On Fri, Jul 29, 2011 at 2:55 PM, ant elder <an...@gmail.com> wrote:
> On Fri, Jul 29, 2011 at 2:41 PM, Guilherme Armigliatto
> <gu...@gmail.com> wrote:
>> Hi,
>>
>> I have created a simple test case to test the implementation.scala. However,
>> when a I try to execute it I get the following error:
>> SEVERE: XMLSchema validation error occured in: helloworld.composite ,line =
>> 30, column = 9, Message = cvc-complex-type.2.4.a: Invalid content was found
>> starting with element 'tuscany:implementation.scala'. One of
>> '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation,
>> "http://docs.oasis-open.org/ns/opencsa/sca/200912":implementation}' is
>> expected.
>>
>> I created the
>> "org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor" at
>> src/main/resources of implementation.scala module with the content:
>> "org.apache.tuscany.sca.implementation.scala.xml.ScalaImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementation.scala,model=org.apache.tuscany.sca.implementation.scala.ScalaImplementation"
>>
>> Is not it enough to get a correct XML schema validation?
>>
>
> That StAXArtifactProcessor is the bit that gives Tuscany  the code to
> process the xml but it doesn't provide the new xsd to define its
> schema. To do that you need a couple more files, the .xsd for the new
> element and another meta-inf/services file so Tuscany can discover the
> .xsd. You can see examples of that in some of the other Tuscany
> extensions, for example, <implementation.jaxrs> is defined with the
> two files:
>
> https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/org/apache/tuscany/sca/implementation/jaxrs/tuscany-sca-1.1-implementation-jaxrs.xsd
>
> and
>
> https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
>
>   ...ant
>

Hi Guilhereme

Did you get past your problem?

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Re: [GSoC] XML Schema validation error when running a new implementation type

Posted by ant elder <an...@gmail.com>.
On Fri, Jul 29, 2011 at 2:41 PM, Guilherme Armigliatto
<gu...@gmail.com> wrote:
> Hi,
>
> I have created a simple test case to test the implementation.scala. However,
> when a I try to execute it I get the following error:
> SEVERE: XMLSchema validation error occured in: helloworld.composite ,line =
> 30, column = 9, Message = cvc-complex-type.2.4.a: Invalid content was found
> starting with element 'tuscany:implementation.scala'. One of
> '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation,
> "http://docs.oasis-open.org/ns/opencsa/sca/200912":implementation}' is
> expected.
>
> I created the
> "org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor" at
> src/main/resources of implementation.scala module with the content:
> "org.apache.tuscany.sca.implementation.scala.xml.ScalaImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementation.scala,model=org.apache.tuscany.sca.implementation.scala.ScalaImplementation"
>
> Is not it enough to get a correct XML schema validation?
>

That StAXArtifactProcessor is the bit that gives Tuscany  the code to
process the xml but it doesn't provide the new xsd to define its
schema. To do that you need a couple more files, the .xsd for the new
element and another meta-inf/services file so Tuscany can discover the
.xsd. You can see examples of that in some of the other Tuscany
extensions, for example, <implementation.jaxrs> is defined with the
two files:

https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/org/apache/tuscany/sca/implementation/jaxrs/tuscany-sca-1.1-implementation-jaxrs.xsd

and

https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema

   ...ant