You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/09/11 22:13:46 UTC

[jira] [Commented] (CAMEL-9094) Can't use custom FTPParser on OSGI

    [ https://issues.apache.org/jira/browse/CAMEL-9094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14741472#comment-14741472 ] 

ASF GitHub Bot commented on CAMEL-9094:
---------------------------------------

GitHub user cunningt opened a pull request:

    https://github.com/apache/camel/pull/610

    CAMEL-9094 Can't use custom FTPParser on OSGI

    https://issues.apache.org/jira/browse/CAMEL-9094
    
    Use ClassResolver to resolve class instead of Class.forName in DefaultFTPFileEntryParserFactory 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cunningt/camel CAMEL-9094

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/610.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #610
    
----
commit 6e1950d349a66298a315a63a0bb1db34fe7db715
Author: cunningt <tc...@redhat.com>
Date:   2015-09-11T20:12:17Z

    CAMEL-9094 Can't use custom FTPParser on OSGI

----


> Can't use custom FTPParser on OSGI
> ----------------------------------
>
>                 Key: CAMEL-9094
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9094
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.15.2
>            Reporter: Tom Cunningham
>            Priority: Minor
>             Fix For: Future
>
>
> Using a custom ftp entry parser on OSGI results in an exception because of the use of Class.forName in commons-net DefaultFTPFileEntryParserFactory :
> {code}
> org.apache.commons.net.ftp.parser.ParserInitializationException: Unknown parser type: com.example.CustomFTPEntryParser
>  
>         at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:166)[commons-net:commons-net:3.3]
>         at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:202)[commons-net:commons-net:3.3]
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3246)[commons-net:commons-net:3.3]
>         at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2930)[commons-net:commons-net:3.3]
>         at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2977)[commons-net:commons-net:3.3]
>         at org.apache.camel.component.file.remote.FtpOperations.listFiles(FtpOperations.java:779)[org.apache.camel:camel-ftp:2.12.0.redhat-611433]
>         at org.apache.camel.component.file.remote.FtpConsumer.doPollDirectory(FtpConsumer.java:91)[org.apache.camel:camel-ftp:2.12.0.redhat-611433]
>         at org.apache.camel.component.file.remote.FtpConsumer.pollDirectory(FtpConsumer.java:53)[org.apache.camel:camel-ftp:2.12.0.redhat-611433]
>         at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:117)[org.apache.camel:camel-core:2.12.0.redhat-611433 com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4]
>         at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[org.apache.camel:camel-core:2.12.0.redhat-611433 com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4]
>         at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[org.apache.camel:camel-core:2.12.0.redhat-611433 com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_10]
>         at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)[:1.7.0_10]
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)[:1.7.0_10]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_10]
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_10]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.7.0_10]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.7.0_10]
>         at java.lang.Thread.run(Thread.java:722)[:1.7.0_10]
> {code}
> Camel can work around this by creating a ParserFactory that is used if Camel is being used in an OSGI environment that simply extends the DefaultFTPFileEntryParserFactory and uses the Camel class resolver rather than Class.forName.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)