實現Spring集成的Spring引導應用程序試圖訪問其入站通道適配器的UNC路徑。如何解決「不表示正確可訪問的目錄」UNC路徑異常?
的問題是,我收到以下異常:
13:29:52.925 [task-scheduler-10] ERROR o.s.i.handler.LoggingHandler -
org.springframework.messaging.MessagingException: The path
[\\server\sharepath] does not denote a properly accessible directory.
請問該如何解決這個問題?
集成配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd">
<int-file:inbound-channel-adapter id="filesIn" directory="${input.path}" filename-regex="${file.pattern}">
<int:poller id="poller" fixed-rate="500"/>
</int-file:inbound-channel-adapter>
<int-file:file-to-string-transformer input-channel="filesIn" output-channel="strings" delete-files="true" />
<int:channel id="strings"/>
<int:service-activator input-channel="strings"
output-channel="output"
ref="handler"/>
<int-file:outbound-channel-adapter id="output"
directory="${archive.path}"
delete-source-files="true"/>
<bean id="handler" class="com.giotta.service.DataHandler"/>
</beans>
在此配置中使用的性質與-D
注入。
例如,java jar -Dinput.path="\\\\remote_host_ip\\path\\"
路徑絕對是UNC路徑。我想我已經編輯了原來那裏的IP地址。 –
我回來了。顯示的文字並不是額外的\ –
啊!你的意思是這樣的https://en.wikipedia.org/wiki/Path_%28computing%29。當您指定遠程共享目錄的路徑時。那麼,我們需要了解Java如何與之協同工作,首先... –