我正在尝试通过 MULE 连接 SFTP 服务器。但它正在抛出 NULL_POINTER_EXCEPTION。这是我的 XML,
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:sftp="http://www.mulesoft.org/schema/mule/sftp" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/sftp http://www.mulesoft.org/schema/mule/sftp/current/mule-sftp.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
<spring:beans>
<spring:bean id="property-placeholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<spring:property name="location" value="classpath:sftp.properties"/>
</spring:bean>
</spring:beans>
<sftp:connector name="SFTP" validateConnections="true" doc:name="SFTP">
<sftp:proxy-config host="${sftp.host}" port="${sftp.port}" username="${sftp.user}" password="${sftp.password}" protocol="HTTP"/>
</sftp:connector>
<flow name="sftp_to_locFlow">
<sftp:inbound-endpoint host="${sftp.host}" port="${sftp.port}" user="${sftp.user}" password="${sftp.password}" responseTimeout="10000" doc:name="SFTP" path="D:/SFTP/TEST-DEV/SIP_INTEGRATIONS/AIM/Incoming/Dev" connector-ref="SFTP">
</sftp:inbound-endpoint>
<logger message="File Transferring from sftp to local" level="INFO" doc:name="Logger"/>
<file:outbound-endpoint path="/SIP/appaccts/sip_app/mule_inbound" responseTimeout="10000" doc:name="File"/>
<catch-exception-strategy doc:name="sftp_to_locCatch_Exception_Strategy"/>
</flow>
</mule>
请提出您的建议以避免此错误!
错误堆栈跟踪:
org.mule.module.launcher.DeploymentStartException: NullPointerException:
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:178) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.artifact.ArtifactWrapper$4.execute(ArtifactWrapper.java:106) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.executeWithinArtifactClassLoader(ArtifactWrapper.java:137) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.artifact.ArtifactWrapper.start(ArtifactWrapper.java:101) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:73) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:536) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployArtifact(DefaultArchiveDeployer.java:333) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedApp(DefaultArchiveDeployer.java:325) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DefaultArchiveDeployer.deployExplodedArtifact(DefaultArchiveDeployer.java:100) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.deployExplodedApps(DeploymentDirectoryWatcher.java:298) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.DeploymentDirectoryWatcher.start(DeploymentDirectoryWatcher.java:156) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.MuleDeploymentService.start(MuleDeploymentService.java:139) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at org.mule.module.launcher.MuleContainer.start(MuleContainer.java:172) ~[mule-module-launcher-3.9.0.jar:3.9.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
at org.mule.module.reboot.MuleContainerWrapper.start(MuleContainerWrapper.java:52) ~[mule-module-reboot-3.9.0.jar:3.9.0]
at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788) ~[wrapper-3.2.3.jar:3.2.3]
Caused by: org.mule.api.lifecycle.LifecycleException: Failed to start inbound endpoint "endpoint.sftp.10.136.115.22.22.D.SFTP.TEST.DEV.SIP.INTEGRATIONS.AIM.Incoming.Dev"
at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:119) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.api.lifecycle.LifecycleUtils.startIfNeeded(LifecycleUtils.java:92) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSource(DefaultMuleContext.java:384) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startPipelineMessageSources(DefaultMuleContext.java:375) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSources(DefaultMuleContext.java:338) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:323) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:146) ~[mule-module-launcher-3.9.0.jar:3.9.0]
... 18 more
Caused by: org.mule.retry.RetryPolicyExhaustedException: Fail to connect
at org.mule.retry.policies.AbstractPolicyTemplate.execute(AbstractPolicyTemplate.java:111) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.sftp.SftpMessageReceiver.doConnect(SftpMessageReceiver.java:297) ~[mule-transport-sftp-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractMessageReceiver.connectHandler(AbstractMessageReceiver.java:448) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractTransportMessageHandler.connect(AbstractTransportMessageHandler.java:217) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractConnector.registerListener(AbstractConnector.java:1299) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:105) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.api.lifecycle.LifecycleUtils.startIfNeeded(LifecycleUtils.java:92) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSource(DefaultMuleContext.java:384) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startPipelineMessageSources(DefaultMuleContext.java:375) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSources(DefaultMuleContext.java:338) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:323) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:146) ~[mule-module-launcher-3.9.0.jar:3.9.0]
... 18 more
Caused by: java.lang.Exception: Fail to connect
at org.mule.transport.sftp.SftpMessageReceiver$2.doWork(SftpMessageReceiver.java:323) ~[mule-transport-sftp-3.9.0.jar:3.9.0]
at org.mule.retry.policies.AbstractPolicyTemplate.execute(AbstractPolicyTemplate.java:63) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.sftp.SftpMessageReceiver.doConnect(SftpMessageReceiver.java:297) ~[mule-transport-sftp-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractMessageReceiver.connectHandler(AbstractMessageReceiver.java:448) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractTransportMessageHandler.connect(AbstractTransportMessageHandler.java:217) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractConnector.registerListener(AbstractConnector.java:1299) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:105) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.api.lifecycle.LifecycleUtils.startIfNeeded(LifecycleUtils.java:92) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSource(DefaultMuleContext.java:384) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startPipelineMessageSources(DefaultMuleContext.java:375) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSources(DefaultMuleContext.java:338) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:323) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:146) ~[mule-module-launcher-3.9.0.jar:3.9.0]
... 18 more
Caused by: java.lang.NullPointerException
at org.mule.transport.sftp.SftpConnector.releaseClient(SftpConnector.java:269) ~[mule-transport-sftp-3.9.0.jar:3.9.0]
at org.mule.transport.sftp.SftpReceiverRequesterUtil.checkSFTPConnection(SftpReceiverRequesterUtil.java:169) ~[mule-transport-sftp-3.9.0.jar:3.9.0]
at org.mule.transport.sftp.SftpMessageReceiver$2.doWork(SftpMessageReceiver.java:308) ~[mule-transport-sftp-3.9.0.jar:3.9.0]
at org.mule.retry.policies.AbstractPolicyTemplate.execute(AbstractPolicyTemplate.java:63) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.sftp.SftpMessageReceiver.doConnect(SftpMessageReceiver.java:297) ~[mule-transport-sftp-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractMessageReceiver.connectHandler(AbstractMessageReceiver.java:448) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractTransportMessageHandler.connect(AbstractTransportMessageHandler.java:217) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.transport.AbstractConnector.registerListener(AbstractConnector.java:1299) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:105) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.api.lifecycle.LifecycleUtils.startIfNeeded(LifecycleUtils.java:92) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSource(DefaultMuleContext.java:384) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startPipelineMessageSources(DefaultMuleContext.java:375) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.startMessageSources(DefaultMuleContext.java:338) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:323) ~[mule-core-3.9.0.jar:3.9.0]
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:146) ~[mule-module-launcher-3.9.0.jar:3.9.0]