Tuesday Dec 21, 2010

How to Install Oracle Software on Remote Linux Server

It is becoming more common these days to install Oracle software on remote Linux servers. This issue has always existed but was generally resolved either by silent installs or by someone physically going to the server to install the software. This is becoming more difficult with the popular virtualisation and cloud deployment strategies.

This post provides the steps involved to install Oracle Software using the GUI interface on a remote Linux server. There are many ways to achieve this, the way I resolve this issue is via Virtual Network Computing (VNC) as it is shipped with RedHat and OEL out of the box. For this post I’m using OEL 5 deployed on a OVM guest.

  1. If not already done so download and install a client version of VNC so you can connect to the server. There are many out there, for the purpose of this post I use UltraVNC. You can download a free version from http://www.uvnc.com/download/index.html
  2. By default VNC Server is installed in your RedHat and OEL OS, but it is not configured. The way VNC works is when started it creates a client instance for the user and binds it to a specific port. So if have an account on the Linux box you can setup a VNC Server session for that user, you don’t need to be root. For the purpose of this document I’m going to use oracle as the user to setup a VNC Session as this is the user I want use to install the software. However to start the VNC Service you must be root.

    As the root user run the following command:

    service vncserver start
    Starting VNC server: no displays configured                [  OK  ]

  3. Login to the Linux box as the user  you wan to install the Oracle software

    [oracle@lisa ~]$
  4. Run the command to create a new VNC server instance for the oracle user:

    vncserver
  5. You will be ask to supply password information. This is what you will enter when connecting from your desktop client. This password is also independent of the actual Linux user password. The VNC Server is acting as a proxy to this instance.

    You will require a password to access your desktops.

    Password:
    Verify:
    xauth:  creating new authority file /home/oracle/.Xauthority

    New 'lisa.nz.oracle.com:1 (oracle)' desktop is lisa.nz.oracle.com:1

    Creating default startup script /home/oracle/.vnc/xstartup
    Starting applications specified in /home/oracle/.vnc/xstartup
    Log file is /home/oracle/.vnc/lisa.nz.oracle.com:1.log

  6. As you can see a new instance lisa.nz.oracle.com:1 has been created. If you were to run the vncserver command again another instance lisa.nz.oracle.com:2 will be created. If you are going through a firewall you will need to ensure that the port 5901 (port 1) is open between your client desktop and the Linux Server.
  7. Depending on the options chosen at install time a firewall could be in place. The simplest way to disable this is using the command. You will need to be root.

    service iptables stop

    This will stop the firewall while you install. If you just want to add a port to the accepted lists use the firewall UI. You will need to be root.

    system-config-security-level
  8. Now you are ready to connect to the server via the VNC. Using the software installed in step one start the VNC Client. You should be prompted for the server and port.
    image
  9. If connectivity is established, you will be prompted for the password entered in step 5.

    image
  10. You should now be presented with a terminal screen ready to install software

    image
  11. Go to the location of the oracle install software and start the Oracle Universal Installer

    image

Monday Sep 13, 2010

Startup Scripts for WebLogic and SOA Suite

Yes I know there are many blogs and sites out there that have startup scripts for WebLogic. I have noticed that some are very detailed and maybe a bit complex for a newbe. Therefore goal of this post is to provide new administrators a basic startup script for WebLogic with an emphasis on SOA Suite. You should be able to use these scripts as a base to start building more complex scripts that accept parameters, or start clusters, etc.


  1. If you want Node Manager to restart a failed Managed server you must ensure that either the nodemanager.properties file or the startup.properties has the parameters AutoRestart=true and StartScriptEnabled=true. I believe this is set to true in the startup.properties by default. The nodemanager.properties file can be found in  $MW_HOME/wlserver_10.3/common/nodemanager
  2. I use 2 scripts to start WebLogic, a control shell script, which then calls a WLST script. For the purpose of this blog I have placed the scripts in the following directory.

    /home/oracle/scripts/weblogic/startup

  3. Create a scripts called startNM.sh in the directory your choice, e.g. /home/oracle/scripts/weblogic/startup
    here is a sample, adjust for your environment:

    MW_HOME=/u01/oracle/product/middleware

    $MW_HOME/oracle_common/common/bin/setNMProps.sh

    nohup $MW_HOME/wlserver_10.3/server/bin/startNodeManager.sh > $MW_HOME/wlserver_10.3/common/nodemanager/nodemanager.out &

    nohup $MW_HOME/user_projects/domains/soa_domain/bin/startWebLogic.sh > $MW_HOME/user_projects/domains/soa_domain/servers/AdminServer/logs/AdminServer.out &

    . $MW_HOME/user_projects/domains/soa_domain/bin/setDomainEnv.sh

    java weblogic.WLST /home/oracle/scripts/weblogic/startup/startMS.py

    Please note that each command is separated by a empty line, therefore the nohup commands are one command until the &

  4. Now create the WLST script as called by the startNM.sh script above. Call it startMS.py:

    import time
    sleep=time.sleep
    print "#####################################"
    print "# Waiting for Admin Server to Start #"
    print "#####################################"
    while True:
    try:
    connect(adminServerName="AdminServer")
    break

    except:

    sleep(60)

    print "##############################"
    print "# Admin Server has come up #"
    print "##############################"

    print "##########################"
    print "# Starting SOA Server 1 #"
    print "##########################"

    start(name="soa_server1", block="true")

    print "##########################"
    print "# Starting OSB Server #"
    print "##########################"

    start(name="osb_server1", block="true")

    print "##########################"
    print "# Starting BAM Server #"
    print "##########################"

    start(name="bam_server1", block="true")

    exit()

