Wednesday, October 19, 2011

Publish a Static HTML Page To WebLogic Server and Request Through Oracle HTTP Server 11g


Hi Everyone,

Today i came across the requirement where i need to publish some of the static HTML pages to weblogic and request through HTTP Server.

Following blog will guide you through the steps to configure the Oracle HTTP Server 11g and WebLogic Server 10.3.1+ to serve static HTML pages and a simple demo JSP. This is not a normal task, but may be used for troubleshooting while working on more complex issues involving a Java application.

following are the specifications and Test Environment where i have implemented the same.

MS Windows Server 2003 SP2
WebLogic Server version 10.3.2
Oracle HTTP Server 11g version 11.1.1.2.0 based on Apache Server 2.2

Hostname : ajinkya-vichare
WebLogic Server Admin Port: 7001
HTTP Server port : 7777

This section will tell you how to configure your WebLogic Server to serve a static HTML page:

Step 1. Install and configure WebLogic Server on your system. You do not need to create a custom managed server. You may choose one in a later step, but for this example, we will use the AdminServer.

Step 2. Install and configure Oracle HTTP Server 11g. It is not required to associate this instance with the WebLogic domain.

Step 3. Create a directory of your choice, this is what we will call the "document root".

C:\oracle\static_root

Step 4. Copy the following static file to this directory:

    HelloWorld.html
    <html>
    <body>
    <h1> Hello World!!!</h1>
    <h3> This is my static HTML page</h3>
    </body>
    </html>

Step 5. In the document root directory created in step 3 create the directory WEB-INF:

C:\oracle\static_root\WEB-INF

Step 6. In the WEB-INF directory create a file called web.xml with the following content:

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
    <web-app>
    </web-app>

Step 7. Login to the WebLogic Console to deploy the application:

    i.e: http://ajinkya-vichare:7001/console

Step 8. Click on Deployments.

Step 9. Click Install and set the path to the directory created in step 3.

Step 10. Leave default "Install this deployment as an application" and click Next.

Step 11. Select a Managed Server to deploy to and click Next. If there aren't any custom managed servers on this domain, the AdminServer will be selected automatically. Otherwise, a list of available managed servers will be presented and you can select to one where you want to use as a target.

Step 12. Accept the defaults and click Finish.

Step 13. Deployment completes successfully, now click the Activate Changes.

Step 14. You should now see the application started in the deployments screen.

Step 15. You can now access your static content on the WebLogic Server port via the following URL:

    http://ajinkya-vichare:7001/static_root/HelloWorld.html
    Hello World!!!
    This is my static HTML page

Now, you can configure the Oracle HTTP Server to serve this page from the WebLogic Server.

Step 16. Edit the mod_wl_ohs.conf file and add the Location directive for /static_root:

    C:\Oracle\Middleware\Oracle_WT1\instances\instance1\config\OHS\ohs1\mod_wl_ohs.conf

    LoadModule weblogic_module "${ORACLE_HOME}/ohs/modules/mod_wl_ohs.so"
    <IfModule mod_weblogic.c>
    WebLogicHost ajinkya-vichare
    WebLogicPort 7001

    <Location /static_root>
    SetHandler weblogic-handler
    </Location>

    </IfModule>

Step 17. Save the mod_wl_ohs.conf file and re-start the Oracle HTTP Server.

Step 18. You can now access your page using the Oracle HTTP Server port via the following example address:

    http://ajinkya-vichare:7777/static_root/HelloWorld.html
    Hello World!!!
    This is my static HTML page

It works for me..!!! again thanks to OTN. i have follow metalink ID : 1192439.1.

Enjoy working with Middleware.

Regards,
Ajinkya Vichare
ajinkya-vichare.blogspot.com

FMW 11G FORMS AND REPORTS INSTALL FAILED WITH ERROR "CREATING DOMAIN FAILED"


Hi Everyone,

Today i will talk about issue with installation of oracle forms reports, portal and discoverer 11g.

When installing the 11.1.1.2.0 Portal/Forms/Reports/Discoverer, it fails on Create Domain Configuration Assistant, and the install2011_08_29_03_53_18PM.txt shows the following errors:
oracle.as.provisioning.exception.ASProvWorkflowException: Problem invoking WLST - java.io.FileNotFoundException: C:\DOCUME~1\ajinkya-vichare\Local (The system cannot find the file specified)

