How to deploy MapViewer to Oracle WebLogic Server

The following are the instructions for deploying the latest MapViewer (version 10.1.3.3 patch 5 or later) to WebLogic Server version 10 and 10.3.  You may try the same steps on WLS version 9, but those steps have not been tested by the MapViewer product team.

 

Deployment Overview

  • MapViewer must be deployed from an exploded directory
  • WebLogic console is used for deployment, although WLS command line can also be used.
  • A new WebLogic domain is created to host MapViewer; this is recommended due to the fact that MapViewer is a resource intensive application and it is better to run it in a separate environment such as its own domain.  It is okay to deploy MapViewer to an existing WebLogic domain.

 

Unpacking MapViewer EAR archive

As mentioned above, it is crucial that you deploy MapViewer from an exploded directory where the mapviewer.ear file is unpacked already.  WebLogic Server supports deploying a J2EE application from both its .ear file and an unpacked directory. If you deploy mapviewer.ear as is it will not work as MapViewer run time will not be able to find the directories or config files that it depends on.

 

You can unpack the mapveiwer.ear to any directory on the server that WebLogic is running. It is recommended though the directory is a permanent one (not a temporary one). It can also be a shared directory if you want the same MapViewer binaries to be deployed to multiple WebLogic servers running on multiple hosts.  This directory will become the working folder of your MapViewer installation, in the sense that MapViewer will  (by default) read the configuration file from this location, and save generated map images to a folder within this directory. 

 

1. Lets assume you have created a directory named /ul/mapviewer as the top MapViewer directory.

2. Copy mapviewer.ear file into /ul/mapviewer, rename it to mapviewer1.ear. Then create a subdirectory named mapviewer.ear.  Unpack mapviewer1.ear into mapviewer.ear.

3. In /ul/mapviewer/mapviewer.ear, rename the file web.war to web1.war.

4. Create a directory web.war in /ul/mapviewer/mapviewer.ear.

5. Unzip web1.war to the directory /ul/mapviewer/mapviewer.ear/web.war

6. Now copy the Oracle XML parser library xmlparserv2.jar (10g version) into /ul/mapviewer/mapviewer.ear/web.war/WEB-INF/lib.

     You can find xmlparserv2.jar from an Oracle database 10g install, or an OC4J 10g instance, or download it from the OTN page here: http://www.oracle.com/technology/tech/xml/xdk/software/production10g/index.html

7. Make necessary changes to MapViewer config file such as changing its logging level, adding permanent data source definitions, et al. The config file is found here:

/ul/mapviewer/mapviewer.ear/web.war/WEB-INF/conf/mapViewerConfig.xml

 

Note that you can always change this configuration later on if you need to make more changes.

 

Now that the MapViewer is unpacked and configured, we are ready to deploy and run it in WLS.  First, we need to make sure WLS is properly configured for MapViewer.

 

Configuring WLS

Here we assume you already have a WLS 10 or later version installed. For best practice it is recommended that you create a new WebLogic domain to host MapViewer. To create a new domain, please run the script $BEA_HOME/wlserver_10.0/common/bin/config.sh which will start a GUI configuration wizard.  Make sure the admin user is named “weblogic” as this is also the user you need to log into MapViewer’s Admin pages. If you named it to something else, you can configure MapViewer to work with it also (shown below).

 

Once the new domain is created, start it up by running the script $BEA_HOME/user_projects/domains/map_domain/startWebLogic.sh

 

Here map_domain is the name of the newly created domain; you can name it to anything you like.

 

If you have a domain with the Oracle ADF Runtime installed and you want to deploy MapViewer to that domain, then make sure you do NOT copy the xmlparserv2.jar file in the step 6 above.  The ADF Runtime already includes the xmlparsrv2.jar file.

Deploying and Starting MapViewer in WLS

Once the new domain is up and running, you can log into its console to start deploying MapViewer. The console is typically accessed at the URL http://<host>:7001/console where <host> is the host name or IP address of the machine running WebLogic server.

 

1. Once logged in to the console, click “Lock & Edit” button in the Change Center.

2. Now click the link “Deployments” under Domain Structure on the left side.

3. Click “Install” under the expanded “Deployments” panel box on the right side, as illustrated in the figure below. 

 

 

 

 

4. In the next page, find the location of the unpacked MapViewer directory, /ul/mapviewer/mapviewer.ear in this case. This is illustrated in the figure below. Note it is the directory that is chosen, not the .ear file. Click Next.

 

5. Select “Install this deployment as an application”, click Next.

 

6. Here we can use default values for most options. In the Source accessibility section, make sure you pick the 3rd option: I will make the deployment accessible from the following location.  This is so that the unpacked MapViewer location becomes the “working” directory of MapViewer. It also makes things easier if you want to upgrade MapViewer in the future, in which case you simply unpack the new mapviewer.ear file to this directory and restart WLS.

 

 

 

7. Click Finish.   WLS will start the deployment of MapViewer.

8. Once deployment is done, you should go to the Change Center on the top left corner, click  “Activate changes” and “Release Configuration” to finalize the deployment.

9. Now that MapViewer is deployed, it is time to start it up. To do so, select “mapviewer” from the Deployments table, then click the Start button and choose Servicing all requests. This is illustrated in the figure below:

 

 

 

Now go to http://<host>:7001/mapviewer to access MapViewer home page.

 

MapViewer Admin page login

When you first click the Admin button from MapViewer’s home page, it will present a login page.  By default you can use WebLogic’s admin account with user name “weblogic” to log in here.  If your WebLogic domain’s admin account has a different user name, then you need to change MapViewer’s weblogic.xml file, located in $MAPVIEWER_HOME/mapviewer.ear/web.war/WEB-INF/.  Open the weblogic.xml file in a text editor, then replace the 2 occurrences of  “weblogic” with the actual admin account user’s name, as shown below.

 

<security-role-assignment>

    <role-name>map_admin_role</role-name>

    <principal-name>weblogic</principal-name>

</security-role-assignment>

 

<security-role-assignment>

    <role-name>secure_maps_role</role-name>

    <principal-name>weblogic</principal-name>

</security-role-assignment>

Alternatively, you can create a new WebLogic user as the MapViewer administrator. Please check WebLogic admin guide on how to create a new user. Once the new user is created, you will need to set it in the weblogic.xml file as shown above, replacing the words  ‘weblogic’ with the new user name.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值