Showing posts with label Weblogic 11g. Show all posts
Showing posts with label Weblogic 11g. Show all posts

Friday, May 30, 2014

Installing OER 11g on an existing SOA 11g domain

In this blog post, I will provide detailed step-by-step instructions to install OER 11g (11.1.1.7) on an existing SOA domain.

Pre-Requisites: SOA 11g installed and domain configured. I used 11.1.1.7 version (latest version as on date of writing this post)

You can choose to have a single server install where AdminServer doubles up as SOA server or have 2 managed servers (Admin & SOA) on your domain. You will have to install OER as a separate managed server. I personally couldn't succeed with a OER single server install (Admin + SOA + OER on the same managed server).

Installing OER 11.1.1.7

Step 1: Connect to the database on your server as SYS user and execute the following scripts. This step is an important pre-requisite as it creates the tablespace and schema to store OER asset/artifact metadata

Note: Ensure that the path to DATAFILE parameter exists

Create Tablespaces:

CREATE TABLESPACE OER_DATA
    DATAFILE '/u01/app/oracle/oradata/XE/oer_data.dbf' SIZE 300M
 AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE
    LOGGING
    ONLINE
    SEGMENT SPACE MANAGEMENT AUTO;

CREATE TABLESPACE OER_LOB
    DATAFILE '/u01/app/oracle/oradata/XE/oer_lob.dbf' SIZE 300M
 AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE
    LOGGING
    ONLINE
    SEGMENT SPACE MANAGEMENT AUTO;

CREATE TABLESPACE OER_INDEX
    DATAFILE '/u01/app/oracle/oradata/XE/oer_index.dbf' SIZE 300M
 AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE
    LOGGING
    ONLINE
    SEGMENT SPACE MANAGEMENT AUTO;

Create OER Schema:
  
CREATE USER OER IDENTIFIED BY OER_PWD
DEFAULT TABLESPACE OER_DATA
TEMPORARY TABLESPACE TEMP;

Apply Grants:

GRANT CREATE MATERIALIZED VIEW TO OER;
GRANT CREATE SEQUENCE TO OER;
GRANT CREATE SESSION TO OER;
GRANT CREATE SYNONYM TO OER;
GRANT CREATE TABLE TO OER;
GRANT CREATE TRIGGER TO OER;
GRANT CREATE VIEW TO OER;
GRANT UNLIMITED TABLESPACE TO OER;

Step 2:
Download the appropriate installer for your server. If you are on a 64-bit machine, irrespective of whether it is Windows or Linux, you can choose to download the generic installer.

Unzip the ofm_oer_generic_11.1.1.7.0_disk1_1of1.zip file into a server location

Step 3:
Ensure java is on your environment PATH variable and execute the following command

java -D64 -jar OER111170_generic.jar

Step 4:
In the welcome screen of the OER installer, click Next

Step 5:
Choose your existing FMW home (in this case your home directory where SOA is installed - Since we are installing OER on the same domain as SOA) and click Next

Step 6:
Validate the Oracle Enterprise Repository install location and click Next

Step 7:
Choose WebLogic Server 11 in the "Choose Application Server" dialog and click Next

Step 8:
In the "Initialize Repository Properties" screen, enter the following values and click Next

OER managed server port number: 7101 (default, but you can choose to change it here)
Fully qualified server name: Enter the fully qualified server hostname
Repository application name: oer


Step 9:
In the "Configure Database" screen, choose Yes to configure the database for OER and click Next

Step 10:
Enter the following values in the "Provide Database Tablespace Names" screen

Data tablespace: oer_data
BLOB tablespace: oer_lob
Index tablespace: oer_index

Step 11:
In the "Initialize Repository Database Properties" browse for the ojdbc6.jar driver file - This file can be found at the database installation location: <DB_Home>/jdbc/lib

Provide the DBMS (SID) name, host, port and OER username and password and click Next