When you use these scripts you will get errors in the WLST script while it waits for the AdminServer to come up this is to be expected so just ignore. I have set the retry for 60 seconds so it shouldn’t try too many times.

Also you may get an error like 'ERROR: transport error 202: bind failed: Address already in use'. This is caused because 2 managed servers are using the same debugging port. If this is the case then you can edit the setDomainEnv.sh file and turn debugging off. Do this by searching for debugFlag="true" and set it to false, e.g. debugFlag="false".

If you want a shutdown script, it is much the same but in reverse.


  1. Create a script called stopMN.sh in directory of your choice, e.g. /home/oracle/scripts/weblogic/shutdown:

    MW_HOME=/u01/oracle/product/middleware

    . $MW_HOME/user_projects/domains/soa_domain/bin/setDomainEnv.sh

    $MW_HOME/oracle_common/common/bin/setNMProps.sh

    java weblogic.WLST /home/oracle/scripts/weblogic/shutdown/stopMS.py

    nohup $MW_HOME/user_projects/domains/soa_domain/bin/stopWebLogic.sh > $MW_HOME/user_projects/domains/soa_domain/servers/AdminServer/logs/AdminServerShutdown.out &

  2. Create a WLST script in the same directory called stopMS.py:

    connect(adminServerName="AdminServer")

    exitonerror=false
    # Stop all managed Servers
    shutdown('soa_server1','Server', force="true")
    shutdown('osb_server1','Server', force="true")
    shutdown('bam_server1','Server', force="true")

    exit()

Happy scripting.

Thursday Jul 08, 2010

Installing Seeded Users for BPM 11.1.1.3 on Linux

In previous releases of Oracle SOA Suite users were seeded by default. This is not the case for 11.1.1.3. Therefore we need to load them manually so we get the old name of jcooper, cdickens, etc. This post provide the steps to load these users so you can perform some basic allocation of tasks in BPM Suite. These users can also be used for SOA Suite Human Task activities as well.

1. Download the demo-community.zip file provided here:

2. As the oracle user (or owner of BPM / SOA Suite) Unzip this file to a directory of your choice on the BPM / SOA Suite server. For reference I unzipped it in the /home/oracle directory

3.  Change directory to the demo-community folder

cd /home/oracle/demo-community

4. Edit the build.properties file to match your environment, e.g:

  • Set the admin server location

admin.url=t3://bpm.nz.oracle.com:7001
server.url=http://bpm.oracle.com:8001

  • Set the middleware home, also called the bea home

bea.home=/u01/oracle/product/middleware

  • Set the oracle and domain home.

oracle.home=${bea.home}/Oracle_SOA1
domain.home=${bea.home}/user_projects/domains/fmw_domain

  • Set the authentication

admin.name=weblogic
admin.pwd=welcome1

  • Use the managed server for the target or if single
    e.g. target=soa_server1 or target=AdminServer

target=soa_server1

5. Ensure the JAVA_HOME is correct. The java required is the java that is used to install BPM / SOA Suite. In may case I installed 1.6.0_20 into the /java directory.

java –version

should return the following. The version number should be the same as that which was installed for BPM / SOA Suite.

java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

