Wednesday, February 27, 2013

SCAC-50012: AIA Service


Problem  
While performing an enhancement on an AIA Integration an error pops up during the compilation process.  There's a bunch of information out there like this blog post, that give a general idea of where to look. One of the specific cases is when AIA Service constructor has been used to create a BPEL process. The template for the ABCS constructor uses calls to the AIA logger. The problem is that there are missing AIA libraries that the service needs to compile correctly.
Error:
<Fault>
  <severity>error</severity>
  <loc>/ns:composite</loc>
  <line/>
  <col/>
  <file/>
  <msg>
    <![CDATA[SCAC-50012]]>
  </msg>
</Fault>

Solution
Install the AIA service constructor using the instructions found in the link below. Once it has been installed JDeveloper may require a restart, and then compilation will succeed.

Resources
http://docs.oracle.com/cd/E23549_01/doc.1111/e17364/bldgintflows.htm#CHDFFDEI

Deploying the aia.jar to OSB 11g

This blog post describes how to import your custom XPath functions to OSB 11g. What if you wanted to use the AIA 11g XPath functions in OSB 11g?


1. Get the aia.jar file. It is typically located here:
/u01/app/oracle/middleware/aia5/lib/aia.jar
2. Copy it to here:
/u01/app/oracle/middleware/Oracle_OSB1/config/xpath-functions/
3. Restart the OSB managed servers after saving the changes



Application versions:
  • Oracle Service Bus (OSB) 11g (11.1.1.4+)

Deploying a custom XPath function to OSB 11g

My book describes how to deploy custom XPath to Oracle SOA Suite 11g. This blog post describes how to do the same thing in OSB 11g.

1. Copy your JAR file (e.g., customXPathFunctions.jar) to:
$MW_HOME/Oracle_OSB1/config/xpath-functions/
2. Edit $MW_HOME/Oracle_OSB1/config/xpath-functions/osb-built-in.xml and add the properties of your particular XPath function (this is an example):
<xpf:function>
  <xpf:name>currentDateTime</xpf:name> 
  <xpf:comment>%FUNC_CURRENTDATETIME_COMMENT%</xpf:comment>
  <xpf:namespaceURI>http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20</xpf:namespaceURI> 
  <xpf:className>oracle.tip.pc.services.functions.Xpath20</xpf:className>
  <xpf:method>java.lang.String currentDateTime()</xpf:method> 
  <xpf:isDeterministic>false</xpf:isDeterministic> 
  <xpf:scope>Pipeline</xpf:scope> 
  <xpf:scope>SplitJoin</xpf:scope>
</xpf:function>
3. Edit $MW_HOME/Oracle_OSB1/config/xpath-functions/osb-built-in.properties and add the following (this is an example):
%FUNC_CURRENTDATETIME_COMMENT%=Returns current date time stamp. E.g. xp20:currentDateTime()
4. Restart the OSB managed servers after saving the changes



Application versions:
  • Oracle Service Bus (OSB) 11g (11.1.1.4+)

"Data transfer error in MDS.: (Wrapped) UTF binary length"

Problem:

I was using Ant to import a large number of files to the MDS.

Here is the output and the error received:
importMDSArtifact:   [delete] Deleting directory /u01/deploy/tmp/AIAMetaData    [mkdir] Created dir: /u01/deploy/tmp/AIAMetaData      [zip] Building zip: /u01/deploy/tmp/AIAMetaData/AIAMetaData_mds.jar      [zip] Building zip: /u01/deploy/tmp/AIAMetaData/AIAMetaData_mds.zip     [echo] SAR File: /u01/deploy/tmp/AIAMetaData/AIAMetaData_mds.zip     [echo] oracle.home = /u01/app/oracle/middleware/Oracle_SOA1
deploy:    [input] skipping input as property serverURL has already been set.    [input] skipping input as property sarLocation has already been set.[deployComposite] setting user/password..., user=weblogic[deployComposite] Processing sar=/u01/deploy/tmp/AIAMetaData/AIAMetaData_mds.zip[deployComposite] created temp dir =/tmp/deploy_client_1361656759642[deployComposite] Adding shared data file - /tmp/deploy_client_1361656759642/AIAMetaData_mds.jar[deployComposite] INFO: Creating HTTP connection to host:soadev, port:8001[deployComposite] INFO: Received HTTP response from the server, response code=500[deployComposite] ---->response code=500, error:There was an error deploying the composite on soa_server1: Data transfer error in MDS.: (Wrapped) UTF binary length=510738, max=65535.[deployComposite]     [echo]

