UNC Mapping and the DFC

I have a DFC/Documentum client application written in Java that resides on a shared network drive.  Users launch the application by clicking a shortcut to a batch file located on the shared drive.  The batch file sets the class path and makes other prerequisite checks before launching Java and loading the executable JAR file.  This arrangement works great as long as the user has mapped the shared network drive to the proper drive letter on their workstation (e.g., P:).  I converted all of the hardcoded drive letters to UNC nomenclature to alleviate the user from having to have the network drive mapped (some didn’t, and some didn’t know the correct location to map to).  When I did this, the DFC broke with the following error:

[DFC_SECURITY_IDENTITY_INIT] no identity initialization or incomplete identity initialization DfException:: THREAD: pool-1-thread-1; MSG: win remote files not supported, \\server\share$\dir1\dir2\dir3\dfc.keystore; ERRORCODE: ff; NEXT: null

Interesting, eh?

The fix turned out to be fairly simple using the DOS command, subst.  In the batch file I added a few lines like the following, and the DFC was happy.

REM map p: drive to the location of the Java app.
REM This is necessary because the DFC cannot use a UNC
REM mapped path. The subst command tricks it to think the
REM p: drive is attached.

REM delete any previous subst path assigned to p:
subst p: /D

REM assign path to p:
subst p: \\server\share$\dir1\dir2\dir3

REM run app
p:\jre\bin\java -classpath p:\lib; -jar p:\JavaApp.jar

REM remove the subst drive from p:
subst p: /D

You could also use the net use command instead of subst if you like.  Both net use and Windows Explorer ultimately use the subst command to mount drives.  Note that some environments may prohibit normal user profiles from executing subst and net use commands.  YMMV.


About Scott
I have been implementing Documentum solutions since 1997. In 2005, I published a book about developing Documentum solutions for the Documentum Desktop Client (ISBN 0595339689). In 2010, I began this blog as a record of interesting and (hopefully) helpful bits of information related to Documentum, and as a creative outlet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: