Mapping Network drives in Weblogic (Windows)

In situations where you need to talk to a remote file system from OSB running in Windows machines, you need to map the remote file system to a local drive letter. This scenario caters for two requirements.

1. When you have your OSB cluster spanning multiple servers and all servers need access to a common file (for read only purpose), it is better to have this file sit in a file share accessible by all machines. An example is when using OSB to connect to MQ as foreign JMS, the .bindings file containing the remote JNDI tree for MQ objects can be placed in a file share.

2. In File integrations where you need OSB to read from or write to an external file system.

OSB’s file transport doesn’t support UNC format names for accessing files. Hence mapping to a drive letter is mandatory. This can be done in at-least in 3 ways:

1. If OSB servers are started locally from windows user session.
Map network drive and assign drive letter in windows explorer


Use File endpoint URI starting with the drive letter. Example, Use K :\< file-name> to access files within my_directory

2. IF OSB servers are started as windows service or started by node managers which runs as windows service (typical in SIT or Prod environments) then the Weblogic process will be running in a different user session. In this case you can follow one of the below approach for mapping

a) Do the mapping in setDomainEnv for the domain
E.g. add the below line in setDomainEnv.cmd script in $DOMAIN_HOME/bin directory
NET USE K: \\10.11.2.32\my_directory /user:atheek Dec@2011

K: – is the mapped drive letter

\\10.11.2.32\my_directory  – is the root of remote file system

atheek – name of user authorized to connect to remote file system.

Dec@2011 – password for user atheek
then you can use K:\file to access files within my_directory

Limitation with this method is that password is in clear text. If you don’t want outsiders to see the password, make sure to secure the file system containing DOMAIN_HOME

This setting works only for 1 domain as it is set on the setDomainEnv for the domain. Example, to map a filesystem used only in a specific File integration

Instead if you want to have the mapping across all servers belonging to different domains  running on the same machine, then set the mapping details in node manager service.

b) Do the mapping in Node Manager Service.

Node Managers are usually configured as Windows service. This makes the node managers to start automatically when the machine starts. Since the WebLogic server processes are started by Node Manager, they are child processes to the Node Manager process. Hence if we do the drive mapping in Node Manager it will be available to all child Weblogic server processes started by it.

The drive mapping is configured in the script used to install the node manager service. The location for this script is $MIDDLEWARE_HOME/wlserver_10.3/server/bin/installNodeManagerSvc.cmd.

Edit this script to add the following:

-localname:”K:” -remotename:”\\10.11.2.32\my_directory″ -remoteuser:”atheek” -remotepassword:”Dec@2011”

Run this modified script which will create the windows service for node manager.


Now access windows registry key for this service. This key is HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/Oracle WebLogic NodeManager (C_Oracle_Middleware_wlserver_10.3)/parameters

As seen above the password is in encrypted form. Any weblogic servers started by this nodemanager can access the remote file system using the mapped drive K: The limitation with this method is that it allows only one file system to be mapped.

Advertisements

About atheek

I am a Weblogic consultant working in Middleware/Integration area.
This entry was posted in Weblogic and tagged , , . Bookmark the permalink.

3 Responses to Mapping Network drives in Weblogic (Windows)

  1. Hi my friend! I want to say that this post is awesome, nice written and include almost all important infos.
    I’d like to peer extra posts like this .

  2. Annie Hébert says:

    Great article! Thank you!

  3. Ivan Lendl says:

    Thanks! 🙂 This helps a lot!!!

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