Solution:

This is the second time in the last 12 months that I encountered this error. I can't remember how I resolved it the first time. However, the solutions this time was:

1. Bounce all SOA managed servers and try again (e.g., soa_server1, soa_server2, etc.)



Application versions:
  • Oracle SOA Suite 11g (11.1.1.5+)

Create a DB Adapter JNDI in WebLogic Server 11g

This blog post describes how to create a JNDI to a database in Oracle WebLogic 11g so that it can be referenced in your code.

For example, you may want to use the JNDI called eis/DB/DataWarehouse in your SOA code. This is done at design time in JDeveloper as shown in the following screenshot:



To create a JNDI to a database resource, two steps must be done on the WebLogic Server:
  • Create a data source and connection pool
  • Configure the Database Adapter


Create a Data Source

1. Log in to the WebLogic Server Administration Console

2. Click on Data Sources

3. Click on New > Generic Data Source

4. Enter a name for this data source (any name) and JNDI (this JNDI is typically used by Java code)


5. Click on Next

6. Choose your Database Drive (ask your DBA for assistance)

7. In the "Connection Properties" page, enter your database connection configuration

8. Keep navigating through the screens

9. In the "Select Targets", select which managed server you want this data source to be available to

10. Save and Active your changes


Configure the Database Adapter

1. On the WebLogic Administration Console, click on Deployments

2. Scroll down and click on DbAdapter > Configuration > Outbound Connection Pools

3. Click on New

4. Select the checkbox beside javax.resource.cci.ConnectionFactory and click Next

5. Provide a JNDI name (this JNDI is typically used by SOA/OSB code)


6. Click on Finish

7. Expand javax.resource.cci.ConnectionFactory

8. Locate and click on your JNDI that was just created (e.g., eis/DB/DataWarehouse)

9. On the "Outbound Connection Properties" page, enter the data source JNDI in the dataSourceName field, then click Save

* Note that if you configured your data source to use an XA driver, enter the JNDI name beside the xADataSourceName column instead.
10. You will now see this message:


11. On the navigation bar on the left, click on Deployments again

12. Scroll down and check the checkbox beside DbAdapter

13. Scroll back up and click on Update

14. Click Finish

15. Activate your changes


Summary

Here are a few takeaways to keep in mind:
  • The JNDI you define when creating the data source is typically used by Java applications
  • The JNDI you define when creating the DbAdapter is typically used by SOA/OSB applications
  • When creating a data source, choose "Generic Data Source" even if your database is an Oracle RAC or Microsoft SQL Server database (the "Multi Data Source" is used best for failover purposes)
  • When choosing the database driver for your data source, you must decide whether you want XA or non-XA drivers. This has design and coding implications
  • When configuring the DbAdapter, enter the JNDI of your data source in either the xADataSourceName or dataSourceName fields depending on how you created it
  • Don't forget to update the configuration plan when done!


Application versions:
  • Oracle WebLogic Server 11g (10.3+)

Sunday, February 24, 2013

Importing artifacts to the MDS with ant

This blog post is a snippet of my recently published book, Oracle SOA Suite 11g Administrator's Handbook, currently available on Packt Publishing and Amazon. The Kindle and eBook versions are low cost, so it may be something you may want to consider purchasing if you find this blog post useful. There are administration topics that benefit the junior, mid-level, and senior administrators. Myself and my co-author have really dumped everything we know into this, so we hope it will benefit you.
________________________________________________________________________________

Since MDS artifacts and contents are exported as a JAR file, it makes sense for it to be imported in the same manner.

