Return-Path: Delivered-To: apmail-servicemix-dev-archive@www.apache.org Received: (qmail 89222 invoked from network); 6 Aug 2010 01:37:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Aug 2010 01:37:44 -0000 Received: (qmail 50889 invoked by uid 500); 6 Aug 2010 01:37:44 -0000 Delivered-To: apmail-servicemix-dev-archive@servicemix.apache.org Received: (qmail 50862 invoked by uid 500); 6 Aug 2010 01:37:44 -0000 Mailing-List: contact dev-help@servicemix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@servicemix.apache.org Delivered-To: mailing list dev@servicemix.apache.org Received: (qmail 50830 invoked by uid 99); 6 Aug 2010 01:37:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Aug 2010 01:37:44 +0000 X-ASF-Spam-Status: No, hits=-1998.7 required=10.0 tests=ALL_TRUSTED,URI_HEX X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Aug 2010 01:37:43 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o761bNRl022759 for ; Fri, 6 Aug 2010 01:37:23 GMT Message-ID: <3266554.58731281058642981.JavaMail.jira@thor> Date: Thu, 5 Aug 2010 21:37:22 -0400 (EDT) From: =?UTF-8?Q?Jean-Baptiste_Onofr=C3=A9_=28JIRA=29?= To: dev@servicemix.apache.org Subject: [jira] Assigned: (SMX4-571) servicemix-vfs NullPointerException In-Reply-To: <928210.57331281058613966.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/SMX4-571?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Onofr=C3=A9 reassigned SMX4-571: ----------------------------------------- Assignee: Jean-Baptiste Onofr=C3=A9 > servicemix-vfs NullPointerException > ----------------------------------- > > Key: SMX4-571 > URL: https://issues.apache.org/activemq/browse/SMX4-571 > Project: ServiceMix 4 > Issue Type: Bug > Components: Bundles > Affects Versions: 4.2.0 > Environment: apache-servicemix-4.2.0-fuse-02-00 > Win7 64 > java version "1.6.0_21" > Java(TM) SE Runtime Environment (build 1.6.0_21-b06) > Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode) > Reporter: Andrey Viktorov > Assignee: Jean-Baptiste Onofr=C3=A9 > > servicemix-vfs fails with NullPointerException when sending. > {noformat:title=3Dservicemix.log|borderStyle=3Dsolid} > 23:33:02,649 | ERROR | ix-vfs-thread-53 | VFSComponent = | icemix.common.AsyncBaseLifeCycle 470 | Error processing exchange org.a= pache.servicemix.jbi.runtime.impl.InOnlyImpl@6687ec13 > java.lang.NullPointerException > =09at org.apache.servicemix.vfs.VFSSendingEndpoint.processInOnly(VFSSendi= ngEndpoint.java:114) > =09at org.apache.servicemix.common.endpoints.ProviderEndpoint.process(Pro= viderEndpoint.java:102) > =09at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBase= LifeCycle.java:617) > =09at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Asy= ncBaseLifeCycle.java:571) > =09at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx= (AsyncBaseLifeCycle.java:468) > =09at org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLife= Cycle.java:347) > =09at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx= ecutor.java:886) > =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut= or.java:908) > =09at java.lang.Thread.run(Thread.java:619) > {noformat}=20 > To avoid this exception it would be better to check for null value tmpNam= e variable=20 > {code:title=3Dorg.apache.servicemix.vfs.VFSSendingEndpoint.java|borderSty= le=3Dsolid} > if (name !=3D null && tmpName !=3D null && !name.equals(tmpName)) { > if (!tmpFile.canRenameTo(newFile)) { > throw new IOException("File " + tmpName + " could not be renamed = to " + name); > } else { > tmpFile.moveTo(newFile); > } > } > {code} > As discussed here http://servicemix.396122.n5.nabble.com/Exception-when-u= sing-vsf-poller-with-sftp-ServiceMix-4-2-td417225.html#a417225 > it would be nice to add root exception information along with IOException= . > {code:title=3Dorg.apache.servicemix.vfs.FileObjectResolver.java|borderSty= le=3Dsolid} > catch (FileSystemException e) { > throw new IOException("Failed to create folder: " + e, e); > } > } > catch (FileSystemException e) { > throw new IOException("Failed to initialize file system manager: " + = e, e); > } > {code} > Otherwise it is hard to track exceptions like this: > {noformat} > java.io.IOException: Failed to initialize file system manager: org.apache= .commons.vfs.FileSystemException: Could not connect to SFTP server at "sftp= ://sab:sab@192.168.1.158/". > =09at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(Fi= leObjectResolver.java:74) > =09at org.apache.servicemix.vfs.VFSPollingEndpoint.poll(VFSPollingEndpoin= t.java:229) > =09at org.apache.servicemix.common.endpoints.PollingEndpoint$PollSchedule= rTask$1.run(PollingEndpoint.java:202) > =09at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx= ecutor.java:886) > =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut= or.java:908) > =09at java.lang.Thread.run(Thread.java:619) > Caused by: org.apache.commons.vfs.FileSystemException: Could not connect = to SFTP server at "sftp://sab:sab@192.168.1.158/". > =09at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileS= ystem(SftpFileProvider.java:99) > =09at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.fin= dFile(AbstractOriginatingFileProvider.java:81) > =09at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.fin= dFile(AbstractOriginatingFileProvider.java:62) > =09at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(De= faultFileSystemManager.java:641) > =09at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(De= faultFileSystemManager.java:602) > =09at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(De= faultFileSystemManager.java:570) > =09at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(Fi= leObjectResolver.java:55) > =09... 5 more > Caused by: org.apache.commons.vfs.FileSystemException: Could not connect = to SFTP server at "192.168.1.158". > =09at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnec= tion(SftpClientFactory.java:214) > =09at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileS= ystem(SftpFileProvider.java:90) > =09... 11 more > Caused by: com.jcraft.jsch.JSchException: UnknownHostKey: 192.168.1.158. = RSA key fingerprint is 59:8f:eb:89:ef:ce:b2:8f:4d:ed:79:90:d1:1e:52:b4 > =09at com.jcraft.jsch.Session.checkHost(Session.java:712) > =09at com.jcraft.jsch.Session.connect(Session.java:309) > =09at com.jcraft.jsch.Session.connect(Session.java:145) > =09at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnec= tion(SftpClientFactory.java:210) > {noformat} > {noformat} > java.io.IOException: Failed to initialize file system manager: org.apache= .commons.vfs.FileSystemException: Could not connect to SFTP server at "sftp= ://sab:sab@192.168.1.159/". > =09at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(Fi= leObjectResolver.java:74) > =09at org.apache.servicemix.vfs.VFSPollingEndpoint.poll(VFSPollingEndpoin= t.java:229) > =09at org.apache.servicemix.common.endpoints.PollingEndpoint$PollSchedule= rTask$1.run(PollingEndpoint.java:202) > =09at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx= ecutor.java:886) > =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut= or.java:908) > =09at java.lang.Thread.run(Thread.java:619) > Caused by: org.apache.commons.vfs.FileSystemException: Could not connect = to SFTP server at "sftp://sab:sab@192.168.1.159/". > =09at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileS= ystem(SftpFileProvider.java:99) > =09at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.fin= dFile(AbstractOriginatingFileProvider.java:81) > =09at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.fin= dFile(AbstractOriginatingFileProvider.java:62) > =09at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(De= faultFileSystemManager.java:641) > =09at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(De= faultFileSystemManager.java:602) > =09at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(De= faultFileSystemManager.java:570) > =09at org.apache.servicemix.vfs.FileObjectResolver.resolveToFileObject(Fi= leObjectResolver.java:55) > =09... 5 more > Caused by: org.apache.commons.vfs.FileSystemException: Could not connect = to SFTP server at "192.168.1.159". > =09at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnec= tion(SftpClientFactory.java:214) > =09at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileS= ystem(SftpFileProvider.java:90) > =09... 11 more > Caused by: com.jcraft.jsch.JSchException: java.net.ConnectException: Conn= ection timed out: connect > =09at com.jcraft.jsch.Util.createSocket(Util.java:258) > =09at com.jcraft.jsch.Session.connect(Session.java:186) > =09at com.jcraft.jsch.Session.connect(Session.java:145) > =09at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnec= tion(SftpClientFactory.java:210) > =09... 12 more > Caused by: java.net.ConnectException: Connection timed out: connect > =09at java.net.PlainSocketImpl.socketConnect(Native Method) > =09at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) > =09at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) > =09at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) > =09at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) > =09at java.net.Socket.connect(Socket.java:529) > =09at java.net.Socket.connect(Socket.java:478) > =09at java.net.Socket.(Socket.java:375) > =09at java.net.Socket.(Socket.java:189) > =09at com.jcraft.jsch.Util.createSocket(Util.java:252) > =09... 15 more > {noformat} --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.