1 2 Previous Next 17 Replies Latest reply: May 19, 2012 1:06 PM by Hendi Marcos Silva RSS

    I can't run sample codes

    Seme Seme Newbie

      I am getting following error:

      [ERROR] Failed to execute goal org.switchyard:switchyard-plugin:0.3.0.Final:configure (default) on project switchyard-quickstart-bpm-service: Model [

      org.switchyard.config.model.switchyard.v1.V1SwitchYardModel] is invalid: cvc-complex-type.3.2.2: Attribute 'name' is not allowed to appear in element 'component'. -> [Help 1]

       

      What I need to make sure

        • 1. Re: I can't run sample codes
          Keith Babo Master

          Can you provide a bit more detail on what you're running and where you're running it?  For example,

           

          - Which application is this?  A quickstart or something you created on your own?

          - Where are you seeing the error?  In Eclipse, when building from the command line (e.g. mvn install)?

           

          thanks,

          keith

          • 2. Re: I can't run sample codes
            Seme Seme Newbie

            I am running maven from quickstart (shipped with switchyard)

            I tried all the applications and failled all.

            I see error maven tried to install the app, it happens at <artifactId>switchyard-plugin</artifactId> in pom.xml of each of the sample code shipped with switchard.

             

            [ERROR] Failed to execute goal org.switchyard:switchyard-plugin:0.3.0.Final:configure (default) on project switchyard-quickstart-bpm-service: Model [

            org.switchyard.config.model.switchyard.v1.V1SwitchYardModel] is invalid: cvc-complex-type.3.2.2: Attribute 'name' is not allowed to appear in element 'component'. -> [Help 1]

            • 3. Re: I can't run sample codes
              Keith Babo Master

              I downloaded the SwitchYard AS7 0.3 distribution from here:

               

              http://www.jboss.org/switchyard/downloads

               

              Unzipped it and ran the following in the quickstarts/ directory:

               

              mvn install
              

               

              All quickstarts built successfully.  I even cleaned my maven repo and disabled local Maven settings, so I'm not sure what you are hitting in your environment.  FWIW, the quickstarts build as part of our CI environment here as well:

               

              https://hudson.jboss.org/hudson/job/SwitchYard-Quickstarts/

              • 4. Re: I can't run sample codes
                Seme Seme Newbie

                Keith,

                 

                I tried both maven and eclipse, and it did not work.

                 

                Here is stack trace for eclipse

                 

                java.lang.RuntimeException: Model [org.switchyard.config.model.switchyard.v1.V1SwitchYardModel] is invalid: cvc-complex-type.3.2.2: Attribute 'name' is not allowed to appear in element 'component'.

                          at org.switchyard.config.model.Validation.assertValid(Validation.java:78)

                          at org.switchyard.config.model.BaseModel.assertModelValid(BaseModel.java:179)

                          at org.switchyard.test.SwitchYardTestKit.createSwitchYardModel(SwitchYardTestKit.java:744)

                          at org.switchyard.test.SwitchYardTestKit.<init>(SwitchYardTestKit.java:141)

                          at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:55)

                          at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:251)

                          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

                          at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:248)

                          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

                          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

                          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

                          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                          at org.switchyard.test.SwitchYardRunner.run(SwitchYardRunner.java:78)

                          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

                          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: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'name' is not allowed to appear in element 'component'.

                          at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

                          at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)

                          at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

                          at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

                          at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)

                          at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)

                          at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)

                          at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)

                          at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)

                          at org.apache.xerces.jaxp.validation.DOMValidatorHelper.beginNode(Unknown Source)

                          at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)

                          at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)

                          at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)

                          at javax.xml.validation.Validator.validate(Unknown Source)

                          at org.switchyard.config.model.BaseModel.validateModel(BaseModel.java:164)

                          ... 22 more

                • 5. Re: I can't run sample codes
                  David Ward Master

                  Seme,

                   

                  1. Can you please post the plugin/scanner output here?  You'll find it in the quickstart's target/classes/META-INF/switchyard.xml
                  2. Were you previously using 0.2, and just moved to 0.3?  If so, and you use maven, you'll want to make sure you clean and re-install the switchyard core and components repos before quickstarts.
                  3. What exact java version are you using, and on what OS?

                   

                  Thanks,

                  David

                  • 6. Re: I can't run sample codes
                    Seme Seme Newbie

                    David,

                     

                    I am using  version .3 and removed everything from my repo and ran mvn still it did not work.

                    java version "1.6.0_27" and windows 7 64 bits.

                     

                    Here is my switchyard.xml.

                     

                    <?xml version="1.0" encoding="UTF-8"?>

                    <switchyard xmlns="urn:switchyard-config:switchyard:1.0">

                        <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="osdemo" targetNamespace="urn:switchyard-quickstart:bpm-service:1.0">

                            <service name="ProcessOrder" promote="ProcessOrder">

                                <interface.wsdl interface="wsdl/ProcessOrder.wsdl#wsdl.porttype(ProcessOrder)"/>

                                <binding.soap xmlns="urn:switchyard-component-soap:config:1.0">

                                    <wsdl>wsdl/ProcessOrder.wsdl</wsdl>

                                    <socketAddr>localhost:18001</socketAddr>

                                    <contextPath>swydws</contextPath>

                                </binding.soap>

                            </service>

                            <component name="ProcessOrder">

                                <implementation.bpm xmlns="urn:switchyard-component-bpm:config:1.0" processDefinition="META-INF/ProcessOrder.bpmn" processId="ProcessOrder">

                                    <taskHandler class="org.switchyard.component.bpm.task.SwitchYardServiceTaskHandler" name="SwitchYard Service"/>

                                </implementation.bpm>

                                <service name="ProcessOrder">

                                    <interface.java interface="org.switchyard.quickstarts.bpm.service.ProcessOrder"/>

                                </service>

                            </component>

                        </composite>

                    </switchyard>

                    • 7. Re: I can't run sample codes
                      David Ward Master

                      Seme,

                       

                      Other than a missing newline at the end of the file, your switchyard.xml is exactly the same as quickstarts/bpm-service/src/main/resources/META-INF/switchyard.xml.  What I would rather see, however, is what gets generated in quickstarts/bpm-service/target/classes/META-INF/switchyard.xml.

                       

                      Thanks,

                      David

                      • 8. Re: I can't run sample codes
                        Keith Babo Master

                        I replied on this a few days ago, but I think my post was swallowed by the forum.  Can you post the output from "mvn -version" and "java -version" ?  Wild guess here, but are you using an IBM JDK on your Windows machine?  I saw this once or twice during our Asia workshops.  It only happened on Windows, but the vast majority of Windows installs worked fine.  I think the common thread was IBM JDK, but I can't say for certain.

                        • 9. Re: I can't run sample codes
                          David Ward Master

                          Seme,

                           

                          Also, please compile, run, and copy/paste the output of this program here:

                           

                          public class SysProps {

                              public static void main(String... args) {

                                  System.getProperties().list(System.out);

                              }

                          }

                           

                           

                          Thanks,

                          David

                          • 10. Re: I can't run sample codes
                            Seme Seme Newbie

                            Keith,

                             

                            It is Sun JDK on Windows 7.

                            Here are my JDL and MVN details.

                             

                            Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)

                            Maven home: C:\apache-maven-3.0.3\bin\..

                            Java version: 1.6.0_27, vendor: Sun Microsystems Inc.

                            Java home: C:\Java\jdk1.6.0_27\jre

                            Default locale: en_US, platform encoding: Cp1252

                            OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

                            • 11. Re: I can't run sample codes
                              Seme Seme Newbie

                              David.

                               

                              -- listing properties --

                              java.runtime.name=Java(TM) SE Runtime Environment

                              sun.boot.library.path=C:\Java\jdk1.6.0_27\jre\bin

                              java.vm.version=20.2-b06

                              java.vm.vendor=Sun Microsystems Inc.

                              java.vendor.url=http://java.sun.com/

                              path.separator=;

                              java.vm.name=Java HotSpot(TM) 64-Bit Server VM

                              file.encoding.pkg=sun.io

                              user.country=US

                              sun.java.launcher=SUN_STANDARD

                              sun.os.patch.level=

                              java.vm.specification.name=Java Virtual Machine Specification

                              user.dir=C:\Users\user\workspace

                              java.runtime.version=1.6.0_27-b07

                              java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment

                              java.endorsed.dirs=C:\Java\jdk1.6.0_27\jre\lib\endorsed

                              os.arch=amd64

                              java.io.tmpdir=C:\Users\user\AppData\Local\Temp\

                              line.separator=

                               

                               

                              java.vm.specification.vendor=Sun Microsystems Inc.

                              user.variant=

                              os.name=Windows 7

                              sun.jnu.encoding=Cp1252

                              java.library.path=C:\Java\jdk1.6.0_27\jre\bin;C:\WINDOW...

                              java.specification.name=Java Platform API Specification

                              java.class.version=50.0

                              sun.management.compiler=HotSpot 64-Bit Tiered Compilers

                              os.version=6.1

                              user.home=C:\Users\user

                              user.timezone=

                              java.awt.printerjob=sun.awt.windows.WPrinterJob

                              file.encoding=Cp1252

                              java.specification.version=1.6

                              user.name=user

                              java.class.path=C:\Users\user\workspace\

                              java.vm.specification.version=1.0

                              sun.arch.data.model=64

                              java.home=C:\Java\jdk1.6.0_27\jre

                              sun.java.command=Test

                              java.specification.vendor=Sun Microsystems Inc.

                              user.language=en

                              awt.toolkit=sun.awt.windows.WToolkit

                              java.vm.info=mixed mode

                              java.version=1.6.0_27

                              java.ext.dirs=C:\Java\jdk1.6.0_27\jre\lib\ext;C:\WI...

                              sun.boot.class.path=C:\Java\jdk1.6.0_27\jre\lib\endorsed\...

                              java.vendor=Sun Microsystems Inc.

                              file.separator=\

                              java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport...

                              sun.cpu.endian=little

                              sun.io.unicode.encoding=UnicodeLittle

                              sun.desktop=windows

                              sun.cpu.isalist=amd64

                               

                              Thanks

                              • 12. Re: I can't run sample codes
                                David Ward Master

                                Seme,

                                 

                                Thanks for the details.  Please also provide the generated quickstarts/bpm-service/target/classes/META-INF/switchyard.xml.  You had instead given us the source quickstarts/bpm-service/src/main/resources/META-INF/switchyard.xml.

                                 

                                Best,

                                David

                                • 13. Re: I can't run sample codes
                                  Magesh Bojan Master

                                  I just tried with Windows 7 64 bit, JDK 1.6.0u30 and all went smooth. Seme, does the user who is running the maven build and eclipse have the right permissions? Is it possible for you to test with update 30?

                                  • 14. Re: I can't run sample codes
                                    Seme Seme Newbie

                                    David,

                                     

                                    Here is generated switchyard.xml

                                     

                                    <?xml version="1.0" encoding="UTF-8"?><switchyard xmlns="urn:switchyard-config:switchyard:1.0">

                                        <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="osdemo" targetNamespace="urn:switchyard-quickstart:bpm-service:1.0">

                                            <service name="ProcessOrder" promote="ProcessOrder">

                                                <interface.wsdl interface="wsdl/ProcessOrder.wsdl#wsdl.porttype(ProcessOrder)"/>

                                                <binding.soap xmlns="urn:switchyard-component-soap:config:1.0">

                                                    <wsdl>wsdl/ProcessOrder.wsdl</wsdl>

                                                    <socketAddr>localhost:18001</socketAddr>

                                                    <contextPath>swydws</contextPath>

                                                </binding.soap>

                                            </service>

                                            <component name="ProcessOrder">

                                                <implementation.bpm xmlns="urn:switchyard-component-bpm:config:1.0" processDefinition="META-INF/ProcessOrder.bpmn" processId="ProcessOrder">

                                                    <taskHandler class="org.switchyard.component.bpm.task.SwitchYardServiceTaskHandler" name="SwitchYard Service"/>

                                                </implementation.bpm>

                                                <service name="ProcessOrder">

                                                    <interface.java interface="org.switchyard.quickstarts.bpm.service.ProcessOrder"/>

                                                </service>

                                            </component>

                                            <component xmlns="" name="Shipping">

                                                <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="org.switchyard.quickstarts.bpm.service.ShippingBean"/>

                                                <service xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="Shipping">

                                                    <interface.java interface="org.switchyard.quickstarts.bpm.service.Shipping"/>

                                                </service>

                                            </component>

                                            <component name="BackOrder">

                                                <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="org.switchyard.quickstarts.bpm.service.BackOrderBean"/>

                                                <service xmlns="" name="BackOrder">

                                                    <interface.java xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" interface="org.switchyard.quickstarts.bpm.service.BackOrder"/>

                                                </service>

                                            </component>

                                            <component xmlns="" name="Inventory">

                                                <implementation.bean xmlns="urn:switchyard-component-bean:config:1.0" class="org.switchyard.quickstarts.bpm.service.InventoryBean"/>

                                                <service xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="Inventory">

                                                    <interface.java interface="org.switchyard.quickstarts.bpm.service.Inventory"/>

                                                </service>

                                            </component>

                                        </composite>

                                    </switchyard>

                                    1 2 Previous Next