Step 12:
You must now see a successful installation message.

Extend SOA Domain to host OER

Step 13:
Go to <Middleware_Home>/wlserver_10.3/common/bin and execute config.sh
./config.sh

Step 14:
In the "Configuration Wizard" home screen, choose the option "Extend an existing WebLogic domain" and click Next


Step 15:
Choose your WebLogic domain where SOA suite is installed

Step 16:
Scroll down the list of products, select Oracle Enterprise Repository - 11.1.1.7.0 from the list and click Next

Step 17:
Leave defaults and click Next in the following screens until you reach the "Select Optional Configuration" page

Step 18:
In the "Select Optional Configuration" screen, select "Managed Servers, Clusters and Machines" option and click Next

Step 19:
Leave defaults in the following screens and in the Configuration Summary page, click on "Extend"

You must see "Domain Extension Applied Successfully" message

Now that your domain has been extended, the domain configuration corrupts a few configuration settings that prevents a successful server startup. Follow the instructions below to get OER started successfully.

Observation 1:

I observed that the UMSJMSSystemResource-jms.xml presents duplicate entries which prevents a successful server startup. To resolve this, go to <Domain_Home>/config/jms folder and check and remove the duplicate entries as highlighted below. [Note: Take a backup of this file]

<queue name="OraSDPM/Queues/OraSDPMEngineCmdQ_auto_3">
    <sub-deployment-name>UMSJMSServer505614749</sub-deployment-name>
    <jndi-name>OraSDPM/Queues/OraSDPMEngineCmdQ</jndi-name>
  </queue>
  <queue name="OraSDPM/Queues/OraSDPMEngineSndQ1_auto_3">
    <sub-deployment-name>UMSJMSServer505614749</sub-deployment-name>
    <jndi-name>OraSDPM/Queues/OraSDPMEngineSndQ1</jndi-name>
  </queue>
  <queue name="OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_3">
    <sub-deployment-name>UMSJMSServer505614749</sub-deployment-name>
    <jndi-name>OraSDPM/Queues/OraSDPMEngineRcvQ1</jndi-name>
  </queue>
  <queue name="OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_3">
    <sub-deployment-name>UMSJMSServer505614749</sub-deployment-name>
    <jndi-name>OraSDPM/Queues/OraSDPMDriverDefSndQ1</jndi-name>
  </queue>
  <queue name="OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_3">
    <sub-deployment-name>UMSJMSServer505614749</sub-deployment-name>
    <jndi-name>OraSDPM/Queues/OraSDPMAppDefRcvQ1</jndi-name>
  </queue>
  <queue name="OraSDPM/Queues/OraSDPMWSRcvQ1_auto_3">
    <sub-deployment-name>UMSJMSServer505614749</sub-deployment-name>
    <jndi-name>OraSDPM/Queues/OraSDPMWSRcvQ1</jndi-name>
</queue>

Observation 2:

The memory setting of your SOA domain would be affected because the setOERDomainEnv.sh script gets called every time. Sophisticated way of handling this would be at the setSOADomainEnv.sh where you can validate the $SERVER_NAME and configure the USER_MEM_ARGS for each Managed Server appropriately. Else, just increase the USER_MEM_ARGS in the setOERDomainEnv.sh script.

Now, you are all set to start your OER server and start SOA Governance !!

Saturday, March 1, 2014

JDeveloper Deployment to SSL Configured WebLogic (SSL Handshake Failure)

If you have configured SSL keystore on your WebLogic application server, you might face SSL Handshake error while trying to deploy any application from Oracle JDeveloper.

To overcome this issue, download the SSL certificate and import it to your JDeveloper java keystore.

1. Open your browser and establish an SSL connection to your server. For eg., https://hostname:port/console

2. Click on the green padlock sign -> Connection tab and click on Certificate Information

3. In the Certificate dialog, click on "Copy to File.."

4. In the resulting "Certificate Export Wizard", choose Next


