Ah ok, that unfortunately makes sense. If you want persisted routing
entries you have to enable them, see the wsn-consumer examples.
<persistence>
<java-persistence-class>org.apache.muse.core.routing.RouterFilePersistence</java-persistence-class>
<persistence-location>router-entries</persistence-location>
</persistence>
must be enabled in muse.xml and the router-entries must be set out
similar to the wsn example. If you want to have a different
persistence scheme you can provide your own persistence class.
With the default you must ensure that the numbering of the file names
are unique but after that you can add/remove the actual number
parameters to not require reference params eg.
<?xml version="1.0" encoding="UTF-8"?>
<wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing"/>
in the resource-instance-X.xml file.
If you do not enable persistence then each resource will get an
incremental reference parameter associated with it, which can be less
than helpful because - as you've found - the reference paremeter
number could change with each change in the muse (add remove of
resources for example).
Its also worth noting that you seem to have two instances running at
the same address, if this is intentional you should definitely look at
customising the reference params to indicate which resource is which.
For example each store could have its id as a reference.
On Mon, Oct 5, 2009 at 12:24 PM, <[email protected]> wrote:
> The think is that it works the first time that I run it after I deploy it,
> but afterwards that is the error, as far as I know the epr shouldn't change
> at all.
>
> -----Original Message-----
> From: Chris Twiner [mailto:[email protected]]
> Sent: 05 October 2009 11:09
> To: [email protected]
> Subject: Re: Extra headers not working
>
> Unless I'm missing something you aren't using the right epr. As the error
> message is telling you :
>
> <wsa:ReferenceParameters
>> xmlns:wsa="http://www.w3.org/2005/08/addressing">
>> <muse-wsa:ResourceId
>> xmlns:muse-wsa="http://ws.apache.org/muse/addressing">MuseResource-2</
>> mu
>> se-wsa:ResourceId>
>> </wsa:ReferenceParameters>
>
> seems to be missing.
>
> epr.addParameter(WsaConstants.DEFAULT_RESOURCE_ID_QNAME, "MuseResource-" + x);
>
> should help.
>
> On Mon, Oct 5, 2009 at 11:27 AM, <[email protected]> wrote:
>> Hi all,
>>
>> I have built a client for my muse app with wsd2java and I have added
>> the flag -headers to be able to add headers to the call that I need to
>> extract with another component.
>>
>> The proxy has been generated w/out any problem and it has the new
>> parameter Element[] in all the methods. To test it I am putting null
>> just to make a normal call to the webapp and I am having this issue.
>>
>> This is the call I am doing:
>>
>> public void testCreate() throws SoapFault {
>> proxy = new WsSongStoreProxy(new
>> EndpointReference(URI.create(providerUrl)), null);
>> proxy = new WsSongStoreProxy (elemToEpr
>> (proxy.createOperation(null)), null);
>> proxy.setTrace(true);
>> }
>>
>> And this is the trace with the error I am getting.
>>
>> org.apache.muse.ws.addressing.soap.SoapFault: [ID =
>> 'DestinationUnreachable'] There is no resource available at the given
>> EPR:
>>
>> <wsa:EndpointReference
>> xmlns:wsa="http://www.w3.org/2005/08/addressing">
>>
>> <wsa:Address>http://127.0.0.1:8080/WsSongStore/services/WsSongStore</w
>> sa
>> :Address>
>> </wsa:EndpointReference>
>>
>> The existing EPRs hosted by this endpoint are:
>>
>> <wsa:EndpointReference
>> xmlns:wsa="http://www.w3.org/2005/08/addressing">
>> <wsa:ReferenceParameters
>> xmlns:wsa="http://www.w3.org/2005/08/addressing">
>> <muse-wsa:ResourceId
>> xmlns:muse-wsa="http://ws.apache.org/muse/addressing">MuseResource-2</
>> mu
>> se-wsa:ResourceId>
>> </wsa:ReferenceParameters>
>>
>> <wsa:Address>http://127.0.0.1:8080/WsSongStore/services/WsSongStore</w
>> sa
>> :Address>
>> </wsa:EndpointReference>
>>
>> <wsa:EndpointReference
>> xmlns:wsa="http://www.w3.org/2005/08/addressing">
>> <wsa:ReferenceParameters
>> xmlns:wsa="http://www.w3.org/2005/08/addressing">
>> <muse-wsa:ResourceId
>> xmlns:muse-wsa="http://ws.apache.org/muse/addressing">MuseResource-3</
>> mu
>> se-wsa:ResourceId>
>> </wsa:ReferenceParameters>
>>
>> <wsa:Address>http://127.0.0.1:8080/WsSongStore/services/WsSongStore</w
>> sa
>> :Address>
>> </wsa:EndpointReference>
>> at
>> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
>> en
>> t.java:298)
>> at
>> org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceCli
>> en
>> t.java:232)
>> at
>> test.proxy.WsSongStoreProxy.createOperation(WsSongStoreProxy.java:131)
>> at core.testHeaders.testCreate(testHeaders.java:26)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
>> av
>> a:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
>> or
>> Impl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at junit.framework.TestCase.runTest(TestCase.java:164)
>> at junit.framework.TestCase.runBare(TestCase.java:130)
>> at junit.framework.TestResult$1.protect(TestResult.java:106)
>> at junit.framework.TestResult.runProtected(TestResult.java:124)
>> at junit.framework.TestResult.run(TestResult.java:109)
>> at junit.framework.TestCase.run(TestCase.java:120)
>> at junit.framework.TestSuite.runTest(TestSuite.java:230)
>> at junit.framework.TestSuite.run(TestSuite.java:225)
>> at
>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(J
>> Un
>> it3TestReference.java:130)
>> at
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.
>> ja
>> va:38)
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
>> Te
>> stRunner.java:467)
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote
>> Te
>> stRunner.java:683)
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR
>> un
>> ner.java:390)
>> at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
>> Ru
>> nner.java:197)
>>
>> Thanks
>>
>> JuanLu
>>
>