Friday, January 28, 2011

SOA Suite 11g PS3 (11.1.1.4) fixes a lot of issues!

If you are running Oracle SOA suite 11g PS2 (11.1.1.3) and are in production, I salute you. The bad news is that 11.1.1.3 is pretty buggy and quite unstable, and you will run into endless errors. The good news is that the 11.1.1.4 resolves most of these issues.

If you haven't upgraded to 11.1.1.4, then do so immediately to take advantage of its benefits.

Below you will find a list of errors or exceptions you may encounter in 11.1.1.3 that are resolved with 11.1.1.4. Please note that you may still experience the issues below on 11.1.1.4 for other reasons, and don't hesitate to engage Oracle Support when needed. But hopefully most of your issues will get resolved with this patchset, as it did with us.

Good luck!

________________________________________


Issue #1: No free JVM heap space and java.lang.OutOfMemoryError

This error is probably the root cause of most of the issues below. As you deploy more composites to the server, the JVM heap size continues to shrink until you completely run out of memory.
<Jan 19, 2011 3:15:03 PM EST> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.MarshalledObject;[Ljava.lang.String;Ljavax.security.auth.Subject;)
 javax.management.RuntimeErrorException: java.lang.OutOfMemoryError: GC overhead limit exceeded.
javax.management.RuntimeErrorException: java.lang.OutOfMemoryError: GC overhead limit exceeded
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:858)
The WebLogic Administration Console Monitoring Dashboard shows the amount of free java heap space gradually decreasing until it reaches zero:

Issue #2: soa_server1 using 99% of the CPU

The soa_server1 java process is pegging the CPU constantly at 99%. This is due to continuous garbage collections that show up in the soa_server1.out output file (if GC logging is enabled).

The output of the "top" command below shows the java process occupying 99.6% of CPU and 59% of memory:

The logs show continuous full garbage collections which hogs the CPU continuously:
1837.993: [Full GC [PSYoungGen: 873856K->800795K(961216K)] [PSOldGen: 3145727K->3145727K(3145728K)] 4019583K->3946523K(4106944K) [PSPermGen: 395967K->395967K(398016K)], 12.8336760 secs] [Times: user=12.59 sys=0.00, real=12.84 secs]
1851.327: [Full GC [PSYoungGen: 873856K->809876K(961216K)] [PSOldGen: 3145727K->3145727K(3145728K)] 4019583K->3955604K(4106944K) [PSPermGen: 395986K->395986K(397504K)], 12.7042890 secs] [Times: user=12.59 sys=0.00, real=12.71 secs]
1864.476: [Full GC [PSYoungGen: 873856K->823074K(961216K)] [PSOldGen: 3145727K->3145727K(3145728K)] 4019583K->3968802K(4106944K) [PSPermGen: 396182K->396182K(397440K)], 12.7887330 secs] [Times: user=12.63 sys=0.00, real=12.79 secs]
1877.642: [Full GC [PSYoungGen: 873856K->783438K(961216K)] [PSOldGen: 3145727K->3145721K(3145728K)] 4019583K->3929159K(4106944K) [PSPermGen: 396351K->395549K(396864K)], 16.7096860 secs] [Times: user=16.57 sys=0.00, real=16.71 secs]
Issue #3: Composites in unknown status

When you bring up the "soa_server1" managed server, composites start loading, then once the server runs out of java heap space, all composites become in an "unknown" status, particularly when the number of composites increase.

Issue #4: Unable to retrieve composite details

When logging in to the EM console, when you click on a composite, you may receive the following error.

Unable to retrieve composite details.
The composite HelloWorld (1.0) is not available. This could happen because either the composite hsa been undeployed or soa-infra has not yet loaded this composite.
This error is usually caused by one of two issues:
    a. Due to issue #1 above
    b. Related to the use of concrete instead of abstract WSDLs when referring to other composites.

Issue #5: WSDL URL is invalid

Composites are inaccessible, and when clicking on the 'Test' button, an HTTP 503 error is returned.

Either the WSDL URL is invalid or the WSDL file is not valid or incorrect. - WSDLException: faultCode=OTHER_ERROR: Failed to read WSDL from http://oradev:8001/soa-infra/services/default/HelloWorldComposite/client?WSDL: HTTP connection error code is 503

Issue #6: SOA-20003 due to an invalid WSDL when loading composites

When starting up the server, the soa_server1.out log will show the exception below when loading composites (i.e., indicating that it is unable to register the service), and thus the composite becomes in an unknown state.
<Jan 11, 2011 6:45:59 PM EST> <Error> <oracle.integration.platform> <SOA-20003> <Unable to register service.

oracle.fabric.common.FabricException: oracle.j2ee.ws.wsdl.LocalizedWSDLException: WSDLException: faultCode=INVALID_WSDL: The document: http://oradev:8001/soa-infra/services/default/HelloWorld/HelloWorld.wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xmlsoap.org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.: WSDLException: faultCode=INVALID_WSDL: The document: http://oradev:8001/soa-infra/services/default/HelloWorld/HelloWorld.wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xmlsoap.org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.

    at oracle.fabric.composite.model.CompositeModel.loadImports(CompositeModel.java:272)
Issue #7: SOA-20003 and HTTP 503 service unavailable when loading composites

When starting up the server, the soa_server1.out log will show the exception below when loading composites (i.e., indicating that it is unable to register the service), and thus the composite becomes unavailable.
<Jan 19, 2011 2:57:56 PM EST> <Error> <oracle.integration.platform> <SOA-20003> <Unable to register service.

oracle.fabric.common.FabricException: Error in getting XML input stream: http://oradev:8001/soa-infra/services/default/HelloWorld/HelloWorld?WSDL: Response: '503: Service Unavailable' for url: 'http://oradev:8001/soa-infra/services/default/HelloWorld/HelloWorld?WSDL'

    at oracle.fabric.common.metadata.MetadataManagerImpl.getInputStreamFromAbsoluteURL(MetadataManagerImpl.java:276)