5. Leave the default selection (DER encoded binary X.509) and click Next

6. Provide a filename where the certificate file will be exported and saved

Import certificate into the Java keystore: [Ensure that this is the java that JDeveloper points at]

1. Open command prompt, go to <Java_Home>\jre\bin

2. Issue the following command to import the server SSL certificate to java keystore for successful handshake;

keytool -import -v -file C:\Temp\root.cer -keypass password -keystore C:\Java\jdk6u33\jre\lib\security\cacerts -alias mykey

3. When prompted, provide the keystore password [Default password is changeit]

Voila, now you are all set to deploy applications from JDeveloper !!

Saturday, November 23, 2013

Deploying Jersey (JAX-RS) RESTful Web Services on WebLogic Server

If you have to deploy a Jersey based RESTful web service on WebLogic server, you will have to deploy the jersey library on the WebLogic server and reference it from your weblogic.xml descriptor file.

WebLogic 11g comes bundled with Jersey library but we have to explicitly deploy & make it available for consumption. Use the following command to deploy the Jersey library on your WebLogic server;

java -classpath <Middleware_Home>/wlserver_10.3/server/lib/weblogic.jar weblogic.Deployer -verbose -noexit -source <Middleware_Home>/wlserver_10.3/common/deployable-libraries/jersey-bundle-1.9.war -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -password xxxxxx -deploy -library

This command would invoke the weblogic.Deployer which will deploy the Jersey bundle library as a shared library on your WebLogic server.

Now, all we need to do is to reference this library from the RESTful webservice application via weblogic.xml

<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <library-ref>
        <library-name>jax-rs</library-name>
        <specification-version>1.1</specification-version>
        <implementation-version>1.9</implementation-version>
        <exact-match>false</exact-match>
    </library-ref>
</weblogic-web-app>

Now, you can deploy your Jersey based RESTful webservice on WebLogic server.

Thursday, November 21, 2013

WebLogic Application Deployment & Shared Library

In an enterprise application deployment scenario, there are many cases where some libraries are used/referenced by multiple applications. It would indeed be a bad design to include such common libraries with every application deployed on the WebLogic server. Not only does it prevent redundancy of resources on the server, it also consumes valuable space & deployment time - especially when the libraries are huge.

WebLogic server offers the shared library concept using which EARs, JARs, EJBs and WARs can be shared across applications in a WebLogic domain.

Let us now see how to package and deploy a shared library in WebLogic server;

Step 1: Create a folder structure as shown below

Step 2: Copy all the libraries (in this case JAR files) that you would want to share across applications to the lib folder under WEB_INF
Step 3: Create a file under META_INF folder by name "MANIFEST.MF"
Step 4: Contents of the MANIFEST.MF file are shown below
Manifest-Version: 1.0
Specification-Title: CommonJars
Specification-Version: 1.0
Implementation-Title: CommonJars Implementation
Implementation-Version: 1.0
Implementation-Vendor: Oracle
Extension-Name: CommonJars
Step 5: From the root folder location, execute the following command to generate a WAR file
jar -cvf sharedlib.war *.*
Step 6: Now, login to Oracle WebLogic console, choose "Deployments" and deploy the generated WAR as a shared library - steps with screenshots below






Step 7: Now that the shared library is deployed, let us refer this shared library from another application

Open the weblogic.xml file. If it is not present in your application, create this file under WEB-INF folder of your application and refer the shared library as shown below;
<?xml version = '1.0' encoding = 'windows-1252'?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <library-ref>
        <library-name>CommonJars</library-name>
    </library-ref>
</weblogic-web-app>

Enjoy sharing libraries across your enterprise applications.

Saturday, June 22, 2013

BPM 11.1.1.7 Composer Web Form Creation