at oracle.as.provisioning.weblogic.ASDomain._createDomain(ASDomain.java:2951)
at oracle.as.provisioning.weblogic.ASDomain.createDomain(ASDomain.java:2469)
at oracle.as.provisioning.engine.WorkFlowExecutor._createDomain(WorkFlowExecutor.java:635)
at oracle.as.provisioning.engine.WorkFlowExecutor.executeWLSWorkFlow(WorkFlowExecutor.java:393)
at oracle.as.provisioning.engine.Config.executeConfigWorkflow_WLS(Config.java:866)
at oracle.as.install.classic.ca.standard.StandardWorkFlowExecutor.execute(StandardWorkFlowExecutor.java:65)
at oracle.as.install.classic.ca.standard.AbstractProvisioningTask.execute(AbstractProvisioningTask.java:26)
at oracle.as.install.classic.ca.standard.StandardProvisionTaskList.execute(StandardProvisionTaskList.java:61)
at oracle.as.install.classic.ca.ClassicConfigMain.doExecute(ClassicConfigMain.java:124)
at oracle.as.install.engine.modules.configuration.client.ConfigAction.execute(ConfigAction.java:335)
at oracle.as.install.engine.modules.configuration.action.TaskPerformer.run(TaskPerformer.java:87)
at oracle.as.install.engine.modules.configuration.action.TaskPerformer.startConfigAction(TaskPerformer.java:104)
at oracle.as.install.engine.modules.configuration.action.ActionRequest.perform(ActionRequest.java:15)
at oracle.as.install.engine.modules.configuration.action.RequestQueue.perform(RequestQueue.java:63)
at oracle.as.install.engine.modules.configuration.standard.StandardConfigActionManager.start(StandardConfigActionManager.java:158)
at oracle.as.install.engine.modules.configuration.boot.ConfigurationExtension.kickstart(ConfigurationExtension.java:81)
at oracle.as.install.engine.modules.configuration.ConfigurationModule.run(ConfigurationModule.java:83)
at java.lang.Thread.run(Thread.java:619)
oracle.as.provisioning.exception.ASProvisioningException
at oracle.as.provisioning.engine.Config.executeConfigWorkflow_WLS(Config.java:872)
at oracle.as.install.classic.ca.standard.StandardWorkFlowExecutor.execute(StandardWorkFlowExecutor.java:65)
at oracle.as.install.classic.ca.standard.AbstractProvisioningTask.execute(AbstractProvisioningTask.java:26)
at oracle.as.install.classic.ca.standard.StandardProvisionTaskList.execute(StandardProvisionTaskList.java:61)
at oracle.as.install.classic.ca.ClassicConfigMain.doExecute(ClassicConfigMain.java:124)
at oracle.as.install.engine.modules.configuration.client.ConfigAction.execute(ConfigAction.java:335)
at oracle.as.install.engine.modules.configuration.action.TaskPerformer.run(TaskPerformer.java:87)
at oracle.as.install.engine.modules.configuration.action.TaskPerformer.startConfigAction(TaskPerformer.java:104)
at oracle.as.install.engine.modules.configuration.action.ActionRequest.perform(ActionRequest.java:15)
at oracle.as.install.engine.modules.configuration.action.RequestQueue.perform(RequestQueue.java:63)
at oracle.as.install.engine.modules.configuration.standard.StandardConfigActionManager.start(StandardConfigActionManager.java:158)
at oracle.as.install.engine.modules.configuration.boot.ConfigurationExtension.kickstart(ConfigurationExtension.java:81)
at oracle.as.install.engine.modules.configuration.ConfigurationModule.run(ConfigurationModule.java:83)
at java.lang.Thread.run(Thread.java:619)
Caused by: oracle.as.provisioning.exception.ASProvWorkflowException: Error Executing workflow.
at oracle.as.provisioning.engine.WorkFlowExecutor._createDomain(WorkFlowExecutor.java:688)
at oracle.as.provisioning.engine.WorkFlowExecutor.executeWLSWorkFlow(WorkFlowExecutor.java:393)
at oracle.as.provisioning.engine.Config.executeConfigWorkflow_WLS(Config.java:866)
... 13 more
progress in calculate progress4
progress in calculate progress4


After reserching on above errors and logs i have come to following conclusions, and found some causes for failing to install Oracle forms reports portal and discoverer 11g.

The "Create Domain" step fails because of the spaces within the TMP and TEMP environment setttings, as follows:

C:\Documents and Settings\ajinkya-vichare>set tmp
TMP=C:\DOCUME~1\ajinkya-vichare\Local Settings\Temp\1

C:\Documents and Settings\ajinkya-vichare>set temp
TEMP=C:\DOCUME~1\ajinkya-vichare\Local Settings\Temp\1