Issue #8: java.sql.SQLException: The Network Adapter could not establish the connection

The logs may show this error occassionally, particularly when the server becomes unstable.
####<Jan 11, 2011 6:35:39 PM EST> <Info> <JDBC> <oradev> <soa_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1294788939135> <BEA-001156> <Stack trace associated with message 001129 follows:


java.sql.SQLException: The Network Adapter could not establish the connection
Issue #9: BEA-149265 due to weblogic.application.ModuleException

The weblogic.application.ModuleException exception is primarily due to the network adapter not being able to establish the connection.
<Jan 19, 2011 3:05:26 PM EST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1295467469460' for task 'weblogic.deploy.configChangeTask.2'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:
    at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:290)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
    Truncated. see log file for complete stacktrace

Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: The Network Adapter could not establish the connection
Issue #10: BEA-000000 due to timeout

You may get numerous transaction timeouts after 28 or 48 seconds.
<Jan 19, 2011 3:15:03 PM EST> <Warning> <oracle.soa.mediator.common> <BEA-000000> <Transaction commit failed due to excetipn

weblogic.transaction.RollbackException: Transaction timed out after 48 seconds

BEA1-0BF2AA3AE988E50C6CCB

    at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1871)
Issue #11: BEA-149515 for numerous data sources

The BEA-149515 error appears for datasources, including many of the product datasources (for example, the AIA datasources).
<Jan 19, 2011 3:15:21 PM EST> <Warning> <JMX> <BEA-149515> <An error was encountered getting the attribute DatabaseProductName on the MBean com.bea:ServerRuntime=soa_server1,Name=AIADataSource,Type=JDBCDataSourceRuntime during a call to getAttributes>
Issue #12: Multiple WSM errors

There is a one-off patch that resolves these issues, but you are better off upgrading to 11.1.1.4 which also includes the fix.
<Jan 19, 2011 3:15:24 PM EST> <Error> <oracle.wsm.resources.security> <WSM-00006> <Error in receiving the request: oracle.wsm.security.SecurityException: WSM-00008 : Web service authentication failed..>
<Jan 19, 2011 3:15:24 PM EST> <Error> <oracle.wsm.resources.enforcement> <WSM-07607> <Failure in execution of assertion {http://schemas.oracle.com/ws/2006/01/securitypolicy}wss-username-token executor class oracle.wsm.security.policy.scenario.executor.WssUsernameTokenScenarioExecutor.>
<Jan 19, 2011 3:15:24 PM EST> <Error> <oracle.wsm.resources.enforcement> <WSM-07602> <Failure in WS-Policy Execution due to exception.>
<Jan 19, 2011 3:15:24 PM EST> <Error> <oracle.wsm.resources.enforcement> <WSM-07501> <Failure in Oracle WSM Agent processRequest, category=security, function=agent.function.service, application=soa-infra, composite=HelloWorldComposite, modelObj=client, policy=oracle/wss_username_token_service_policy, policyVersion=1, assertionName={http://schemas.oracle.com/ws/2006/01/securitypolicy}wss-username-token.>
<Jan 19, 2011 3:15:24 PM EST> <Error> <oracle.webservices.service> <OWS-04115> <An error occurred for port: FabricProvider: oracle.fabric.common.PolicyEnforcementException: FailedAuthentication : The security token cannot be authenticated..>
<Jan 19, 2011 3:15:24 PM EST> <Error> <oracle.wsm.resources.security> <WSM-00069> <The security header is missing.>
Issue #13: XAResource.XAER_RMERR start() failed on resource 'EDNDataSource_soa_domain'

This exception is related to an out-of-the-box datasource and is caused by a cryptic timeout error caused by the resource manager.
<Jan 18, 2011 4:53:49 PM EST> <Warning> <oracle.integration.platform.blocks.event.saq> <SOA-31013> <Error handling message (rolling back).java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'EDNDataSource_soa_domain': XAER_RMERR : A resource manager error has occured in the transaction branchweblogic.transaction.internal.ResourceAccessException: Transaction has timed out when making request to XAResource 'EDNDataSource_soa_domain'.
Issue #14: Numerous BEA-000000 errors

This is primarily due to lack of java heap space, which is directly related to issue #1 above.
<Jan 13, 2011 1:59:27 PM EST> <Warning> <oracle.soa.adapter> <BEA-000000> <JMSAdapter MyAdapterPoll JMSMessageConsumer_init: Retrying connection; attempt #1415>
<Jan 13, 2011 1:59:27 PM EST> <Warning> <oracle.soa.adapter> <BEA-000000> <JMSAdapter MyAdapterPoll
BINDING.JCA-12135
ERRJMS_ERR_CR_QUEUE_CONS.
ERRJMS_ERR_CR_QUEUE_CONS.
Unable to create Queue consumer due to JMSException.
Please examine the log file to determine the problem.
    at oracle.tip.adapter.jms.JMS.JMSConnection.createConsumer(JMSConnection.java:620)


Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.4)

Tuesday, January 25, 2011

Accessing the composite instance page directly on SOA Suite 11g

This was done relatively easy in SOA Suite 10g, and in 11g  the concept is roughly identical.

If you wanted a URL that takes you directly to the page that displays the flow of your composite instance in SOA Suite 11g, the URL should take the following format:
http://<hostname>:7001/em/faces/ai/soa/messageFlow?target=/Farm_<domain_name>/<domain_name>/soa_server1/<partition>/<composite_name>%20[<version>]&type=oracle_soa_composite&soaContext=<partition>/<composite_name>!<version>/<instance_id>
 For example, the URL would look like this:
http://soasandbox.ipnweb.com:7001/em/faces/ai/soa/messageFlow?target=/Farm_soa_domain/soa_domain/soa_server1/default/HelloWorld%20[1.0]&type=oracle_soa_composite&soaContext=default/HelloWorld!1.0/20001
By accessing the URL this way, once authenticated, you will be taken to the instance flow directly.

This can be advantageous if you decide to write your own error pages that link back to the console.


Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.x)