6. If the above is still pointing to the default install, e.g. 1.4.2_x then perform the following steps as root. Otherwise go to step 8. Please note these instructions are based on the fact that I have installed java in the /java directory. Change according to your environment.

echo 'export JAVA_HOME=/java/jdk1.6.0_20'>/etc/profile.d/jdk.sh

echo 'export PATH=$JAVA_HOME/bin:$PATH'>>/etc/profile.d/jdk.sh

source /etc/profile.d/jdk.sh

java –version should now return:

java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

7. Log back in as the oracle user and change directory to the  demo-community done in step 2. Also check the version of java has now changed to the correct version as step 6.

cd /home/oracle/demo-community

8. Run ANT to load the users. If ANT is not in your path you may need to source it. For my environment the following works:

$MW_HOME/modules/org.apache.ant_1.7.1/bin/ant seedDemoUsers

9. Check that the script completed with no errors. Sometimes you can get a build successful when there were some errors. You should see something like this:

[exec] *****************************************************
[exec] ** End SOA specific environment setup
[exec] *****************************************************
[exec] *******************************************************
[exec] ** SOA specific environment is already set, skipping...
[exec] *******************************************************
[java]
[java] Initializing WebLogic Scripting Tool (WLST) ...
[java]
[java] Welcome to WebLogic Server Administration Scripting Shell
[java]
[java] Type help() for help on available commands
[java]
[java] --------------------------- Demo Community  ----------------------------------
[java] serverURL: bpm.nz.oracle.com:8001
[java]
[java] Status :
[java] 200 OK
[java] Users/Groups Seeded :
[java] <html>
[java] <head>
[java] <title>Demo User Community</title>
[java] <link rel="stylesheet" type="text/css" href=""stylesheet.css"/>"
[java] </head>
[java] <body>
[java] <table border="1" style="background-color:#C8C8C8" align="center" width="70%">
[java] <tr>
[java] <td>
[java] <H1 ALIGN="CENTER">Seed Demo Community</H1>
[java] <BR><B>Users : </B>
[java] demoadmin
[java] cdickens
[java] wfaulk
[java] sfitzger
[java] jstein
[java] istone
[java] jcooper
[java] mtwain
[java] jlondon
[java] ltolstoy
[java] fkafka
[java] szweig
[java] mmitch
[java] jausten
[java] achrist
[java] rsteven
[java] cdoyle
[java] wshake
[java] JVerne
[java] EHEMING
[java] VHUGO
[java] <BR><B>Groups : </B>
[java] Supervisor
[java] LoanAnalyticGroup
[java] LoanAgentGroup
[java] California
[java] WesternRegion
[java] EasternRegion
[java] CentralRegion
[java] RegionalOffices
[java] Executives
[java] </td>
[java] </tr>
[java] </table>
[java] </body>
[java] </html>
[java] --------------------------- Grant AppRoles to Demo Community  --------
     [java] Connecting to t3://bpm.nz.oracle.com:7001 with userid weblogic ...
     [java] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'fmw_domain'.
     [java]
     [java] Warning: An insecure protocol was used to connect to the
     [java] server. To ensure on-the-wire security, the SSL port or
     [java] Admin port should be used instead.
     [java]
     [java] Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
     [java] For more help, use help(domainRuntime)
     [java]

BUILD SUCCESSFUL
Total time: 18 seconds

Monday Jun 21, 2010

Integrating Google Maps with ADF

This is a simple example how to integrate Google Maps to your ADF application.

1.  In order to run this application you must subscribe to the Google Map API. This can be done from the following web site.

http://code.google.com/apis/maps/signup.html

This will provide you with a key to access the API at run time.

2. Before we can start our ADF application we need to create a data source. In this example I create a HOUSES table, this table provide the longitude and latitude coordinates required for Google Maps.

Use the following file to create the HOUSES table:

Use the following file for the data:

Use the following for the SQL Loader control file:

3. Execute the create_houses.sql is a SQLPlus session to a schema of your choice. I have used the HR schema.

4. Copy the HOUSES.csv and load_houses.ctl into the same directory somewhere on you OS, e.g. c:\temp.

5. From that location execute the following command, all on one line.

sqlldr userid=hr/hr control=load_houses.ctl log=load_houses.log bad=load_houses.bad data=HOUSES.csv discard=load_houses.discard

6. Check that the HOUSES table has been loaded

SQL> select count(*) from houses;

  COUNT(*)
----------
        34

