6 Replies Latest reply on Dec 19, 2011 6:33 PM by eminkevich

    Generated switchyard.xml fails validaition in Eclipse

    eminkevich

      Finally I got myself organized to play with the SwitchYard.

       

      The first problem I ran into is that the generated in the target directory switchyard.xml fails validation in Eclipse with a message:

       

      --------

      Invalid content was found starting with element 'interface.java'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":interface, "http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected

      ---------

       

      Environment:

      Windows 7

      JSK 1.6.0_29 x64

      Eclipse Indigo SR1 x64

       

      Extenstions:

      M2E extention

      SwitchYard tooling

      (No JBoss Tools installed)

       

      switchyard 0.3.0.Final.

       

      Steps to reproduce:

      1. Create a new Switchyard project

      2. Add switchyard-components-beans dependency to pom.xml

      3. Create Interface and Bean classes

      4. Mark the bean class with @Service annotation.

       

      The project gets compiled and the error presents itself.

       

      I would appreciate some guidance on what I might be doing wrong.

       

      Could it be related somehow to the

       

      Thanks.

      Evgeny.

        • 1. Re: Generated switchyard.xml fails validaition in Eclipse
          kcbabo

          Hey Evgeny,

           

          Hmm ... I wonder if there's something with the plugin that's causing this issue.  I was able to create a new app from scratch with 0.3.0.Final and followed your steps using Forge.  I then opened the project in Eclipse and I see no validation errors with the generated switchyard.xml in the target directory.  I'm sure Rob (our resident tools expert) will chime in with some advice to troubleshoot further.


          In the meantime, I wouldn't let this hold you back.  If the error is local to the Eclipse plugin (which I think it is), you should be able to move forward with creating and testing your app while ignoring the schema validation error.  Interesting side note - we schema validate the switchyard.xml inside our test kit, so you know if a test passes that the descriptor is legit.

           

          BTW, if you're curious what the forge commands were to go through steps 1-4:

           

          forge
          new-project --named validateApp --topLevelPackage org.example.validateApp
          project install-facet switchyard.bean
          bean-service create --serviceName Example
          

           

          I have attached the application I mentioned above in case you want to check it out in your Eclipse install.  Let us know if you also see validation errors with this one.

           

          cheers,

          keith

          • 2. Re: Generated switchyard.xml fails validaition in Eclipse
            eminkevich

            Keith,

             

            Thank you for the prompt reply.

             

            Myself I do not use forge yet - the project has been created using the Eclipse tooling.

             

            So I took your code and imported it into Eclipse. No issues.

             

            But then I noticed that the project created by the Eclipse is faceted, with Java and Utility Module facets enabled by default.

             

            So I enabled facts on the imported project. No issues, but only Java facet was enabled by default.

             

            Once I enabled Utility Module facet the validation error popped up.

             

            Hope that helps!

            • 3. Re: Generated switchyard.xml fails validaition in Eclipse
              kcbabo

              I can confirm that when I enable the Utility facet on the project, I also see the validation error.  I'll let Rob comment on whether our Eclipse support is compatible with this facet.  Do you need the Utility Module facet for something in particular?

              • 4. Re: Generated switchyard.xml fails validaition in Eclipse
                rcernich

                Hey Evgeny,

                 

                Sorry for not spotting this sooner.  Could you confirm that you've disabled "Honour all XML schema locations" in the XML validation preferences (XML->XML Files->Validation)?  That should clear up the error.

                 

                Best,

                Rob

                1 of 1 people found this helpful
                • 5. Re: Generated switchyard.xml fails validaition in Eclipse
                  eminkevich

                  Keith Babo wrote:

                   

                  Do you need the Utility Module facet for something in particular?

                   

                  No, not at the moment.

                   

                  I think the only issue is that it is the default configuration if a switchyard project is created by Eclipse.

                  • 6. Re: Generated switchyard.xml fails validaition in Eclipse
                    eminkevich

                    Rob Cernich wrote:

                     

                    Could you confirm that you've disabled "Honour all XML schema locations" in the XML validation preferences (XML->XML Files->Validation)?  That should clear up the error.

                     

                    Yep, the error is gone.

                    Thank you.