Announcement Announcement Module
Collapse
No announcement yet.
Inbound-channel-adapter unable to resolve cluster host name Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 10.3.3.0
    Windows Server 2003 R2 - Standard Edition x64

    Hi,

    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(Assert.java :65)
    at org.springframework.integration.file.FileReadingMe ssageSource.onInit(FileReadingMessageSource.java:1 93)
    at org.springframework.integration.context.Integratio nObjectSupport.afterPropertiesSet(IntegrationObjec tSupport.java:98)
    Here is what the inbound-channel-adapter looks like:

    Code:
     <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}"/>
     </file:inbound-channel-adapter>
    <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:

    Code:
    strace.outbound.location=\\\\clustername\\publicshare\\some\\directory\\location
    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.


    Code:
    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");
    
        Parameters:
            expression - a boolean expression
            message - the exception message to use if the assertion fails 
        Throws:
            IllegalArgumentException - if expression is false
    I looked at the oninit method in FileReadingMessageSource.java and I believe this is the call that triggers the exception

    Code:
    Assert.isTrue(this.directory.exists(),
                                    "Source directory [" + directory + "] does not exist.");
    It seems that directory is simply an instance of java.io.File, based on the declaration I see in FileReadingMessageSource.java.


    Code:
    import java.io.File;
    ...
    ...
    private volatile File directory;
    I look at java.io.File, 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

    Thanks,
    pimy

  • #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: http://bugs.sun.com/bugdatabase/view...bug_id=5086147

    Comment

    Working...
    X