7. You are now ready to create your ADF Application. Create a new Fusion Web Application (ADF) called GoogleMap and click Next

image

image

8. Accept the defaults and click Finish

image

9. Right-click the model project and select New. From the gallery select Business Tier -> ADF Business Components -> Business Components from Tables

image

10. Create a new database connection based on the schema where you loaded the HOUSES table.

image

11. Query the schema and select the HOUSES table and click Next.

image

 

 

 

 

 

 

 

12. Move the HOUSES table to be selected and click Finish

image

13. Now the data source has been created we can implement the user interface, Right-click the ViewController project and select New

image

14. Select JSF Page, found in the Gallery under Web Tier -> JSF

image

15. Call the JSF page HouseLocation.jspx, ensure that the Blank Page radio button has been selected. Click OK

image

16. From the Component Pallet, drag Panel Splitter into the middle of the JSF page.

image

17. From the Data Control drag the HousesView1 into the First Panel. Choose Table -> ADF Read-Only Table

image

18. Check the Row Selection, Filtering, and Sorting checkboxes, and click OK

image

19. To integrate Google Maps to ADF we must customise the source to add the Google Maps APIs. Click the source tab of your jspx page.

20.  The first bit of code we will implement is the Google Map functions. There are 2 functions we create, an initialisation function, and a an implementation function so when the user selects a row it will pass the coordinates to Google Maps.

Copy this code into your jspx source, just after </af:form> and before </af:document> at the bottom of the source.

Also change the key=ABCD to the key you got when you subscribed to the Google API.

      <f:facet name="metaContainer">
        <af:resource type="javascript" source="
http://www.google.com/jsapi?key=ABCD"/>
        <af:resource type="javascript"> google.load("maps", "2.x");
                    // Call this function when the page has been loaded
                    function initialize() {
                    var map = new google.maps.Map2(document.getElementById("map"));
                    map.setCenter(new google.maps.LatLng(0,0), 1);
                    map.addControl(new GLargeMapControl());
                    map.addControl(new GMapTypeControl());
                    }
                    google.setOnLoadCallback(initialize);
        </af:resource>
        <af:resource type="javascript">
                          function doNavigate(evt)
                          { long = evt.getSource().getProperty("long");
                            lat = evt.getSource().getProperty("lat");

                            var latlng = new GLatLng(lat,long);
                            var map = new google.maps.Map2(document.getElementById("map"));             

                            map.addControl(new GLargeMapControl());
                            map.addControl(new GMapTypeControl());

                            map.setCenter(new GLatLng(lat,long), 16);
                            map.addOverlay(new GMarker(latlng));
                          }
        </af:resource>
      </f:facet>

21. Replace the code <f:facet name="second"/> with the following

             <f:facet name="second">
                <af:group>
                  <div id="map" style="width: 800px; height: 800px"></div>
                </af:group>
              </f:facet>

 

 

 

 

 

 

 

This code draws the map in the second splitter.

22. The final code is implementing the client listeners for user interaction so when the use selects an ID the location will be shown on the map. To do this we must edit the ID field to listen for user interaction and pass the parameters to the functions implemented in step 20.

Find the code:

                <af:outputText value="#{row.Id}" id="ot2">
                  <af:convertNumber groupingUsed="false"
                                    pattern="#{bindings.HousesView1.hints.Id.format}"/>
                </af:outputText>

And replace to look like this

                      <af:outputText value="#{row.Id}">
                        <af:convertNumber groupingUsed="false"
                                          pattern="#{bindings.HousesView1.hints.Id.format}"/>
                        <af:clientAttribute name="lat" value="#{row.Latitude}"/>
                        <af:clientAttribute name="long" value="#{row.Longitude}"/>
                        <af:clientListener method="doNavigate" type="click"/>
                      </af:outputText>

Save you work

23. Now it is time to test, Right-click on the HouseLocation.jspx and select Run

When the application starts in your browser, click on any ID in the ID column. The location should show on the map as shown below.

image

Tuesday Jun 08, 2010

Publish Static Content to WebLogic

This post has been updated to provide a more flexible approach to deploying static content 16.07.2012.

Most people know WebLogic has a built in web server. Typically this is not an issue as you deploy java applications and WebLogic publishes to the web. But what if you just want to display a simple static HTML page. In WebLogic you can develop a simple web application to display static HTML content.