Upgrading to SOA Suite 11gR1 PS3 (11.1.1.4.0)

Upgrading to SOA Suite 11.1.1.4, otherwise known as 11gR1 PS3, is not too difficult, but there are a few typos in the documentation.

These instructions are specific to 11.1.1.4 on Red Hat or OEL Linux 32-bit. For the 64-bit installation, the instructions are identical, but the software you must download is different. All software links below are specific to the 32-bit binaries.

* Make sure to update directories, passwords, domain, hostnames, database names, ports, etc. to reflect your environment.

Download the Software

1. Navigate to http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html

2. Accept the License Agreement

3. Select Linux (32-bit JVM) from the dropdown underneath Release 11gR1 (11.1.1.4.0)

4. Click on + beside Prerequisites & Recommended Install Process

5. Download the following:
Repository Creation Utility 11.1.1.4.0
http://download.oracle.com/otn/linux/middleware/11g/111140/ofm_rcu_linux_11.1.1.4.0_disk1_1of1.zip

SOA Suite 11.1.1.4.0 Part 1 of 2
http://download.oracle.com/otn/nt/middleware/11g/111140/ofm_soa_generic_11.1.1.4.0_disk1_1of2.zip

SOA Suite 11.1.1.4.0 Part 2 of 2
http://download.oracle.com/otn/nt/middleware/11g/111140/ofm_soa_generic_11.1.1.4.0_disk1_2of2.zip
6. Login to http://support.oracle.com

7. Click on the Patches & Updates tab

8. Click on Product or Family (Advanced Search)

9. Download patch p11060966_1034_LINUX.zip by selecting the following:


Upgrade WebLogic 10.3.3 to 10.3.4

10. Stop the AdminServer, soa_server1, and Node Manager

11. Run the following commands, then follow the instructions:
unzip p11060966_1034_LINUX.zip 
chmod 700 wls1034_upgrade_linux32.bin 
./wls1034_upgrade_linux32.bin
a. Click 'Next'
b. Click 'Next'
c. Uncheck 'I wish to receive security updates via My Oracle Support'
d. Click 'Next'
e. Click 'Yes'
f. Click 'Next'
g. Uncheck 'Oracle Coherence'
h. Uncheck 'Oracle Enterprise Pack for Eclipse'
i. Click 'Next'
j. Click 'Next'
(installer runs)
k. Uncheck 'Run Quickstart'
l. Click 'Done'
Upgrade SOA Suite 11.1.1.2/11.1.1.3 to 11.1.1.4

12. Run the following commands, then follow the instructions:
unzip ofm_soa_generic_11.1.1.4.0_disk1_1of2.zip 
unzip ofm_soa_generic_11.1.1.4.0_disk1_2of2.zip 
./Disk1/runInstaller -jreLoc /u01/app/middleware/home_11g/jdk160_21
a. Click 'Next'
b. Check 'Skip Software Updates'
c. Click 'Next'
d. Click 'Next'
e. Click 'Next'
f. Click 'Yes'
g. Click 'Next'
h. Click 'Install'
(installation runs)
i. Click 'Next'
j. Click 'Finish'
Update Schemas with Patch Set Assistant

13. For more information, refer to the following document:
http://download.oracle.com/docs/cd/E17904_01/doc.1111/e16793/patch_set_assistant.htm#BABEBGEJ
14. Run the following commands:
export ORACLE_HOME=/u01/app/oracle/middleware/home_11g/Oracle_SOA1

cd $ORACLE_HOME/bin
./psa -dbType Oracle -dbConnectString //soasandbox.ipnweb.com:1521/orcl.ipnweb.com -dbaUserName sys -schemaUserName DEV_SOAINFRA
./psa -dbType Oracle -dbConnectString //soasandbox.ipnweb.com:1521/orcl.ipnweb.com -dbaUserName sys -schemaUserName DEV_MDS
[ enter the SYS password ]
[ Enter the DEV_SOAINFRA password ]
15. Install the purge scripts
unzip ofm_rcu_linux_11.1.1.4.0_disk1_1of1.zip

cd ./rcuHome/rcu/integration/soainfra/sql/soa_purge

sqlplus dev_soainfra/welcome1@orcl @soa_purge_scripts.sql
quit

cd ../verify

sqlplus dev_soainfra/welcome1@orcl @soa_verify_scripts.sql

quit
Perform Post-Patching Tasks

16. Execute the following commands:
cd /u01/app/oracle/middleware/home_11g/oracle_common/common/bin

./setWlstEnv.sh

./wlst.sh