Web Forms are one of the most anticipated features delivered as part of the latest Oracle BPM PS6 release (11.1.1.7). What is so special about it? Well, until PS5 Oracle BPM supported only one form of human task UI development - the out of the box ADF style of development which required the use of Oracle JDeveloper IDE and in complex scenarios invariably required the help of IT dept.

Starting PS6, Oracle BPM supports Web Forms which is a welcome feature especially for business analysts/process owners who have very high business process knowledge but little IT/development. Oracle BPM PS6 allows business users to create & implement a complete end-to-end business process (including user task UIs) from a blank canvas via their web browsers.

However, while trying to create a web form from BPM composer, you may encounter the following error;

Error getting form: OrderProcessForm
Caused by: Could not instantiate form: got wrong status=500


This is just a configuration issue which can be resolved in a jiffy.

Just make a note of the fully qualified machine hostname where BPM PS6 is installed.
For eg., sathyam-lap.oracle.com

1. Login to WebLogic console [http://sathyam-lap.oracle.com:7001/console]
2. Expand Environment and choose Servers from the "Domain Structure" panel

3. Click on the managed server where SOA/BPM is installed from the list of servers [Generally, soa_server1 on port 8001]
4. In the "Settings for soa_server1" page, choose "Protocols" tab from top menu & "HTTP" tab in the sub menu bar [You can update this for all servers to keep the URLs uniform]
5. Update the "Frontend Host" entry with the fully qualified machine hostname


Now, login to BPM composer and try to create/access your webform and it must be rendered properly.
Note that you must always access all server URLs using the fully qualified hostname
eg., http://sathyam-lap.oracle.com:8001/bpm/composer

Saturday, June 1, 2013

Unable to Login BPM Workspace/Composer

Last week I installed BPM PS6 on one of my local servers. Since it was intended to be a development environment, I configured my WebLogic domain to have a single server which would double up as my SOA/BPM server in additions to its Admin server capabilities.

After a clean install, while trying to login as weblogic [the administrator user] in to the BPM workspace or BPM composer, these applications wouldn't allow access throwing "Login Error" & "Authentication Error" respectively. However, I was successfully able to login to the WebLogic console & EM with same credentials.

On investigating the server logs, the following errors were reported by the managed server;

[APP: BPMComposer] BPM-80102: Error while creating the security service.  Cause: Identity Service Configuration error.[[ Identity Service Configuration has error.
Please refer to the identity service configuration guidelines and correct the Identity Service configurations. Contact Oracle Support Services if error is not fixable.
javax.security.auth.login.LoginException: BPM-80102: Error while creating the security service.  Cause: Identity Service Configuration error.
........
........
........
Caused by: ORABPEL-10555
Identity Service Configuration error.
Identity Service Configuration has error.
........
........
Caused by: oracle.bpel.services.workflow.client.WorkflowServiceClientException: javax.xml.ws.WebServiceException: oracle.fabric.common.PolicyEnforcementException: PolicySet Invalid: WSM-02557 oracle.wsm.policymanager.accessor.BeanAccessor The documents required to configure the Oracle Web Services Manager runtime have not been retrieved from the Policy Manager application (wsm-pm), possibly because the application is not running or has not been deployed in the environment. The query "&(policysets:global/%)(@appliesTo~="WS-Client()")" is queued for later retrieval. WSM-02557 oracle.wsm.policymanager.accessor.BeanAccessor The documents required to configure the Oracle Web Services Manager runtime have not been retrieved from the Policy Manager application (wsm-pm), possibly because the application is not running or has not been deployed in the environment. The query "/policies/oracle/no_authentication_client_policy" is queued for later retrieval.

Clearly the error states an issue with the policy manager under OWSM (Oracle WebServices Manager).

If this is not the error message in your logs, you may review the blog post here to see if that helps.

Solution:

Step 1:

1. Login to WLS console (http://hostname:port/console) as weblogic [Admin user]
2. Under the Data Sources, ensure that the mds-owsm jdbc data source is targeted at the SOA managed server [If you have a single server install verify that it is targeted at AdminServer]. If not, edit the data source & update targets

Step 2:

1. Under the "Deployments" section of WLS console, make sure that the wsm-pm enterprise application is running. If the deployment state is other than "Active", there is a good posibility that this application is not targeted on the SOA managed server.
2. Solution here is to target this application manually on the SOA server. To do this, click on the wsm-pm application -> Go to Targets tab -> choose the wsm-pm root component -> Click on "Change Targets" -> Check the SOA managed server (or AdminServer in case of single server install) and choose "Yes".

Now, you should be able to successfully login to the BPM workspace & BPM composer applications.

Tuesday, June 5, 2012

JDeveloper 11g Cannot Establish App Server Connection

Very often I see people bump into this error and thought I should make some notes here which might help someone in need.

First of all, I would like to make some inferences from the JDeveloper documentation;

"By default, JDeveloper uses the proxy settings from the default browser on the same machine, adding localhost and 127.0.0.1 to the list of proxy exceptions. If you have problems making connections from JDeveloper, for example, connecting to an application server or a SOAP server that is on the same machine as JDeveloper, you may need to change the proxy server settings you use."

Pre-Requisite:
While trying to establish a connection to the App server from JDeveloper, ensure that the following settings are correct;

1. Weblogic Hostname : resolves to the actual IP address of the server
2. Port: 7001 (default admin server port) or as per your admin port configuration during install. Remember you should only use the admin server port of your WebLogic server here even if you have an architecture where you front end the app server with a HTTP server like OHS
3. Domain: Use the domain name that was created during the WLS configuration

Check 1: Check whether the proxy settings are disabled in JDeveloper. Go to Tools -> Preferences -> Web Browser & Proxy section and ensure that no HTTP proxy server is setup. If already configured, uncheck the check box and click OK

Check 2: Test whether the port 7001 on the WLS host is accessible from the machine where JDeveloper is installed. You can test this with a simple telnet command;

telnet hostname 7001

If this test doesn't succeed then there can be two possible reasons;

1. There can be a network firewall or firewall enabled on the server which blocks this admin port from being accessed from a client machine. If this is the case, then ask your network administrator to open the port. This can be done by adding the port to the ip6tables on the linux server or similar.

2. Do a netstat on the linux server where WebLogic is installed to find out whether the port is open and is available (LISTEN mode). Ensure that your admin server is running when you run this command

eg., netstat -apn | grep 7001

This will show up the ip addresses from which the host can accept requests. Some common causes that I have identified is that the /etc/hosts file contains the ip - hostname mapping as follows;

127.0.0.1          hostname1

When the WebLogic server starts up, it will start all services properly but a closer look at the netstat command reveals that the host accepts connections only from within the server (127.0.0.1). This means that the port is virtually blocked for any requests coming from outside the machine/host itself. To resolve this issue, change the /etc/hosts file entry as follows;

<ip address of host >       hostname1

Now, stop all services and restart the services. This enables all WebLogic ports and accessible from outside the server.

Friday, February 24, 2012

Oracle B2B 11g java.lang.UnsatisfiedLinkError

I hit this error recently while trying to send an EDI data through my B2B gateway and lost my way as couple of re-installs from scratch didn't really helped either. All the help from different forums and blogs pointed basically to 4 causes for this error as cited below; Note that my environment is Windows 7 64-bit with SOA 11.1.1.5 (latest as on the date of writing).

1. Installing 32-bit installables of SOA suite/WebLogic on a 64-bit environment
2. Installed 64-bit installables of SOA/WebLogic on a 32-bit JDK
3. Corrupt Edifecs or XEngine files
4. Permissions issue on the XEngine folder/libraries

If your case falls in one of the aforesaid cases, then don't read further as you will have to rectify them which could well solve the issue in first place.

In my case, neither of the above were the actual causes as I got my environments and installs perfectly having done several middleware product installs on various environments myself !!! However, this error simply defied all logic and intuition. Detailed error message below;

<Error> <oracle.soa.b2b.engine> <BEA-000000> <java.lang.UnsatisfiedLinkError: com.edifecs.xengine.xeobjects.XEHelper.createSourceFromStreamNative(Ljava/lang/String;Ljava/io/InputStream;)Lcom/edifecs/xengine/xeobjects/XESource;       
        at com.edifecs.xengine.xeobjects.XEHelper.createSourceFromStreamNative(Native Method)
        at com.edifecs.xengine.xeobjects.XEHelper.createSourceFromStream(Unknown Source)
........................................
........................................
at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:234)
        at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
        at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
        at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
>

Then I started my traditional Google search in a slightly different fashion trying to identify the generic root cause of this exception. After all this is a JAVA error which is reported during the EDI processing by the B2B gateway.

At this juncture it would be good to understand the cause for "java.lang.UnsatisfiedLinkError"; As per Java Docs this error is "Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native". Now, this much of help is great to identify and resolve the issue (at least in this particular case ;)

As a matter of fact, XEngine library files are located in <MiddlewareHome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin. I also noticed the following message in the WebLogic console during my server startup which explained the rest.

XEngine may not be installed properly. If you plan to use EDI/HL7 that requires XEngine, please unzip the XEngine bundle to install XEngine manually in $ORACLE_HOME/soa/thirdparty/edifecs directory

Yes, the library files are intact and are present in the specified location (uncorrupted !). It is just that WebLogic could not load the XEngine libraries. Now, there is one way to explicitly make WebLogic load these libraries;

If you are on Windows, set -Djava.library.path=<MiddlewareHome>\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\bin
On Linux, set LD_LIBRARY_PATH=<MiddlewareHome>/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin

Doing this explicitly in setSOADomainEnv.cmd or setSOADomainEnv.sh will ensure that WebLogic loads these libraries during server startup and voila we got rid of the spunky error.

Ah.. Finally do let me know if this helped you :)

Sunday, February 12, 2012

SOA 11g DB Sequence Reset Issue

Ever wondered why the primary key sequence is reset while using a DB adapter to insert records from your SOA application?

The issue is that the DB adapter pre-allocates sequence values based on the value configured in the DB Adapter's outbound connection pool.

To overcome this issue, ensure that the "sequencePreallocationSize" property value matches the value that was specified for sequence increment in DB during sequence creation. For example 1.


Friday, April 8, 2011

BEA-280101 Persistent File Store using Bufferd I/O

While installing the Oracle SOA suite 11g on a 64-bit environment (using a 64-bit JVM), 64-bit native server libraries are created automatically in the Middleware home. However, these may not get referenced during the SOA domain startup. As a result of this, you may encounter the following Weblogic 'Warning' message in the server logs. Although being a warning message that our intuition immediately asks to ignore, this particular warning makes us inquisitive as it threatens of a 'Significantly degraded performance'.

<BEA-280101> <The persistent file store "_WLS_xxxdomain" is forced to use buffered I/O and so may have significantly degraded performance. Either the OS/hardware environment does not support the chosen write policy or the native wlfileio library is missing. See store open log messages for the requested and final write policies. See the documentation on store synchronous write policy configuration for advice.>

To overcome this Weblogic warning, ensure that the generated 64-bit native libraries are referenced during server start-up.

Go to <Middleware_Home>\user_projects\domains\<SOA Domain>\bin\SetSOADomainEnv.cmd  (or SetSOADomainEnv.sh if Linux) and add the -Djava.library.path to JAVA_OPTIONS as shown below;

set JAVA_OPTIONS=%JAVA_OPTIONS% -Djava.library.path=<Middleware_Home>\wlserver_10.3\server\native\win\x64 [Depending on whether your OS is Windows or Linux the path might slightly change]

After performing the above configuration, restart the server and Weblogic warning should now disappear.