-
1. Re: Camel file Binding and move
kcbabo Dec 5, 2012 11:25 AM (in response to scisci)I just changed the camel-file-binding to include the move configuration you have above and it worked fine. Which SY version are you using? If you can attach an example to reproduce or maybe modify the camel-file-binding and try to reproduce that would help.
-
2. Re: Camel file Binding and move
scisci Dec 14, 2012 1:13 PM (in response to kcbabo)Hi, I've done what you've suggested.
I use sw version 6.0
I attachment my switchyard.xml ( I've only add move on camel-binding quickstarts)
<switchyard xmlns="urn:switchyard-config:switchyard:1.0" xmlns:camel="urn:switchyard-component-camel:config:1.0">
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="camel-binding" targetNamespace="urn:switchyard-quickstart:camel-binding:0.1.0"><service name="GreetingService" promote="GreetingService">
<camel:binding.file>
<camel:directory>target/input</camel:directory>
<camel:fileName>test.txt</camel:fileName>
<camel:consume><camel:initialDelay>50</camel:initialDelay>
<camel:delete>true</camel:delete><camel:move>backup/${date:now:yyyyMMdd}/${file:name}</camel:move>
</camel:consume>
</camel:binding.file></service>
</composite>
</switchyard>
and this is the error
19:04:22,735 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."switchyard-quickstart-camel-binding.jar".SwitchYardService:
org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-quickstart-camel-binding.jar".SwitchYardService: java.lang.IllegalArgumentException: Illegal character in query at index 79: file://target/input?fileName=test.txt&initialDelay=50&delete=true&move=backup/${date:now:yyyyMMdd}/${file:name}
SwitchYardService.java:79at org.switchyard.as7.extension.services.SwitchYardService.start(
)
ServiceControllerImpl.java:1811at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(
) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
ServiceControllerImpl.java:1746at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(
) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
java.lang.IllegalArgumentExceptionat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_09]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_09]
Caused by:
: Illegal character in query at index 79: file://target/input?fileName=test.txt&initialDelay=50&delete=true&move=backup/${date:now:yyyyMMdd}/${file:name}
V1CamelFileBindingModel.java:157at java.net.URI.create(Unknown Source) [rt.jar:1.7.0_09]
at org.switchyard.component.camel.config.model.file.v1.V1CamelFileBindingModel.getComponentURI(
)
InboundHandler.java:87at org.switchyard.component.camel.InboundHandler.createRouteDefinition(
)
InboundHandler.java:75at org.switchyard.component.camel.InboundHandler.<init>(
)
CamelActivator.java:123at org.switchyard.component.camel.deploy.CamelActivator.activateBinding(
)
Deployment.java:428at org.switchyard.deploy.internal.Deployment.deployServiceBindings(
)
Deployment.java:141at org.switchyard.deploy.internal.Deployment.start(
)
SwitchYardDeployment.java:103at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(
)
SwitchYardService.java:72at org.switchyard.as7.extension.services.SwitchYardService.start(
)
java.net.URISyntaxException... 5 more
Caused by:
: Illegal character in query at index 79: file://target/input?fileName=test.txt&initialDelay=50&delete=true&move=backup/${date:now:yyyyMMdd}/${file:name}
org.jboss.msc.service.StartException in service jboss.deployment.unit.\"switchyard-quickstart-camel-binding.jar\".SwitchYardService: java.lang.IllegalArgumentExceptionat java.net.URI$Parser.fail(Unknown Source) [rt.jar:1.7.0_09]
at java.net.URI$Parser.checkChars(Unknown Source) [rt.jar:1.7.0_09]
at java.net.URI$Parser.parseHierarchical(Unknown Source) [rt.jar:1.7.0_09]
at java.net.URI$Parser.parse(Unknown Source) [rt.jar:1.7.0_09]
at java.net.URI.<init>(Unknown Source) [rt.jar:1.7.0_09]
... 14 more
19:04:22,751 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "switchyard-quickstart-camel-binding.jar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"switchyard-quickstart-camel-binding.jar\".SwitchYardService" => "
: Illegal character in query at index 79: file://target/input?fileName=test.txt&initialDelay=50&delete=true&move=backup/${date:now:yyyyMMdd}/${file:name}"}}
org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-quickstart-camel-binding.jar".SwitchYardService: java.lang.IllegalArgumentException19:04:22,751 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016009: Stopping weld service for deployment switchyard-quickstart-camel-binding.jar
19:04:22,766 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment switchyard-quickstart-camel-binding.jar in 16ms
19:04:22,766 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."switchyard-quickstart-camel-binding.jar".SwitchYardService:
: Illegal character in query at index 79: file://target/input?fileName=test.txt&initialDelay=50&delete=true&move=backup/${date:now:yyyyMMdd}/${file:name}
org.jboss.msc.service.StartException in service jboss.deployment.unit.\"switchyard-quickstart-camel-binding.jar\".SwitchYardService: java.lang.IllegalArgumentException19:04:22,766 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"switchyard-quickstart-camel-binding.jar\".SwitchYardService" => "
: Illegal character in query at index 79: file://target/input?fileName=test.txt&initialDelay=50&delete=true&move=backup/${date:now:yyyyMMdd}/${file:name}"}}}}
Any help
Thank
-
3. Re: Camel file Binding and move
kcbabo Dec 16, 2012 9:01 PM (in response to scisci)OK, so tried this again and still can't reproduce it. That said, I'm using a current build of 0.7 SNAPSHOT and you are using 0.6 Final. I went back and tried 0.6 Final and I was able to reproduce what you are seeing.
@Lukasz - can you think of something we changed in 0.7 to allow for this? -
4. Re: Camel file Binding and move
splatch Dec 17, 2012 9:49 AM (in response to kcbabo)Yes, there was small change which may lead to behavior change between 0.6 and 0.7: https://github.com/jboss-switchyard/components/blob/master/common/camel/src/main/java/org/switchyard/component/camel/common/model/v1/V1BaseCamelBindingModel.java#L109
This line was not present in 0.6. In general it was introduced to avoid 'unsafe' URIs.
@mirko - could you try quote the sings {} to be URI compatible - try %7B for { and %7D for }?
-
5. Re: Camel file Binding and move
scisci Dec 18, 2012 4:33 AM (in response to splatch)Hi,
I've changed { and } with %7B and %7D and now it's working.
Thanks