For example, you may have the following files that you just updated on your local file system and wish to import them to the MDS. This may include fault policies, DVMs, and schemas located in the following local directory structure:
/tmp/svn/SOAMetaData/faultPolicies/fault-bindings.xml 
/tmp/svn/SOAMetaData/faultPolicies/fault-policies.xml
/tmp/svn/SOAMetaData/dvm/CurrencyCode.dvm 
/tmp/svn/SOAMetaData/xsd/ErrorHandling/errorEvent.xsd
Firstly, you should zip up the contents of the ~/SOAMetaData subfolder generating a single SOAMetaData.jar file:
cd /tmp/svn 
zip -r SOAMetaData.jar SOAMetaData
The JAR file is now ready to be imported to the MDS to maintain the same directory structure inside the MDS:
ant -f ant-sca-deploy.xml deploy -Dwl_home=/u01/app/middleware/wlserver_10.3 -Doracle.home=$ORACLE_HOME -DserverURL=$SOAURL/soa-infra/deployer -Duser=$USERNAME -Dpassword=$PASSWORD -Doverwrite=true -DforceDefault=true -DsarLocation=SOAMetaData.jar
Don't forget to set your environment! Details in the book!


Application versions:
  • Oracle SOA Suite 11g (11.1.1.3+)

References:

Saturday, February 23, 2013

Handy File and FTP Properties

As of late I have encountered many processes that need to poll for a file. As a result I spent some time delving more into the properties available on the File/FTP adapter. What I have found isn't miraculous by any means, but there are definite uses that can arise from some of the properties. Below I have outlined a few properties that I found useful and what I used them for.

LogicalArchiveDirectory/PhysicalArchiveDirectory
One of the integration that was being developed required a scheduled process to drop a file into a directory. The integration being developed would then pick up this file and process the contents. However once the process was complete there was no file left over. For peace of mind the file is preserved, so that even if the logs and database are purged a record is still kept until the file is no longer deemed necessary.

LogicalErrorArchiveDirectory/PhysicalErrorArchiveDirectory
This option was used for much the same reason as the previous one, but in the case that an error occurred while reading the file in. If the file produced had some sort of issue then it needs to be known to fix it.

MaxRaiseSize
The property limits how many processes can run at the same time while polling the target directory. This affords the protection from using all available threads should the process responsible for placing the file go rogue. I am not a promoter of defensive programming, but in certain cases it may be deemed a necessity.

MinimumAge
This property requires that a file be of at least a certain age. This is useful to prevent a partially created file from being consumed; being particularly useful when a larger file is being written to the file system.

For these and many more properties check out the links below.


References
http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_propertys.htm#CHDEDJEA
http://docs.oracle.com/cd/E23549_01/doc.1111/e15731/adapter_tech.htm#CEGDGIDF

Thursday, February 14, 2013

ORA-12899: Column too large or ESB_ACTIVITY table

Problem:

In Oracle SOA Suite 10g, the ESBDT logs located under $ORACLE_HOME/soa_as_1/j2ee/oc4j_esbdt/log/oc4j_esbdt_esbdt_group_1_1/oc4j/log.xml threw the following error:
Caused by: java.sql.SQLException: ORA-12899: value too large for column "ORAESB"."ESB_ACTIVITY"."BPEL2ESBCONVID" (actual: 101,maximum: 100)
It turns out that the ESB_ACTIVITY.BPEL2ESBCONVID column is defined as VARCHAR2(100) and was set using the upgrade script $ORACLE_HOME/soa_as_1/integration/esb/sql/oracle/upgrade_10135_10135mlr_oracle.sql.

Here is an example of data populated in the conversation ID (BPEL2ESBCONVID) column:
bpel://localhost/oaebs/FinanceDepartmentUSA_UpdateGLBalanceInterface~1.0/430060171-BpInv3-BpTry2.9-1
As you can see, this column is 101 characters in length, hence violating the table definition.


Solution:

1. Log in to the database as the ORAESB user.

2. Execute the following command to increase the column length:
ALTER TABLE esb_activity MODIFY (bpel2esbconvid varchar2(200));

Application versions:
  • Oracle SOA Suite 10g

References:
  • Oracle Note ID 1343103.1