tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas May <nicholas....@rmit.edu.au>
Subject New Policy: intent has no matching policy set.
Date Thu, 28 Nov 2013 05:57:50 GMT
Hi,

I'm try to create a new policy. but I get an exception when using
'requires' in the composite file (see 'webservice.composite' - line 8a),
but not when using 'policySets' (line 8b). The node is started with the
command: node = TuscanyRuntime.runComposite(composite, "target/classes");

1) Why is it not finding the policySet defined in the definitions file?

Also, I'm having difficulty in understanding how the various classes
(policy, processor, provider, interceptor, builder, and factories) interact
with each other and with the tuscany runtime.

2) Is there an overview of the policy lifecycle in Tuscany SCA 2.0?

Cheers,

Nick May.

PhD Candidate
School of Computer Science & Information Technology
RMIT University
Melbourne, Australia.
email: nicholas.may@rmit.edu.au

ps. find below a dump of relevant data.

******************
*** error message:
******************
-------------------- start message --------------------
Nov 28, 2013 11:29:15 AM
org.apache.tuscany.sca.builder.impl.CompositePolicyBuilderImpl [Composite: {
http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
ProviderComponent] (IntentNotSatisfiedAtBuild)
SEVERE: The intent
{http://tuscany.apache.org/xmlns/sca/1.1}utilityassociated with policy
subject {
http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java(class=org.walroz.wsr.webservice.ProviderImpl)
has no matching policy set
-------------------- end message --------------------


***************************
*** 'webservice.composite':
***************************
-------------------- start file --------------------
 1 <composite name="webservice"
 2            xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
 3            xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
 4            targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1">
 5
 6    <component name="ProviderComponent">
 7       <implementation.java class="org.walroz.wsr.webservice.ProviderImpl"
 8a                           requires="tuscany:utility"
    **** FAILS
 8b                           policySets="tuscany:utilityPolicySet"
   **** WORKS
 9 />
10       <service name="Provider"><binding.ws/></service>
11       <reference name="replica" target="Replica1/Replica"/>
12    </component>
13
14    <component name="Replica1">
15       <implementation.java
class="org.walroz.wsr.webservice.ReplicaImpl"/>
16       <service name="Replica"/>
17       <property name="message">Hello,</property>
18    </component>
19 </composite>
-------------------- end file --------------------


*****************************************************
*** files in 'src/main/resources/META-INF/services/';
*****************************************************
*** 'org.apache.tuscany.sca.assembly.builder.PolicyBuilder';
-------------------- start file --------------------
org.walroz.wsr.policy.utility.UtilityPolicyBuilderImpl;qname=
http://tuscany.apache.org/xmlns/sca/1.1#utility
-------------------- end file --------------------

*** 'org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor';
-------------------- start file --------------------
org.walroz.wsr.policy.utility.UtilityPolicyProcessorImpl;qname=
http://tuscany.apache.org/xmlns/sca/1.1#utilityPolicy,model=org.walroz.wsr.policy.utility.UtilityPolicy
-------------------- end file --------------------

*** 'org.apache.tuscany.sca.provider.PolicyProviderFactory';
-------------------- start file --------------------
org.walroz.wsr.policy.utility.provider.UtilityPolicyProviderFactoryImpl;model=org.walroz.wsr.policy.utility.UtilityPolicy
-------------------- end file --------------------

*** 'org.apache.tuscany.defintions.xml.Definitions';
-------------------- start file --------------------
definitions.xml
-------------------- end file --------------------


****************************************
*** 'src/main/resources/definition.xml':
****************************************
-------------------- start file --------------------
 1 <?xml version="1.0" encoding="ASCII"?>
 2
 3 <definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
 4              xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
 5              xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
 6              targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1">
 7
 8    <!-- Policy Intents Defined by the SCA Runtime -->
 9    <intent name="utility" constrains="sca:implementation">
10       <description>
11          Calculate the utility function for the component.
12       </description>
13    </intent>
14
15    <!-- Policyset Defined by the SCA Runtime -->
16    <policySet name="utilityPolicySet"
17               provides="tuscany:utility"
18               appliesTo="sca:implementation">
19       <tuscany:utilityPolicy name="utilityPolicy"/>
20    </policySet>
21
22 </definitions>
-------------------- end file --------------------


***********************************************************
*** debug output from test setup() with line 8a (requires):
***********************************************************
-------------------- start file --------------------
WebServiceTestCase.setUp() start!
1 2013-11-28 16:18:49,224 DEBUG WebServiceTestCase:log - .setUp() start!
Nov 28, 2013 4:18:49 PM org.apache.tuscany.sca.impl.NodeImpl <init>
INFO: domain: default
2 2013-11-28 16:18:49,952 DEBUG UtilityPolicyProcessorImpl:<init> -  policy
processor constructed!
3 2013-11-28 16:18:49,952 DEBUG UtilityPolicyProcessorImpl:read -  start!
4 2013-11-28 16:18:49,953 DEBUG UtilityPolicyImpl:<init> -  policy
constructed!
5 2013-11-28 16:18:49,953 DEBUG UtilityPolicyProcessorImpl:read -  policy
returned = utilityPolicy [configProperty=null]
Nov 28, 2013 4:18:50 PM org.apache.tuscany.sca.impl.NodeImpl
installContribution
INFO: installContribution: webservice
Nov 28, 2013 4:18:50 PM
org.apache.tuscany.sca.builder.impl.CompositePolicyBuilderImpl [Composite: {
http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
ProviderComponent] (IntentNotSatisfiedAtBuild)
SEVERE: The intent
{http://tuscany.apache.org/xmlns/sca/1.1}utilityassociated with policy
subject {
http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java(class=org.walroz.wsr.webservice.ProviderImpl)
has no matching policy set
WebServiceTestCase.setUp() failed with:
org.apache.tuscany.sca.monitor.ValidationException: [Composite: {
http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
ProviderComponent] - The intent {
http://tuscany.apache.org/xmlns/sca/1.1}utility associated with policy
subject {
http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java(class=org.walroz.wsr.webservice.ProviderImpl)
has no matching policy set
java.lang.RuntimeException:
org.apache.tuscany.sca.monitor.ValidationException: [Composite: {
http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
ProviderComponent] - The intent {
http://tuscany.apache.org/xmlns/sca/1.1}utility associated with policy
subject {
http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java(class=org.walroz.wsr.webservice.ProviderImpl)
has no matching policy set
6 2013-11-28 16:18:50,384 DEBUG WebServiceTestCase:log - .setUp() failed
with: org.apache.tuscany.sca.monitor.ValidationException: [Composite: {
http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
ProviderComponent] - The intent {
http://tuscany.apache.org/xmlns/sca/1.1}utility associated with policy
subject {
http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java(class=org.walroz.wsr.webservice.ProviderImpl)
has no matching policy set
at
org.apache.tuscany.sca.TuscanyRuntime.runComposite(TuscanyRuntime.java:136)
at
org.apache.tuscany.sca.TuscanyRuntime.runComposite(TuscanyRuntime.java:100)
at WebServiceTestCase.setUp(WebServiceTestCase.java:51)
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.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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.apache.tuscany.sca.monitor.ValidationException: [Composite: {
http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component:
ProviderComponent] - The intent {
http://tuscany.apache.org/xmlns/sca/1.1}utility associated with policy
subject {
http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java(class=org.walroz.wsr.webservice.ProviderImpl)
has no matching policy set
at org.apache.tuscany.sca.monitor.Monitor.analyzeProblems(Monitor.java:356)
at
org.apache.tuscany.sca.impl.DeployedComposite.build(DeployedComposite.java:105)
at
org.apache.tuscany.sca.impl.DeployedComposite.<init>(DeployedComposite.java:81)
at org.apache.tuscany.sca.impl.NodeImpl.startComposite(NodeImpl.java:383)
at
org.apache.tuscany.sca.TuscanyRuntime.runComposite(TuscanyRuntime.java:127)
... 25 more
WebServiceTestCase.setUp() end!

7 2013-11-28 16:18:50,384 DEBUG WebServiceTestCase:log - .setUp() end!
-------------------- end file --------------------


****************************************************************************
*** debug output from test setup() & testInvoke() with line 8b
(policySets):
****************************************************************************
-------------------- start file --------------------

WebServiceTestCase.setUp() start!
1 2013-11-28 16:22:46,801 DEBUG WebServiceTestCase:log - .setUp() start!
Nov 28, 2013 4:22:46 PM org.apache.tuscany.sca.impl.NodeImpl <init>
INFO: domain: default
2 2013-11-28 16:22:47,534 DEBUG UtilityPolicyProcessorImpl:<init> -  policy
processor constructed!
3 2013-11-28 16:22:47,535 DEBUG UtilityPolicyProcessorImpl:read -  start!
4 2013-11-28 16:22:47,536 DEBUG UtilityPolicyImpl:<init> -  policy
constructed!
5 2013-11-28 16:22:47,536 DEBUG UtilityPolicyProcessorImpl:read -  policy
returned = utilityPolicy [configProperty=null]
Nov 28, 2013 4:22:47 PM org.apache.tuscany.sca.impl.NodeImpl
installContribution
INFO: installContribution: webservice
6 2013-11-28 16:22:48,050 DEBUG UtilityPolicyProviderFactoryImpl:<init> -
 policy provider factory constructed!
7 2013-11-28 16:22:48,051 DEBUG
UtilityImplementationPolicyProviderImpl:<init> -  policy provider
[implementation] constructed!
8 2013-11-28 16:22:48,052 DEBUG UtilityPolicyProviderFactoryImpl:<init> -
 policy provider factory constructed!
9 2013-11-28 16:22:48,052 DEBUG
UtilityImplementationPolicyProviderImpl:<init> -  policy provider
[implementation] constructed!
2013-11-28 16:22:48.221:INFO::Logging to STDERR via
org.mortbay.log.StdErrLog
10 2013-11-28 16:22:48,231 DEBUG
UtilityImplementationPolicyProviderImpl:<init> -  policy provider
[implementation] constructed!
11 2013-11-28 16:22:48,231 DEBUG
UtilityImplementationPolicyProviderImpl:<init> -  policy provider
[implementation] constructed!
12 2013-11-28 16:22:48,238 DEBUG UtilityServicePolicyProviderImpl:<init> -
 policy provider [service] constructed!
13 2013-11-28 16:22:48,239 DEBUG UtilityServicePolicyProviderImpl:<init> -
 policy provider [service] constructed!
Nov 28, 2013 4:22:48 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
INFO: jetty-6.1.26
Nov 28, 2013 4:22:48 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
INFO: Started SelectChannelConnector@0.0.0.0:8080
Nov 28, 2013 4:22:48 PM org.apache.tuscany.sca.http.jetty.JettyServer
addServletMapping
INFO: Added Servlet mapping:
http://131.170.134.3:8080/ProviderComponent/Provider
Nov 28, 2013 4:22:48 PM
org.apache.tuscany.sca.core.assembly.impl.DomainRegistryImpl addEndpoint
INFO: Add endpoint - binding.ws -
http://131.170.134.3:8080/ProviderComponent/Provider
14 2013-11-28 16:22:48,413 DEBUG UtilityServicePolicyProviderImpl:<init> -
 policy provider [service] constructed!
15 2013-11-28 16:22:48,414 DEBUG UtilityServicePolicyProviderImpl:<init> -
 policy provider [service] constructed!
Nov 28, 2013 4:22:48 PM
org.apache.tuscany.sca.core.assembly.impl.DomainRegistryImpl addEndpoint
INFO: Add endpoint - binding.sca - Replica1/Replica
Nov 28, 2013 4:22:48 PM org.apache.tuscany.sca.impl.NodeImpl startComposite
INFO: startComposite: webservice/webservice.composite
WebServiceTestCase.setUp() end!
16 2013-11-28 16:22:48,414 DEBUG WebServiceTestCase:log - .setUp() end!

WebServiceTestCase.testInvoke() start!
17 2013-11-28 16:22:48,414 DEBUG WebServiceTestCase:log - .testInvoke()
start!
18 2013-11-28 16:22:48,429 DEBUG UtilityReferencePolicyProviderImpl:<init>
-  policy provider [reference] constructed for endpointreference =
(@1224884654)EndpointReference:  URI =
ProviderComponent#reference-binding($self$.Provider/Provider)
WIRED_TARGET_FOUND_AND_MATCHED Target = (@783943498)Endpoint:  URI =
ProviderComponent#service-binding(Provider/Provider)
19 2013-11-28 16:22:48,429 DEBUG UtilityReferencePolicyProviderImpl:<init>
-  policy provider [reference] constructed for endpointreference =
(@1224884654)EndpointReference:  URI =
ProviderComponent#reference-binding($self$.Provider/Provider)
WIRED_TARGET_FOUND_AND_MATCHED Target = (@783943498)Endpoint:  URI =
ProviderComponent#service-binding(Provider/Provider)
Nov 28, 2013 4:22:48 PM
org.apache.tuscany.sca.extensibility.ServiceDiscovery
removeDuplicateDeclarations
WARNING: Duplicate service declaration is detected: Location:
jar:file:/Users/nmay/.m2/repository/org/apache/tuscany/sca/tuscany-base-runtime/2.0/tuscany-base-runtime-2.0.jar!/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessor
ClassLoader: sun.misc.Launcher$AppClassLoader@558fe7c3 Attributes:
{class=org.apache.tuscany.sca.core.databinding.wire.DataBindingRuntimeWireProcessor}
<-> Location:
jar:file:/Users/nmay/.m2/repository/org/apache/tuscany/sca/tuscany-core-databinding/2.0/tuscany-core-databinding-2.0.jar!/META-INF/services/org.apache.tuscany.sca.runtime.RuntimeWireProcessor
ClassLoader: sun.misc.Launcher$AppClassLoader@558fe7c3 Attributes:
{class=org.apache.tuscany.sca.core.databinding.wire.DataBindingRuntimeWireProcessor}
20 2013-11-28 16:22:48,603 DEBUG UtilityReferencePolicyProviderImpl:<init>
-  policy provider [reference] constructed for endpointreference =
(@886018906)EndpointReference:  URI =
ProviderComponent#reference-binding(replica/Replica)
WIRED_TARGET_FOUND_AND_MATCHED Target = (@2016531938)Endpoint:  URI =
Replica1#service-binding(Replica/Replica)
21 2013-11-28 16:22:48,603 DEBUG UtilityReferencePolicyProviderImpl:<init>
-  policy provider [reference] constructed for endpointreference =
(@886018906)EndpointReference:  URI =
ProviderComponent#reference-binding(replica/Replica)
WIRED_TARGET_FOUND_AND_MATCHED Target = (@2016531938)Endpoint:  URI =
Replica1#service-binding(Replica/Replica)
WebServiceTestCase.testInvoke() end!
22 2013-11-28 16:22:48,620 DEBUG WebServiceTestCase:log - .testInvoke() end!
-------------------- end file --------------------

Mime
View raw message