upgradeJRF('/u01/app/oracle/middleware/home_11g/user_projects/domains/base_domain')
If using LDAP for authentication, read chapter 3.8.3 before running the command below (http://download.oracle.com/docs/cd/E17904_01/doc.1111/e16793/patch_set_installer.htm#CHDBAHHG).
upgradeOpss(jpsConfig="/u01/app/oracle/middleware/home_11g/user_projects/domains/base_domain/config/fmwconfig/jps-config.xml", jaznData="/u01/app/oracle/middleware/home_11g/oracle_common/modules/oracle.jps_11.1.1/domain_config/system-jazn-data.xml")

exit()
rm -rf /u01/app/oracle/middleware/home_11g/user_projects/domains/base_domain/servers/AdminServer/tmp/* 
rm -rf /u01/app/oracle/middleware/home_11g/user_projects/domains/base_domain/servers/soa_server1/tmp/*
cd $DOMAIN_HOME/bin
nohup $DOMAIN_HOME/bin/startWebLogic.sh &

cd /u01/app/oracle/middleware/home_11g/Oracle_SOA1/common/bin

./wlst.sh ../../bin/soa-upgrade.py --username weblogic --password welcome1 --wlsHost soasandbox.ipnweb.com --adminServerListenPort 7001 --targetList soa_server1
17. Contact Oracle Support to remove the annoying warning. See chapter 3.8.5.2 for more details (http://download.oracle.com/docs/cd/E17904_01/doc.1111/e16793/patch_set_installer.htm#CHDHGDGF).

18. If upgrading from 11.1.1.2, then read chapter 3.8.4 (http://download.oracle.com/docs/cd/E17904_01/doc.1111/e16793/patch_set_installer.htm#BABBCEDH).

19. Read chapter 3.8.9 to add new OWSM pre-defined rolicies (http://download.oracle.com/docs/cd/E17904_01/doc.1111/e16793/patch_set_installer.htm#CHDBICJH).


References:
  • http://download.oracle.com/docs/cd/E17904_01/doc.1111/e16793/patch_set_installer.htm
  • http://download.oracle.com/docs/cd/E17904_01/doc.1111/e16793/patch_set_assistant.htm

Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.4)
  • Oracle Enterprise Linux 5.5 32-bit

Sunday, January 23, 2011

Tracing asynchronous flows in SOA Suite 11g

SOA Suite 11g has a new capability not available in SOA Suite 10g.

For example, if you have BPEL process 1 synchronously invoking BPEL process 2, you would be able to trace the flow in the consoles on both 10g and 11g. This way, you have end-to-end visibility into your synchronous flow.

However, BPEL process 1 may asynchronously flow into BPEL process 2 by way of an AQ or JMS queue. In this case, the flow is broken, and the 10g console has no way to automatically correlate the instances to allow you to easily trace the flow.
Oracle SOA Suite 11g solved this issue by generating a unique ECID in each message. This way, when you observe the instance in the Fusion Middleware Console 11g, you can easily trace the flow as the console automatically links the instances for you based on the ECID.

As you can see in the Flow Trace window below, BPEL process 1 (InvokeMemberABCS) produces a message into some JMS queue by way of the JMS Adapter (see 'AddCustomerToJMS'). This message is then asynchronously consumed by BPEL process 2 (MemberABCS) via an inbound JMS Adapter (see 'RetrieveMemberDataJMS'). As you can see here, we are able to see the end-to-end flow within the same window.


This is a simple, yet incredibly valuable addition that will definitely ease development and production support for your SOA implementations.


Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.x)

"Management:141190" when trying to create a Persistent Store

A WebLogic persistent store is a physical repository for storing subsystem data, such as persistent JMS messages. It can be either a JDBC-accessible database or a disk-based file.


Problem:

When creating a Persistent Store in Oracle WebLogic and committing the changes, the following message appears on the WebLogic Server Administration Console:

An error occurred during activation or changes, please see the log for details.
[Management:141190]The commit phase of the configuration update failed with an exception:
one or more registered update listeners reported activation problems. The following failures occurred: -- The following failures occurred: -- weblogic.management.DeploymentException:

Solution:

1. Restart the AdminServer and try again. It should now work.



Applicable Versions:
  • Oracle WebLogic Server 11g (10.3.3)

Friday, January 21, 2011

MDS-00054: The file to be loaded does not exist

Problem:

If you compile a SOA Suite 11g composite project, you may receive an error similar to the following error under the Compiler log:
Error: Load of wsdl "HelloWorld.wsdl with Message part element undefined in wsdl [file:/C:/svn/HelloWorld/HelloWorld2.wsdl] part name = QueryHelloNameRequestEBM type = {http://ns.ipnweb.com/EnterpriseBusinessObjects/HelloName}QueryHelloNameRequestEBM" failed
Error(3,222): Load of wsdl "HelloWorld.wsdl with Message part element undefined in wsdl [http://oradev/HelloNameWS/services/HelloNameService/wsdl/HelloName.wsdl] part name = parameters type = {http://xsd.services.ipnweb.com}IdentityValidationAvailableResponse" failed
Warning(20,208): Failed to Find Binding "HelloWorldSOAP":"{http://services.ipnweb.com}HelloNameService" in WSDL Manager
You may also receive an error similar to the following under the SOA log:
Buildfile: C:\Oracle\Middleware\jdeveloper\bin\ant-sca-compile.xml

scac:
     [scac] Validating composite "C:\svn\HelloWorld\composite.xml"
     [scac] oracle.fabric.common.wsdl.XSDException: Error loading schema from file:/C:/svn/HelloWorld/HelloWorld.wsdl [Cause=Error in getting XML input stream: oramds:/apps/AIAMetaData/ns.ipnweb.com/EnterpriseBusinessObjects/HelloWorld.xsd: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/AIAMetaData/ns.ipnweb.com/EnterpriseBusinessObjects/HelloWorld.xsd does not exist.]
     [scac]     at oracle.fabric.common.wsdl.SchemaBuilder.loadEmbeddedSchemas(SchemaBuilder.java:496)
     [scac]     at oracle.fabric.common.wsdl.SchemaBuilder.loadSchemasFromWSDL(SchemaBuilder.java:365)
     [scac]     at oracle.fabric.common.wsdl.SchemaBuilder.loadAllSchemas(SchemaBuilder.java:202)
     [scac]     at oracle.fabric.common.wsdl.SchemaManager.loadAllXSD(SchemaManager.java:139)
     [scac]     at oracle.fabric.common.wsdl.SchemaManager.buildXDKSchema(SchemaManager.java:348)
     [scac]     at oracle.fabric.common.wsdl.SchemaManager.lookupSchema(SchemaManager.java:216)
     [scac]     at oracle.fabric.common.wsdl.SchemaManager.lookupXSDElementDeclaration(SchemaManager.java:399)
     [scac]     at oracle.soa.scac.WSDLValidator.validateMessageParts(WSDLValidator.java:112)
     [scac]     at oracle.soa.scac.WSDLValidator.validateMessages(WSDLValidator.java:88)
     [scac]     at oracle.soa.scac.WSDLValidator.validate(WSDLValidator.java:47)
     [scac]     at oracle.soa.scac.WSDLValidator.validate(WSDLValidator.java:40)
     [scac]     at oracle.soa.scac.ValidateComposite.loadWSDLs(ValidateComposite.java:1004)
     [scac]     at oracle.soa.scac.ValidateComposite.doValidation(ValidateComposite.java:568)
     [scac]     at oracle.soa.scac.ValidateComposite.run(ValidateComposite.java:156)
     [scac]     at oracle.soa.scac.ValidateComposite.main(ValidateComposite.java:141)
     [scac] Caused by: oracle.fabric.common.FabricException: Error in getting XML input stream: oramds:/apps/AIAMetaData/ns.ipnweb.com/EnterpriseBusinessObjects/HelloName/HelloWorld.xsd: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/AIAMetaData/ns.ipnweb.com/EnterpriseBusinessObjects/HelloName/HelloWorld.xsd does not exist.
     [scac]     at oracle.fabric.common.metadata.MetadataManagerImpl.getInputStreamFromAbsoluteURL(MetadataManagerImpl.java:276)
     [scac]     at oracle.integration.platform.common.MDSMetadataManagerImpl.getInputStreamFromAbsoluteURL(MDSMetadataManagerImpl.java:545)
     [scac]     at oracle.fabric.common.metadata.MetadataManagerImpl.getDocumentAsInputStream(MetadataManagerImpl.java:155)
     [scac]     at oracle.integration.platform.common.MDSMetadataManagerImpl.getDocumentAsInputStream(MDSMetadataManagerImpl.java:407)
     [scac]     at oracle.fabric.common.wsdl.SchemaBuilder.parseXMLSrc(SchemaBuilder.java:964)
     [scac]     at oracle.fabric.common.wsdl.SchemaBuilder.parseXSDSrc(SchemaBuilder.java:919)
     [scac]     at oracle.fabric.common.wsdl.SchemaBuilder.processSchemaImportsAndInclude(SchemaBuilder.java:769)
     [scac]     at oracle.fabric.common.wsdl.SchemaBuilder.loadEmbeddedSchemas(SchemaBuilder.java:492)
     [scac]     ... 14 more
     [scac] Caused by: java.io.IOException: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/AIAMetaData/ns.ipnweb.com/EnterpriseBusinessObjects/HelloName/HelloWorld.xsd does not exist.
     [scac]     at oracle.mds.internal.net.AbstractOraMDSURLConnection.getPDocStream(AbstractOraMDSURLConnection.java:388)
     [scac]     at oracle.mds.internal.net.AbstractOraMDSURLConnection.getInputStream(AbstractOraMDSURLConnection.java:176)
     [scac]     at oracle.mds.internal.net.OraMDSURLConnection.getInputStream(OraMDSURLConnection.java:67)
     [scac]     at java.net.URL.openStream(URL.java:1010)
     [scac]     at oracle.fabric.common.metadata.MetadataManagerImpl.getInputStreamFromAbsoluteURL(MetadataManagerImpl.java:272)
     [scac]     ... 21 more
     [scac] Caused by: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/AIAMetaData/ns.ipnweb.com/EnterpriseBusinessObjects/HelloName/HelloWorld.xsd does not exist.
     [scac]     at oracle.mds.internal.net.AbstractOraMDSURLConnection.getPDocStream(AbstractOraMDSURLConnection.java:339)
     [scac]     ... 25 more
     [scac] FATAL_ERROR: location {/ns:composite/ns:import[@location='file:/C:/svn/HelloWorld/HelloWorld2.wsdl']}: Load of wsdl "HelloWorld.wsdl with Message part element undefined in wsdl [file:/C:/svn/HelloWorld/HelloWorld2.wsdl] part name = QueryHelloNameRequestEBM    type = {http://ns.ipnweb.com/EnterpriseBusinessObjects/HelloName}QueryHelloNameRequestEBM" failed
     [scac] FATAL_ERROR: location {/ns:composite/ns:import[@location='file:/C:/svn/HelloWorld/HelloWorld.wsdl']}: Load of wsdl "HelloWorld.wsdl with Message part element undefined in wsdl [file:/C:/svn/HelloWorld/HelloWorld.wsdl] part name = QueryHelloNameRequestEBM    type = {http://ns.ipnweb.com/EnterpriseBusinessObjects/HelloName}QueryHelloNameRequestEBM" failed
     [scac] FATAL_ERROR: location {/ns:composite/ns:import[@location='http://oradev/HelloNameWS/services/HelloNameService/wsdl/HelloNameSOAP.wsdl']}(3,222): Load of wsdl "HelloWorld.wsdl with Message part element undefined in wsdl [http://oradev/HelloNameWS/services/HelloNameService/wsdl/HelloName.wsdl] part name = parameters    type = {http://xsd.services.ipnweb.com}IdentityValidationAvailableResponse" failed
     [scac] FATAL_ERROR: location {/ns:composite/ns:import[@location='http://oradev/HelloNameWS/services/HelloNameService/wsdl/HelloName.wsdl']}: Load of wsdl "HelloWorld.wsdl with Message part element undefined in wsdl [http://oradev/HelloNameWS/services/HelloNameService/wsdl/HelloName.wsdl] part name = parameters    type = {http://xsd.services.ipnweb.com}IdentityValidationAvailableResponse" failed
     [scac] WARNING: location {/ns:composite/ns:reference[@name='HelloWorldSOAP']}(20,208): Failed to Find Binding "HelloWorldSOAP":"{http://services.ipnweb.com}HelloNameService" in WSDL Manager

BUILD FAILED
C:\Oracle\Middleware\jdeveloper\bin\ant-sca-compile.xml:236: Java returned: 1 Check log file : C:\svn\HelloWorld\SCA-INF\classes\scac.log for errors

Total time: 38 seconds

Solution:

1. One way to resolve this is to create an adf-config.xml file in your project folder under this directory:
C:\svn\HelloWorld\SCA-INF\classes\META-INF
2. The file format would look like this (lines in bold may need to be modified):
<?xml version="1.0" encoding="windows-1252" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:adf="http://xmlns.oracle.com/adf/config/properties">
  <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
    <adf-property name="adfAppUID" value="TemporaryMDS-2296"/>
  </adf:adf-properties-child>
  <adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
    <mds-config xmlns="http://xmlns.oracle.com/mds/config">
      <persistence-config>
        <metadata-namespaces>
          <namespace metadata-store-usage="mstore-usage_1" path="/apps"/>
          <namespace metadata-store-usage="mstore-usage_1" path="/deployed-composites"/>
          <namespace metadata-store-usage="mstore-usage_1" path="/soa"/>
        </metadata-namespaces>
        <metadata-store-usages>
          <metadata-store-usage id="mstore-usage_1">
            <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
              <property value="MDSSchema" name="jdbc-userid"/>
              <property value="MDSPassword" name="jdbc-password"/>
              <property value="jdbc:oracle:thin:@//MDSHost:MDSPort/MDSDBName" name="jdbc-url"/>
              <property value="soa-infra" name="partition-name"/>
            </metadata-store>
          </metadata-store-usage>
        </metadata-store-usages>
      </persistence-config>
    </mds-config>
  </adf-mds-config>
</adf-config>
This is to provide the MDS connection information to the compiler so that it can connect to the MDS to load the schema that you are trying to load via the "oramds" reference.

Alternatively, you can update the ~/.adf/adf-config.xml file in your application folder (which is probably preferred, since it won't get deleted after compilation, and applies to all your projects).


Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.x)

Thursday, January 20, 2011

Procedure for using Error Policy with JDeveloper 11g

Introduction

Oracle Fusion Middleware (FMW) 11g provides sophisticated error handling capabilities that allow a developer to easily define exception handling at various levels in a composite application. The fault-handling framework uses exception-handling policies describes using XML  These exception-handling policies are attached to a composite and are not defined within its code.  This allows a developer to reuse policy definitions across multiple components, composites and project.

A project-wide error policy named ExampleProcessingFaults has been defined that specifies actions that should be taken for binding faults, mediator faults, and remote faults.

This document lists the steps that a developer should take to use this project-wide error policy for an existing SOA application.

Procedure

1.      Start Oracle JDeveloper and right click the project that you want to modify.

2.   Select File / New as shown below:


3.      Select XML Document and click the OK button.


4.      Enter the name fault-bindings.xml as the file name and press the OK button.  This name must be entered exactly as shown.



5.      Paste the following code from this document into the fault-bindings.xml file. Note that this code references the ExampleProcessingFaults policy
<?xml version="1.0" encoding="UTF-8" ?>
<faultPolicyBindings version="2.0.1"
                     xmlns="http://schemas.oracle.com/bpel/faultpolicy"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <composite faultPolicy="ExampleProcessingFaults"/>
</faultPolicyBindings>
6.    Save the project and redeploy it.  The new fault policy rules should now be in effect.


Applicable Versions:
  • Oracle JDeveloper 11g (11.1.1.3.0)

How to use AIA EBO schema's with JDeveloper 11g

Introduction

Oracle's Application Integration Architecture (AIA) provides a comprehensive list of pre-built data structures for use in a Fusion Middleware (FMW) environment.  These data structures are defined using XML Schema Definition (XSD) standards and are referred to as Enterprise Business Objects (EBOs).

The steps below provide an example of how to use these EBO's schema definitions in a BPEL process.


Procedure

      1.      Start Oracle JDeveloper and navigate to an existing BPEL process.

2.      Right-click on any BPEL activity and select View / Variables from the pop-up menu


3.  Click on the + button in the upper left side of the screen.


4.  Enter the name for a new variable and select Element / Browse


5.    Click the icon at the top of the pop-up screen as shown below.


6.    On the following screen, click the Browse button


7.    Select Resource Palette from the drop down list and navigate through the hierarchy displayed under MDS to find the EBO that you are interested in.


For example, in this screen we've selected a Sales Order EBO schema definition.

The key is not to import the schema into your project, and instead use an MDS reference (this is done automatically if you follow the steps above). The reason is that each EBO has numerous other schema imports and you want to avoid having to import hundreds of schemas and sub-schemas into your project.


Applicable Versions:
  • Oracle AIA Foundation Pack 11g R1 (11.1.1.2)
  • Oracle JDeveloper 11g

'hw_services' is not in RUNNING state

Problem:

I tried to start up Oracle SOA Suite 10g using the standard "opmnctl startall" command. Unfortunately, the OC4J_SOA container did not start up and the opmn logs were showing the following error:
--------
11/01/11 15:55:58 Start process
--------
Warning: The flag AppendRatio=3 has been EOL'd as of 6.0_10 and will be ignored
11/01/11 15:59:12 log4j:WARN No appenders could be found for logger (wsif).
11/01/11 15:59:12 log4j:WARN Please initialize the log4j system properly.
11/01/11 15:59:14 java.lang.IllegalStateException: MessageDrivenHome:: application state=3 - Application: 'hw_services' is not in RUNNING state.
11/01/11 15:59:14 Oracle Containers for J2EE 10g (10.1.3.5.0)  initialized
11/01/11 15:59:14       at com.evermind.server.ejb.MessageDrivenHome.checkRunningState(MessageDrivenHome.java:1229)
11/01/11 15:59:14       at com.evermind.server.ejb.MessageDrivenConsumer.run(MessageDrivenConsumer.java:162)
11/01/11 15:59:14       at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
11/01/11 15:59:14       at java.lang.Thread.run(Thread.java:619)

Solution:

I'm not sure why this happens, but the solution is simple.

1. Log in to EM as 'oc4jadmin' (http://server:port/em)

2. Expand "oc4j_soa", and you will see a list of applications

3. Select "hw_services" and start it up


Applicable Versions:
  • Oracle SOA Suite 10g (10.1.3.5)

References:
  • http://sathyam-soa.blogspot.com/2009/09/bpel-process-manager-server-10134.html

OPatch cannot proceed!

Problem:

I tried to run OPatch on Oracle SOA Suite 11g (Linux) and got the following error, even though my JAVA_HOME and PATH environment variables were correctly set:
oracle@oradev:/u01/app/oracle/middleware/Oracle_SOA1/OPatch> ./opatch lsinventory 
/u01/app/oracle/jdk/bin/java is not a valid executable for this platform. OPatch cannot proceed!
OPatch returns with error code = 1
Solution:

This was because ORACLE_HOME was incorrectly defined.

1. Correctly set the ORACLE_HOME environment variable, and rerun the command:
export ORACLE_HOME=/u01/app/oracle/middleware/Oracle_SOA1
Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.x)

Wednesday, January 19, 2011

The persistent store could not be deployed on WebLogic 11g

Problem:

We created a JMS Server, and upon startup of the WebLogic managed server, we received the following error in the logs:
<Jan 12, 2011 3:07:41 PM EST> <Error> <Store> <BEA-280061> <The persistent store "MyJMSStore" could not be deployed: weblogic.store.io.jdbc.JDBCStoreException: open failed>
This is how we created the JMS Server:

1. Create a Persistent JDBC Store with the following settings:
Name:         MyJMSStore
Target:         soa_server1
Datasource: MyJMSDataSource (which was a newly created datasource)
2. Create a JMS Server with the following settings:
Name:                MyJMSServer
Persistent Store: MyJMSStore
Target:               soa_server1
3. Shutdown and restart the AdminServer and soa_server1 



Investigation:

Upon further investigation in the soa_server1.out log, we noticed the following:
<Jan 12, 2011 3:07:20 PM EST> <Warning> <Store> <BEA-280076> <Database table "WLStore" for store "MyJMSStore" is currently owned by "[name={server=soa_server1!host=192.168.1.197!domain=soa_domain!store=MyJMSStore!table=WLStore}:random=8560773209970381667:timestamp=1294862840724]". Trying to wait for ownership.>

<Jan 12, 2011 3:07:41 PM EST> <Error> <Store> <BEA-280077> <JDBC store "MyJMSStore" in this server is not the owner of database table "WLStore". Unexpected current owner is "[name={server=soa_server1!host=192.168.1.197!domain=soa_domain!store=MyJMSStore!table=WLStore}:random=8560773209970381667:timestamp=1294862850740]", expected current owner is "[name={server=soa_server1!host=192.168.1.127!domain=soa_domain!store=MyJMSStore!table=WLStore}:random=-402518923774162410:timestamp=1294862840029]".>

<Jan 12, 2011 3:07:41 PM EST> <Error> <Store> <BEA-280072> <JDBC store "MyJMSStore" failed to open table "WLStore".
weblogic.store.io.jdbc.JDBCStoreException: [Store:280064]280077 (server="soa_server1" store="MyJMSStore" table="WLStore")>

<Jan 12, 2011 3:07:41 PM EST> <Error> <Store> <BEA-280061> <The persistent store "MyJMSStore" could not be deployed: weblogic.store.io.jdbc.JDBCStoreException: open failed>
The log states that the unexpected current owner of this Persistent Store is:
{server=soa_server1!host=192.168.1.197!domain=soa_domain!store=MyJMSStore!table=WLStore}
The log states that the expected owner should be:
{server=soa_server1!host=192.168.1.127!domain=soa_domain!store=MyJMSStore!table=WLStore}
These are different IP addresses!

The IP address of my server was 192.168.1.127, and for some reason, it was picking up the IP address of some other random server!


Solution:

This was because the same database persisted JMS Server (named "MyJMSServer") was created on 2 separate WebLogic servers and pointing to the same datasource.

Oracle documentation states that "Two JDBC stores must not share the same database table, because this will result in data corruption."

1. Delete the JMS Server on one of the servers.

2. Change the JMS Server name from "MyJMSServer" to "MyJMSServer2" (or any other name) to avoid conflict, since the two JMS Servers on both servers are using the same datasource.

3. Now when we start up the AdminServer, the JMS Server starts up correctly:
soa_server1.log:####<Jan 19, 2011 5:57:09 PM EST> <Info> <JMS> <oradev> <soa_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Dtuning)'> <<WLS Kernel>> <> <> <1295477829640> <BEA-040109> <JMSServer "MyJMSServer2" is started.>

References:
  • http://download.oracle.com/docs/cd/E13222_01/wls/docs103/config_wls/store.html#wp1143851
  • Many thanks to Abhishek from Oracle Support

Tuesday, January 11, 2011

How to create a Test and Simulator Definition in AIA

This post describes how to create a Test and Simulator definition in Oracle AIA Foundation Pack 3.0.


Create Test Definition

1. Navigate and log in to the Oracle AIA Console (e.g., http://oradev:8001/AIA).

2. Select the Validation System tab.

3. Click the Definitions link.

4. Click Create Test.

5. Enter the Required Values on the Create Test page:
    a. Id: unique key identifier that is assigned to the test definition
    b. Name: HelloWorld
    c. Type: Test
    d. Service Type: Select the business service pattern of the web service (Synchronous, Notify, Asynchronous)
    e. Service Name: HelloWorld
    f.  Service Version: Enter the web service you want to test using the test definition.Version of web service.
    g. Process Name: Enter the name of the process that includes the web service you want to use.
    h. PIP Name: Enter the name of PIP that includes the web service you want to test using the test definition.
    i. Endpoint URL: Enter the URL of the web service you want to test using the test definition.
    j. Get Operations: Click to display the list of operations supported by WSDL associated with the Endpoint.
    k.SOAP Action: If you clicked Get Operations to select an operation in the Select WSDL operations.
    l. Get Messages: Click to generate a request stub message for operation specified in the SOAP Action field.

Test Messages (Use group box to enter request and response XML message text)

1. Request Message:  Entering request message XML text for a test definition is required, whether the Service Type field value is set to Synchronous, Notify, or Asynchronous.
* If you are manually entering your request message, the “Paste your SOAP Message Content here” text in the stub message indicates where you should paste your actual request message text. This request message should mimic the XML message text sent by the service that normally initiates the service.

2. Response Message: The ability to enter response message XML text is available
when the Service Type field value is set to Synchronous or Asynchronous.
* If you are manually entering your request message, the “Paste your SOAP Message Content here” text in the stub message indicates where you should paste your actual response message text. Enter a response message that is the expected response message XML.


Create Simulator Definition

1. Navigate and login to the Oracle AIA Console (e.g., http://oradev:8001/AIA).

2. Select the Validation System tab.

3. Click the Definitions link.

4. Click Create Simulator

5. Enter the Requred Values on the Create Simulator page.
    a. Id: unique key identifier that is assigned to the simulator definition.
    b. Name: HelloWorld
    c. Type: Simulator
    d. Service Type:  Select the business service pattern of the web service (Synchronous, Notify, Asynchronous)
    e. Service Name: HelloWorld
    f.  Service Version: Enter the web service you want to test using the test definition.Version of web service.
    g. Process name: Enter the name of the process that includes the web service you want to use.
    h. PIP Name:  Enter the name of PIP that includes the web service you want to test using the simulator definition.

Test Messages (Use group box to enter request and response XML message text)

1. Request Message:  Entering request message XML text for a simulator definition is required, whether the Service Type field value is set to Synchronous, Notify, or Asynchronous.
* If you are manually entering your request message, the “Paste your SOAP Message Content here” text in the stub message indicates where you should paste your actual request message text. This request message should mimic the XML message text sent by the service that normally initiates the service.
2. Response Message: The ability to enter response message XML text is available
when the Service Type field value is set to Synchronous or Asynchronous.
* If you are manually entering your request message, the “Paste your SOAP Message Content here” text in the stub message indicates where you should paste your actual response message text. Enter a response message that is the expected response message XML.

Tuesday, January 4, 2011

"No trusted certificate found" and "SSLHandshakeException" when referencing an HTTPS composite

Problem:

In our composite, we tried to reference an external wsdl which is listening on HTTPS.

When we try to reference the wsdl, we receive the following error:
Error while reading wsdl file https://server/HelloWorld?wsdl. Exception: WSDLException: faultCode=PARSER_ERROR: Failed to read wsdl file at: "https://server/HelloWorld?wsdl", caused by: javax.net.ssl.SSLHandshakeException.    : javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

Solution:

The reason behind the error above is because the SSL certificate on the target web server is signed by the customer's own CA (Certificate Authority). The idea is to configure JDeveloper 11g to trust this Certificate Authority.

1. Paste the URL of the external web service in Firefox

2. Click on the lock icon on the bottom of the browser


3. Click on View Certificate

4. Click on the Details tab

5. Under "Certificate Hierarchy", click on the issuing CA (beside the arrow)

6. Click on Export...

7. Save the file to JDeveloper's Java Home location, under ~/lib/security. If the ~/security subfolder doesn't exist, then create it. For example, this is my location:
C:\dev\jdev11g\jdk160_18\lib\security

8. Open a command prompt window and perform the following:
echo ----------------------------------------
echo Set the environment
echo ----------------------------------------
cd C:\dev\jdev11g\jdk160_18\lib\security
set JAVA_HOME=C:\dev\jdev11g\jdk160_18
set PATH=%JAVA_HOME%\bin;%PATH%

echo ----------------------------------------
echo Import the CA cert to a Java keystore (setting password to 'welcome1')
echo ----------------------------------------
keytool -import -trustcacerts -file IPNWeb-Issuing-CA.crt -keystore IPNWeb-Issuing-CA.jks -storepass welcome1

echo ----------------------------------------
echo List the CA certs in the Java keystore
echo ----------------------------------------
keytool -list -v -keystore IPNWeb-Issuing-CA.jks -storepass welcome1
9. Open up JDeveloper 11g

10. Navigate to Tools -> Preferences -> Http Analyzer -> HTTPS Setup

11. Browse to the location of the Client Trusted Certificate Keystore as shown, and enter the password of 'welcome1' (which is what we used in step 8)

12. Click on OK then OK

13. Try again, and it should work now


Follow Up:

One of our developer's ran into the following error when trying to copy the schemas locally (after performing the steps above). The error appears as:
Artifact Localizer encountered exception: WSDLException: faultCode=parsing xml error: javax.net.ssl.SSLKeyException: [Security:090542]Certificate chain received from ipnweb.com - 192.168.20.2 was not trusted causing SSL handshake failure. Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain. If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates, then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.
To avoid this error, perform the following:

1. Open a command prompt window and run the following commands:
cd C:\dev\jdev11g\jdk160_18\lib\security
set JAVA_HOME=C:\dev\jdev11g\jdk160_18
set PATH=%JAVA_HOME%\bin;%PATH%
keytool -import -keystore cacerts -file IPNWeb-Issuing-CA.crt -storepass welcome1
2. Open the C:\dev\jdev11g\jdk160_18\lib\security folder and double-click on the "IPNWeb-Issuing-CA.crt" file, and accept all defaults.

3. Try again, and the error above should be resolved.


Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.3)
  • Oracle JDeveloper 11g (11.1.1.3)

References:
  • http://download.oracle.com/docs/cd/E14571_01/integration.1111/e10226/soacompapp_secure.htm#CHDHIBJF
  • http://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html