Announcement Announcement Module
No announcement yet.
Inbound-channel-adapter unable to resolve cluster host name Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inbound-channel-adapter unable to resolve cluster host name

    Spring 3.0.3-RELEASE
    SI 2.0.1-RELEASE
    Java Hotspot 1.6.0_26 (64-bit)
    Oracle Weblogic
    Windows Server 2003 R2 - Standard Edition x64


    I know very little about Spring, so I apologize in advance.

    We have an inbound-channel-adapter which uses a UNC path for its directory value. The UNC path points to a public share hosted on an MS cluster (active-passive). When we specify the cluster name the lookup fails.

    Caused by: java.lang.IllegalArgumentException: Source directory [\\clustername\publicshare\some\directory\location] does not exist.
    at org.springframework.util.Assert.isTrue( :65)
    at org.springframework.integration.file.FileReadingMe ssageSource.onInit( 93)
    at org.springframework.integration.context.Integratio nObjectSupport.afterPropertiesSet(IntegrationObjec
    Here is what the inbound-channel-adapter looks like:

     <file:inbound-channel-adapter id="sFilesIn" directory="file:${strace.outbound.location}" prevent-duplicates="true" filename-pattern="*.TXT">
      <int:poller id="sPoller" fixed-delay="${d.dbpoller.interval}"/>
    <int:router input-channel="sFilesIn" ref="fileProcessRouter" method="poller" default-output-channel="sFilesOut"/>
    strace.outbound.location is specified in a properties file, with the following value:

    I've also tried specifying the cluster IP address and that also failed with the same error. I've tried including trailing slashes for the property value, that made no difference.

    However, when I specify the host name of the active cluster node, it works just fine.

    The problem is not specific to this channel-adapter, because when I change the strace.outbound.location property to use the active node host name, and keep other properties referring to the cluster name, those adapters (further down stream) fail with the same error message (albeit a slightly different folder on that same server).

    It seems the IllegalArgumentException is being thrown by org.springframework.util.Assert.

    public static void isTrue(boolean expression,
                              String message)
        Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
        Assert.isTrue(i > 0, "The value must be greater than zero");
            expression - a boolean expression
            message - the exception message to use if the assertion fails 
            IllegalArgumentException - if expression is false
    I looked at the oninit method in and I believe this is the call that triggers the exception

                                    "Source directory [" + directory + "] does not exist.");
    It seems that directory is simply an instance of, based on the declaration I see in

    private volatile File directory;
    I look at, and it says that we need to use 4 slashes for Windows UNC paths, which we are doing.

    The prefix of a UNC pathname is "\\\\"; the hostname and the share name are the first two names in the name sequence.
    I don't see any warnings about using cluster names.

    I don't think it's a SI issue per se, but I figured the community may have come across this type of issue before. Maybe someone has seen this listed as bug or limitation in the Java specs?

    To summarize:

    - MS cluster (active-passive) configuration
    - Using cluster name does not work
    - Using cluster IP address does not work
    - Using active node host name does work
    - Cluster name and cluster IP address resources are currently owned by active node


  • #2
    Can you try this:

    file:/clustername/publicshare/some/directory/location as well as file://clustername/publicshare/some/directory/location

    There is a lot of chatter about Java not really handling UNC paths properly. For example here is one bug: