[switchyard-issues] [JBoss JIRA] (SWITCHYARD-566) Ordering and anmespaces Issue with annotations configuring rule service

Jeff DeLong (Created) (JIRA) jira-events at lists.jboss.org
Thu Dec 1 10:14:41 EST 2011


Ordering and anmespaces Issue with annotations configuring rule service
-----------------------------------------------------------------------

                 Key: SWITCHYARD-566
                 URL: https://issues.jboss.org/browse/SWITCHYARD-566
             Project: SwitchYard
          Issue Type: Bug
          Components: component-rules
    Affects Versions: 0.3
         Environment: MacBookPro running OS X 10.6.8
            Reporter: Jeff DeLong


I annotated my interface thus:

@Rules(
		resources={"/IrregularOperationsCEPService.drl"},
		eventProcessing=EventProcessingType.STREAM)
@Audit(log="event")

public interface IrregularOperationsCEPService {
	
	@FireUntilHalt(entryPoint="AirportClosureStream")
	void processAirportClosureMessage(AirportClosureMessage acm);
	
	@FireUntilHalt(entryPoint="FlightStatusStream")
	void processFlightStatusChangeMessage(FlightStatusChangeMessage fscm);
	
	@FireUntilHalt(entryPoint="OrderStream")
	void processOrderMessage(OrderMessage om);
	
}

I ran runAs Maven build from Eclipse and got this error:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building IrregularOperations 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ IrregularOperations ---
[INFO] Deleting /Users/jdelong/Software/Switchyard/IrregularOperations/target
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ IrregularOperations ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ IrregularOperations ---
[WARNING] File encoding has not been set, using platform encoding MacRoman, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/jdelong/Software/Switchyard/IrregularOperations/target/classes
[INFO] 
[INFO] --- switchyard-plugin:0.3.0-SNAPSHOT:configure (default) @ IrregularOperations ---
[INFO] SwitchYard plugin scanning: [file:/Users/jdelong/Software/Switchyard/IrregularOperations/target/classes/]
[INFO] Outputting SwitchYard configuration model to /Users/jdelong/Software/Switchyard/IrregularOperations/target/classes/META-INF/switchyard.xml
[INFO] Validating SwitchYard configuration model...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.581s
[INFO] Finished at: Wed Nov 30 20:44:25 MST 2011
[INFO] Final Memory: 21M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.switchyard:switchyard-plugin:0.3.0-SNAPSHOT:configure (default) on project IrregularOperations: Model [org.switchyard.config.model.switchyard.v1.V1SwitchYardModel] is invalid: cvc-complex-type.4: Attribute 'targetNamespace' must appear on element 'composite'. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


I looked at the generated switchyard.xml file, and see the actions are out of order. This is not what it is complaining about however, it seems to want a targetNamespace on composite.

<?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="IrregularOperations">
        <component name="IrregularOperationsCEPService">
            <implementation.rules xmlns="urn:switchyard-component-rules:config:1.0" clock="REALTIME" eventProcessing="STREAM" multithreadEvaluation="false">
                <action entryPoint="AirportClosureStream" name="processAirportClosureMessage" type="FIRE_UNTIL_HALT"/>
                <action entryPoint="OrderStream" name="processOrderMessage" type="FIRE_UNTIL_HALT"/>
                <audit log="event" type="THREADED_FILE"/>
                <resource location="/IrregularOperationsCEPService.drl" type="DRL"/>
                <action entryPoint="FlightStatusStream" name="processFlightStatusChangeMessage" type="FIRE_UNTIL_HALT"/>
            </implementation.rules>
            <service name="IrregularOperationsCEPService">
                <interface.java interface="net.hp.agilaire.IrregularOperationsCEPService"/>
            </service>
        </component>
    </composite>
</switchyard>



Here is my hand edited switchyard.xml

<?xml version="1.0" encoding="UTF-8"?>
<switchyard xmlns="urn:switchyard-config:switchyard:1.0"
	xmlns:camel="urn:switchyard-component-camel:config:1.0"
	      xmlns:rules="urn:switchyard-component-rules:config:1.0"
          xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912">
    <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="IrregularOperations" targetNamespace="urn:switchyard:application:IrregularOperations">
        <component name="IrregularOperationsCEPService">
             <implementation.rules xmlns="urn:switchyard-component-rules:config:1.0" eventProcessing="STREAM">
				<action name="processAirportClosureMessage" type="FIRE_UNTIL_HALT" entryPoint="AirportClosureStream"/>
				<action name="processFlightStatusChangeMessage" type="FIRE_UNTIL_HALT" entryPoint="FlightStream"/>
				<action name="processOrderMessage" type="FIRE_UNTIL_HALT" entryPoint="OrderStream"/>
        		<audit log="event" type="THREADED_FILE"/>
        		<resource location="META-INF/IrregularOperationsCEPService.drl" type="DRL"/>   
            </implementation.rules>        
            <service name="IrregularOperationsCEPService">
                <interface.java interface="net.hp.agilaire.IrregularOperationsCEPService"/>
            </service>
        </component>
        <service name="IrregularOperationsCEPService" promote="IrregularOperationsCEPService">
        	<binding.camel xmlns="urn:switchyard-component-camel:config:1.0" configURI="jms://AirportClosureQueue?connectionFactory=#ConnectionFactory">
                <operationSelector operationName="processAirportClosureMessage"/>
            </binding.camel>
            <binding.camel xmlns="urn:switchyard-component-camel:config:1.0" configURI="jms://FlightStatusQueue?connectionFactory=#ConnectionFactory">
                <operationSelector operationName="processFlightStatusChangeMessage"/>
            </binding.camel>
            <binding.camel xmlns="urn:switchyard-component-camel:config:1.0" configURI="jms://OrderStatusQueue?connectionFactory=#ConnectionFactory">
                <operationSelector operationName="processOrderMessage"/>
            </binding.camel>
        </service>
    </composite>
    <domain>
        <handlers>
            <handler class="org.switchyard.handlers.MessageTrace" name="MessageTrace"/>
        </handlers> 
    </domain>
</switchyard>



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the switchyard-issues mailing list