In this example I used WLS 10.3.3. I want to display 2 files, an HTML file, and an xsd for reference.

  1. Create a directory of your choice, this is what I will call the document root.

    mkdir /home/oracle/html
  2. Download the war file here. This file creates a simple web app to expose the files.
  3. In the war file you will see a directory WEB-INF, inside there you will see 2 files, web.xml, and weblogic.xml. There is no need to edit these files but if you want to change the context or the directory edit the weblogic.xml file to match your environment.

    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-web-jar.dtd">

    <weblogic-web-app>

      <container-descriptor>
        <index-directory-enabled>true</index-directory-enabled>
      </container-descriptor>

      <virtual-directory-mapping>
        <local-path>/home/oracle/html</local-path>
        <url-pattern>*</url-pattern>
      </virtual-directory-mapping>

      <context-root>/html</context-root>

    </weblogic-web-app>

  4. Login to the WebLogic console to deploy application
  5. Click on Deployments
  6. Click on Lock & Edit
  7. Click Install and upload the war file downloaded in step 2

    image
  8. Leave default "Install this deployment as an application" and click Next

    image
  9. Select a Managed Server to deploy to and click Next

    image
  10. Accept the defaults and click Finish
  11. Deployment completes successfully, now click the Activate Changes

    image
  12. You should now see the application started in the deployments

    image
  13. You can now access your static content via the following URL

    http://localhost:7001/html/helloworld.html

    image

Thursday Jun 03, 2010

Calling Web Services using ADF 11g

One of the benefits of ADF is that fact that it can use multiple data sources. With SOA playing a big part in today’s IT landscape, applications need to be able to utilise this SOA framework to leverage functionality from multiple systems to provide a composite application.

ADF provides functionality to expose web services via the ADF Business Component so if you know how to use Business Components for a database. Configuring ADF for web services is much the same.

In this example I use an OSB web service that gets a customer.

  1. Create a new Fusion Web Application (ADF) Application and click OK

    image
  2. Provide an Application Name, GetCustomerADF and click Next

    image
  3. From the Project Technologies move Web Services into the Selected box. Accept the defaults and click Finish.

    image
  4. Right-click the Model project and select New

    image
  5. In the Gallery select Web Services –> Web Service Data Control then click OK.

    image
  6. Provide a name GetCustomerDC and give the URL endpoint for the Web Service, then click Next

    image
  7. Select the web service operation you want to use for the ADF application. In my example my web service only has one operation.

    image
  8. Click Finish
  9. Save your work, File –> Save
  10. The data control has now been created, the next steps create the UI components.
  11. In your application created in step 1 find the ViewController project, right-click and choose New

    image
  12. In the Gallery select JSF –> JSF Page

    image
  13. Provide a name for the jsp page, GetCustomer, Also ensure that the ‘Create as XML Document (*.jsp) check box is checked. I have selected the page template, Oracle Three Column Layout but you can create a layout of your choice.

    image
  14. I only want 2 columns so I delete the last column but right-clicking the right had panel and selecting Delete

    image
  15. Drag the fields you require from the web service data control to the left pannel. In my example I only require the Customer ID. When you drag to the panel select Texts –>ADF Input Text w/Label

    image
  16. In this example I want to search on a customer based on the ID. So Once I select the ID I want to execute the request. To do this I need a button.
    Drag the operation object under the fields created in step 15. Select Methods –> ADF Button.

    image
  17. You now need to provide the mappings, Choose the ‘Show EI Expression Builder’

    image
  18. Navigate to the bindings, ADFBindings –> bindings –> parametersIterator –> currentRow

    image
  19. Click OK
  20. Drag and drop the return information

    image
  21. I just want the results shown in a form. I want to show all fields

    image
  22. Now it is time to test, Right-click the jspx page created in steps 11 – 21 and select Run

    image
  23. A browser should start, enter valid values and test

    image

Thursday May 27, 2010

Using JCA Adapter with OSB 11.1.1.3

[Read More]

Wednesday May 19, 2010

WebLogic not reading boot.properties

[Read More]

Monday May 03, 2010

Upgrading SOA Suite 11.1.1.2 to 11.1.1.3 SOA Suite with OSB

[Read More]

Tuesday Mar 23, 2010

How to pass XML to DB using XMLTYPE

[Read More]
About

Discussions and Examples using Oracle Fusion Middleware. Some image links are broken when using Firefox, Safari, and Chrome. If you want to see the full image please use IE.

Twitter:@james8001

tumblr hit counter vistors, thanks for your support

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today