On Tue, Jun 28, 2011 at 3:08 PM, Laurentiu Trica
<laurentiu.tr...@moredevs.ro> wrote:
> Hi,
>
> I'm using Servicemix 4.3.2 from Fuse.
> I have the same problem if I want to use a strategy defined in another
> bundle and I want to get it with OSGI

I suggest to not use JBI. Pure OSGi works better.

>
> Regards,
> Laurentiu
>
> On Tue, Jun 28, 2011 at 8:50 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:
>
>> What version of ServiceMix are you using? And try upgrading as I have
>> seen this issue in the past fixed in a recent SMX release.
>> Albeit I think that issue was not with JBI but using just OSGi bundles.
>>
>>
>> On Thu, Jun 23, 2011 at 3:15 PM, Laurentiu Trica
>> <laurentiu.tr...@moredevs.ro> wrote:
>> > Hi everyone,
>> >
>> > I have a problem using the exclusiveReadLockStrategy for Ftp2 component.
>> > I implemented the GenericFileExclusiveReadLockStrategy interface in my
>> class
>> > and imported the bean in the DSL and then specified
>> > the exclusiveReadLockStrategy=#mybean on the FTP component URI (like I
>> saw
>> > here:
>> >
>> http://camel.465427.n5.nabble.com/How-to-Use-exclusiveReadLockStrategy-property-in-file-component-td604330.html
>> > )
>> >
>> > The problem is I get this error:
>> >
>> > javax.jbi.JBIException: java.lang.Exception: Error deploying SU
>> > msp-endpoints-ftp-test
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:101)[93:org.apache.servicemix.jbi.deployer:1.4.0.fuse-01-09]
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:334)[93:org.apache.servicemix.jbi.deployer:1.4.0.fuse-01-09]
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:264)[93:org.apache.servicemix.jbi.deployer:1.4.0.fuse-01-09]
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919)[osgi-3.6.0.v20100517.jar:]
>> > at
>> >
>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)[osgi-3.6.0.v20100517.jar:]
>> > at
>> >
>> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)[osgi-3.6.0.v20100517.jar:]
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1349)[osgi-3.6.0.v20100517.jar:]
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1300)[osgi-3.6.0.v20100517.jar:]
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:380)[osgi-3.6.0.v20100517.jar:]
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)[osgi-3.6.0.v20100517.jar:]
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:1136)[6:org.apache.felix.fileinstall:3.0.2]
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:1122)[6:org.apache.felix.fileinstall:3.0.2]
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1115)[6:org.apache.felix.fileinstall:3.0.2]
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:433)[6:org.apache.felix.fileinstall:3.0.2]
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:241)[6:org.apache.felix.fileinstall:3.0.2]
>> > Caused by: java.lang.Exception: Error deploying SU msp-endpoints-ftp-test
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.deploySUs(ServiceAssemblyInstaller.java:213)[93:org.apache.servicemix.jbi.deployer:1.4.0.fuse-01-09]
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:85)[93:org.apache.servicemix.jbi.deployer:1.4.0.fuse-01-09]
>> > ... 14 more
>> > Caused by: javax.jbi.management.DeploymentException:
>> <component-task-result
>> > xmlns="http://java.sun.com/xml/ns/jbi/management-message";>
>> > <component-name>servicemix-camel</component-name>
>> > <component-task-result-details>
>> > <task-result-details>
>> > <task-id>deploy</task-id>
>> > <task-result>FAILED</task-result>
>> > <message-type>ERROR</message-type>
>> > <task-status-msg><msg-loc-info><loc-token/><loc-message>Could not deploy
>> > xbean service unit</loc-message></msg-loc-info></task-status-msg>
>> > <exception-info>
>> > <nesting-level>1</nesting-level>
>> > <msg-loc-info>
>> > <loc-token />
>> > <loc-message>org.apache.camel.FailedToCreateRouteException: Failed to
>> create
>> > route route24: Route[[From[ftp://ftp-test@xxxx/MSP-ORDERS-TEST?pas...
>> > because of Failed to resolve endpoint:
>> > ftp://ftp-test
>> @xxxx/MSP-ORDERS-TEST?binary=true&exclusiveReadLockStrategy=%23lockStrategy&move=.archive&moveFailed=.error&password=xxxx
>> > due to: Could not find a suitable setter for property:
>> > exclusiveReadLockStrategy as there isn't a setter method with same type:
>> > de.edigrid.maspero.FtpChangedLockStrategy nor type conversion possible:
>> No
>> > type converter available to convert from type:
>> > de.edigrid.maspero.FtpChangedLockStrategy to the required type:
>> > org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy with
>> > value de.edigrid.maspero.FtpChangedLockStrategy@38a10fbf</loc-message>
>> > <stack-trace><![CDATA[org.apache.camel.RuntimeCamelException:
>> > org.apache.camel.FailedToCreateRouteException: Failed to create route
>> > route24: Route[[From[ftp://ftp-test@xxxx/MSP-ORDERS-TEST?pas... because
>> of
>> > Failed to resolve endpoint:
>> > ftp://ftp-test
>> @xxxx/MSP-ORDERS-TEST?binary=true&exclusiveReadLockStrategy=%23lockStrategy&move=.archive&moveFailed=.error&password=xxxx
>> > due to: Could not find a suitable setter for property:
>> > exclusiveReadLockStrategy as there isn't a setter method with same type:
>> > de.edigrid.maspero.FtpChangedLockStrategy nor type conversion possible:
>> No
>> > type converter available to convert from type:
>> > de.edigrid.maspero.FtpChangedLockStrategy to the required type:
>> > org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy with
>> > value de.edigrid.maspero.FtpChangedLockStrategy@38a10fbf
>> > at
>> >
>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
>> > at
>> >
>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>> > at
>> >
>> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238)
>> > at
>> >
>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
>> > at
>> >
>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
>> > at
>> >
>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
>> > at
>> >
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
>> > at
>> >
>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:88)
>> > at
>> >
>> org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:76)
>> > at
>> >
>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
>> > at
>> >
>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.deploy(ServiceUnitImpl.java:104)
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.deploySUs(ServiceAssemblyInstaller.java:207)
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:85)
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:334)
>> > at
>> >
>> org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:264)
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919)
>> > at
>> >
>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
>> > at
>> >
>> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1349)
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1300)
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:380)
>> > at
>> >
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:1136)
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:1122)
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1115)
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:433)
>> > at
>> >
>> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:241)
>> > Caused by: org.apache.camel.FailedToCreateRouteException: Failed to
>> create
>> > route route24: Route[[From[ftp://ftp-test@xxxx/MSP-ORDERS-TEST?pas...
>> > because of Failed to resolve endpoint:
>> > ftp://ftp-test
>> @xxxx/MSP-ORDERS-TEST?binary=true&exclusiveReadLockStrategy=%23lockStrategy&move=.archive&moveFailed=.error&password=xxxx
>> > due to: Could not find a suitable setter for property:
>> > exclusiveReadLockStrategy as there isn't a setter method with same type:
>> > de.edigrid.maspero.FtpChangedLockStrategy nor type conversion possible:
>> No
>> > type converter available to convert from type:
>> > de.edigrid.maspero.FtpChangedLockStrategy to the required type:
>> > org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy with
>> > value de.edigrid.maspero.FtpChangedLockStrategy@38a10fbf
>> > at
>> >
>> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:166)
>> > at
>> >
>> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:700)
>> > at
>> >
>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1623)
>> > at
>> >
>> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1412)
>> > at
>> >
>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1321)
>> > at
>> >
>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164)
>> > at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:65)
>> > at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
>> > at
>> >
>> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1299)
>> > at
>> >
>> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)
>> > at
>> >
>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>> > ... 26 more
>> > Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
>> > resolve endpoint:
>> > ftp://ftp-test
>> @xxxx/MSP-ORDERS-TEST?binary=true&exclusiveReadLockStrategy=%23lockStrategy&move=.archive&moveFailed=.error&password=xxxx
>> > due to: Could not find a suitable setter for property:
>> > exclusiveReadLockStrategy as there isn't a setter method with same type:
>> > de.edigrid.maspero.FtpChangedLockStrategy nor type conversion possible:
>> No
>> > type converter available to convert from type:
>> > de.edigrid.maspero.FtpChangedLockStrategy to the required type:
>> > org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy with
>> > value de.edigrid.maspero.FtpChangedLockStrategy@38a10fbf
>> > at
>> >
>> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:448)
>> > at
>> >
>> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:47)
>> > at
>> >
>> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:176)
>> > at
>> >
>> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110)
>> > at
>> >
>> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)
>> > at
>> >
>> org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
>> > at
>> >
>> org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88)
>> > at
>> >
>> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:755)
>> > at
>> >
>> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:161)
>> > ... 36 more
>> > Caused by: java.lang.IllegalArgumentException: Could not find a suitable
>> > setter for property: exclusiveReadLockStrategy as there isn't a setter
>> > method with same type: de.edigrid.maspero.FtpChangedLockStrategy nor type
>> > conversion possible: No type converter available to convert from type:
>> > de.edigrid.maspero.FtpChangedLockStrategy to the required type:
>> > org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy with
>> > value de.edigrid.maspero.FtpChangedLockStrategy@38a10fbf
>> > at
>> >
>> org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:341)
>> > at
>> >
>> org.apache.camel.util.EndpointHelper.setReferenceProperties(EndpointHelper.java:250)
>> > at
>> >
>> org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:199)
>> > at
>> >
>> org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:65)
>> > at
>> >
>> org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:36)
>> > at
>> >
>> org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75)
>> > at
>> >
>> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:430)
>> > ... 44 more
>> >
>> > This could be because I'm importing Camel Core via Maven in order to be
>> able
>> > to compile my custom strategy class and Servicemix is running the Camel
>> from
>> > another bundle so the classes are not compatible?
>> >
>> > Is there any workaround for this? I'm trying to make a Changed lock
>> strategy
>> > for FTP component, I'll contribute it to Camel when it's done but I just
>> > need to run it before finishing it.
>> >
>> > Thank you for your time.
>> > Laurentiu Trica
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cib...@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to