Finally i have done following steps to resolve installation issues :

Step 1. Deinstall this failed 11.1.1.2 Forms/Reports install.

Step 2. Modify the TEMP and TMP environment variable to point to directory without any spaces:

from:

TMP=C:\DOCUME~1\ajinkya-vichare\Local Settings\Temp\1
TEMP=C:\DOCUME~1\ajinkya-vichare\Local Settings\Temp\1

to:

TEMP=C:\tmp
TMP=C:\tmp

Step 3. Please ensure to create C:\tmp before you start the next installation.

Step 4.
Reinstall the Forms/Reports.

It works for me,

Enjoy working with Middleware technologies.

Regards,
Ajinkya Vichare

http://ajinkya-vichare.blogspot.com

Monday, October 10, 2011

How to Create Two Reports Servers With the Same Name in the Same Subnet?


Hi Everyone,

Sometimes the reports server name is hardcoded in the application (i.e. Forms/Reports integration) and trying to create different reports servers with the same name in the different middletiers (Development, Testing, QA, Production) generate error messages like REP-56040 or REP-51002 due the same  name cannot be used for ORB . The broadcast port used by the Reports Server could be changed to stop the communication between reports servers, and then, is possible to create different reports servers with the same name, each of them listening in a different broadcast port.

IMPORTANT: It is strongly recommended that you do not change the default channel and port unless it is absolutely necessary, like in this case that the objective is explicitly isolate each middle tier (or each ORACLE_HOME, if different middle tiers are installed in the same box).

Solution

The default port value for rwnetwork.conf is assigned when Oracle Application Server is installed, usually it is 14021 or 14022 if the first one is not available.

If rwnetwork.conf broadcast ports are customized, the valid port range reserved for Reports Server is from 14021 to 14030.

These steps are suggested for multicast and is strongly recommended to test first, before applying in a production box.

For this example, the same reports server name will be use for Testing and QA middle tiers. Suppose the QA middle tier is listening in port 14021 by default. Do not change anything in QA middle tier; the changes will be applied to the Testing middle tier.

Step 1) Backup rwnetwork.conf located in Testing middle tier in %ORACLE_HOME%\reports\conf. Stop all the reports servers available in this middle tier

Step 2) Change the broadcast port for default multicast mechanism, i.e.:

FROM port=14021:   
<?xml version = '1.0' encoding = 'ISO-8859-1'?>             
<!DOCTYPE discoveryService SYSTEM "file:h:\ora\as1012/reports/dtd/rwnetworkconf.dtd">      
<discoveryService>
  <multicast channel="228.5.6.7" port="14021" timeout="1000" retry="3"/>
  <!--namingService name="Cos" host="%NAMING_HOST%" port="%NAMING_PORT%"/-->
</discoveryService>    

TO port=14022:
<?xml version = '1.0' encoding = 'ISO-8859-1'?>
<!DOCTYPE discoveryService SYSTEM "file:h:\ora\as1012/reports/dtd/rwnetworkconf.dtd">
<discoveryService>
  <multicast channel="228.5.6.7" port="14022" timeout="1000" retry="3"/>        
  <!--namingService name="Cos" host="%NAMING_HOST%" port="%NAMING_PORT%"/-->
</discoveryService>

Remember, the port range must be between 14021 to 14030.

Step 3) Startup the Reports Servers from Testing middle tier again.

Step 4) In Testing's ORACLE_HOME, execute rwdiag.sh in Unix or rwdiag.bat in Windows; it will display all the reports servers using port 14022:
C:\Ora\as1012\BIN>rwdiag.bat -findAll

Broadcast mechanism used to locate servers
------------------------------------------
Channel address = 228.5.6.7
Channel port    = 14022

(1) Name = myrepserver: Type = server : Host = Ajinkya-vichare


  Step 5) If you execute rwdiag in the QA's ORACLE_HOME, this rwdiag will detect the reports servers running in 14021:
C:\Ora\BI1012\BIN>rwdiag -findall

Broadcast mechanism used to locate servers
------------------------------------------
Channel address = 228.5.6.7
Channel port    = 14021

(1) Name = myrepserver : Type = server : Host = Ajinkya-vichare

 Both middle tiers are using the same reports server name myrepserver, without conflicts; the difference is the broadcast port.

It solves my purpose, hope it will help you... Again many thanks to oracle metalink.

Note: please confirm the same on Test server before implement the same on production server.

Enjoy working with Middleware...

Regards,
Ajinkya Vichare

ajinkya-vichare.blogspot.com