Pages

Translate

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 !!

OSR on OER/SOA/OSB domain - QName violates loader constraints

Recently i had installed OSR on the same domain where my SOA, OSB and OER co-exists. While starting the OSR managed server, I faced the following error;

<Error> <HTTP> <soabpm-vm.site> <osr_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>>
<BEA-101017> <[ServletContext@470316600[app:registry module:registry.war path:/registry spec-version:null]] Root cause of ServletException.
java.lang.LinkageError: Class javax/xml/namespace/QName violates loader constraints
at com.idoox.wsdl.extensions.PopulatedExtensionRegistry.(PopulatedExtensionRegistry.java:84)
at com.idoox.wsdl.factory.WSDLFactoryImpl.newDefinition(WSDLFactoryImpl.java:61)
at com.idoox.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:419)
at com.idoox.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:309)
at com.idoox.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:272)
at com.idoox.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:198)
at com.idoox.wsdl.util.WSDLUtil.readWSDL(WSDLUtil.java:126)

This blog here helped me get rid of the error.

Saturday, February 8, 2014

BPM Workspace/Composer Login Error ORABPEL-10585

If you are facing trouble logging into BPM workspace or composer, this post could help save you some time.

First check if the error message in your SOA managed server diagnostic log after the failed login is the following;

javax.security.auth.login.LoginException: Operation exception.
at oracle.bpm.papi.ora.mgr.OrganizationManager.lookupParticipant(OrganizationManager.java:61)
at oracle.bpm.papi.ora.mgr.OrganizationManager.lookupParticipant(OrganizationManager.java:41)
..........
..........
Caused by: fuego.papi.OperationException: Operation exception.
... 69 more
Caused by: ORABPEL-10585

Service error.
Internal Error; Service error occurs in IdentityService in method lookupUser.
Refer to the log file that is configured for oracle.soa.services.identity for more details on this error and contact Oracle Support Services

If this is not the error in your logs, you may look at the blog post here for other options to see if that helps resolve your problem.

Now, let us look at the fix.

1. Login to the EM (Enterprise Manager) console
2. Expand SOA and Right click on soa-infra
3. Goto Administration -> System MBean Browser
4. Minimize the tree structure (com.bea) to view Application Defined MBeans section
5. Expand oracle.as.soainfra.config -
> Server:SOAServerName -> SoaInfraConfig
6. Select soa-infra
7. Update the property ServerURL with a valid URL [Ensure that the hostname here matches your environment hostname. Tip: It should be same as the front end host]

eg., http://hostname:port
8. Click on Apply


Restart your SOA managed server. You should now be able to successfully login to your BPM Workspace or Composer

Sunday, November 24, 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.

Friday, November 22, 2013

Oracle SOA 11g HTTP POST Send/Receive (with example)

In this post let us see how to send and consume HTTP POST request using SOA 11g.

Sample attached with this post will send a file in base64encoded format as a HTTP POST request and the same will be consumed by another BPEL process which is exposed to consume the file in HTTP protocol.

We will use the following XML schema (XSD) to build our HTTP POST service;
Exposing a SOA 11g BPEL process as a HTTP service (POST):

Step 1: Create a SOA Project with empty composite and name it "HttpPostRestService"

Step 2: Drag and Drop a HTTP Binding adapter on the "Exposed Services" swimlane in the SOA composite (SCA)

Step 3: Choose Next in the Welcome page of the wizard


Step 4: Enter service name

Step 5: Choose "Define from operation and schema (specified later)" option

Step 6: Choose the following options and click Next

Type: Service [You will choose "Reference" if you need to consume a HTTP REST service]
Operation Type: Request-Response [For 2-way communication. Choose One-way if the service doesn't return a response]
Operation Name: Defaults to Request-Response [You can change it as you please]
Verb: POST [This specifies the HTTP method. You have 2 options GET/POST]
Payload Type: XML [For HTTP POST, you get 2 options url-encoded and XML. Since our payload will be huge, url-encoded will not make sense due to size restrictions]


Step 7: In the Messages dialog, select the RestPost.xsd, <Input> and <Response> XML elements for "Request Message Schema" & "Response Message Schema" respectively.

Step 8: In the summary page, click "Finish" to complete service

Now that we have completed the HTTP binding service adapter which will expose the SOA 11g BPEL process as a HTTP service, you can choose to build a BPEL process which will consume the POST message for further processing.

Deploy the completed process and obtain the HTTP service URL from EM console. We will invoke this service from another SOA composite.

Consuming a HTTP (POST) service in SOA 11g BPEL process:

Step 1: Create a SOA Project with empty composite and name it "InvokeHttpPostService"

Step 2: Drag and Drop a HTTP Binding adapter on to the "External References" swimlane in the SOA composite (SCA)

Step 3: Choose Next in the Welcome page of the wizard


Step 4: Enter service name

Step 5: Choose "Define from operation and schema (specified later)" option

Step 6: Choose the following options and click Next

Type: Reference [Since we are consuming a HTTP service - POST]
Operation Type: Request-Response [Default selection for references]
Operation Name: Request-Response [Default]
Verb: POST [This specifies the HTTP method that will be invoked]
Payload Type: XML
Endpoint: Provide the HTTP URL for the REST service to be invoked.


Step 7: In the Messages dialog, select the RestPost.xsd, <Input> and <Response> XML elements for "Request Message Schema" & "Response Message Schema" respectively.

Step 8: In the summary screen, click Finish to complete the service adapter

Now, build and complete your SOA composite which will invoke a HTTP service using POST method.

Source code can be downloaded here

Let me know your thoughts in comments section.

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.