Friday 25 May 2012

Variable transformation



Problem: When you try to perform a transformation between two variables that are declared like simpleType the you will receive a message:

"Enable to get schema information for source"

Solution: Define an element of the type that you want on the XSD and then declare the variable of that defined type. i.e:

On XSD add these elements:

        <element name="var1" type="string"/>
        <element name="var2" type="string"/>

Create the variables with correspondent Element Type..

try to do the transformation and should work.

Friday 4 May 2012

Webcenter automated deployment using ant

Problem
Webcenter automated deployment is not compatible yet with ojdeploy.

So it will be necessary to use WLST deploy. For that we can use an ant script to call a wlst script file (py) to prepare the mds application
(http://download.oracle.com/docs/cd/E17904_01/webcenter.1111/e12405/wcadm_deploy.htm#BABCCBEB)

Solution

1. Create a deploy.py file as below:


adminUser=sys.argv[6]
adminPassword=sys.argv[7]
adminUrl=sys.argv[8]
connect(adminUser,adminPassword,adminUrl)
domainRuntime()


def deployAll():
     print 'TESTING!'
     archive = getMDSArchiveConfig(='C:/wcportal-1.0.ear')
     archive.setAppMetadataRepository(repository=sys.argv[2],partition=sys.argv[3],type=sys.argv[4],
     jndi=sys.argv[5])
    archive.save()


# Deploy script init
     try:
     deployAll()


except:
    print "Unexpected error: ", sys.exc_info()[0]
    dumpStack()
    raise


2. Change the build.xml file as below:


<target name="deploy" description="deploy" >
<exec executable="${ofm.home}/oracle_common/common/bin/wlst.sh" spawn="false" failonerror="true">
<arg value="/refresh/oracle/testcases/ant_test/deploy.py"/>
<arg value="${earlocation}"/>
<arg value="${wc.mds.repository}"/>
<arg value="${project.build.finalName}"/>
<arg value="${wc.mds.repository.type}"/>
<arg value="${wc.mds.repository.jndi}"/>
<arg value="${wls.username}"/>
<arg value="${wls.password}"/>
<arg value="${wls.server}"/>
</exec>
</target>

Thursday 3 May 2012

Setting up Active Directory Lightweight Directory Service as a Weblogic Authentication Provider


One more fantastic white-papper, now about how to configure BPM to use multiple identity providers. The BPM's libOVD its used as a lightweight directory service.


https://blogs.oracle.com/bpmbestpractice/entry/setting_up_active_directory_lightweight


Functional Testing and Loop Request

To archive such needs use test soapUI capabilities.

In that project there’s included a test case that can be configured to insert n users defined in a properties file.

The script will then create n user joining n to user id (i.e. j.doe23).

To be able to execute this step perform  the following steps:

1.       Edit service endpoint
2.       Expand testsuite existant inside testcase SoapUI project
3.       Expand Test Steps
4.       Double-Click CreateUserProperties
5.       Change the properties according to your needs and saves to the selected properties target file
6.       Double-clicktest-case
7.       Select Run this Test Case (Green play button on left top corner of click test-case)

NOTE: To implement WSSecurity Header on request please change CreateUserRequest test step on test-case.

Groovy code snipped to perform a loop request

// run ten random requests
log.info("In the BC2 Create User Setup Script")

def userIdInStep = testRunner.testCase.getTestStepByName( "CreateUserProperties" )
def firstName = userIdInStep.getPropertyValue( "FirstName" )
def lastName = userIdInStep.getPropertyValue( "LastName" )
def userId = userIdInStep.getPropertyValue( "userId" )
def nTests = userIdInStep.getPropertyValue( "UsersToCreate" )

log.info("Number total of tests: " + nTests)
log.info("Company Mkey: " + nTests)
log.info("Company Address MKey: " + nTests)

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)

for( i in 1..nTests.toInteger())
{
  def holder = groovyUtils.getXmlHolder( "CreateUserRequest#Request" )
  holder.setNodeValue( "//urn:userId", userId + i)
  holder.setNodeValue( "//urn:lastName", lastName + i)
  
  testRunner.runTestStepByName("CreateUserRequest")
  
  node = holder.getNodeValue("//urn:userId")
  log.info ("Created user: " + node)
  node = holder.getNodeValue("//urn:lastName")
  log.info ("Created user last name: " + node)
}

To use properties directely on request xml

...
               <urn:firstName>${Properties#FirstName}</urn:firstName>
               <urn:lastName>lastName</urn:lastName>
               <urn:language>en</urn:language>
...

Wednesday 21 March 2012

Using Ant the project doesn't compile

PROBLEM


When using ant and deploying using OjDeploy the project doesn't compile and generates an empty JAR. Even when parameter nocompile=false.

SOLUTION


In this case, setting the flag nocompile to false is not enought. It is necessary to be sure that the parameter is not on this ojdeploy target.

Thursday 15 March 2012

Error in getting XML input stream: file after adding Business Rule

PROBLEM

After adding a Business Rule with service interface I got:

Error: Error in getting XML input stream: file:/D:/PATH/ing/xsd/this.xsd:  D:/PATH/ing/xsd/this.xsd (The system cannot find the path specified) among a great quantity of exceptions on the project when compiled.


SOLUTION

Check the WSDL for the service interface. It is pointing to a wrong location /ing/

Performance and Tunning Guide for 11g

Oracle Official Guide for tunning SOA environments

http://docs.oracle.com/cd/E23943_01/core.1111/e10108.pdf

Wednesday 14 March 2012

Could not find registry for the application _JBOServiceRegistry

PROBLEM

When using  ADF-BCon your composites you have to specify the registry service used to registry the bc. So for that you have to provide on the reference the <app-name>__JBOServiceRegistry.

The application name can be found on the application deployment profile of the sdo project.

When running the composite, if you get "Could not find registry for the <aap-name>_JBOServiceRegistry"

SOLUTION

In your weblogic-application.xml of the SDO application, make sure you added the JBO listener:

<listener>
<listener-class>oracle.jbo.client.svc.ADFApplicationLifecycleListener</listener-class>
</listener>


Now you are able to register the application on JBO listener

Thursday 8 March 2012

OER Error when using Assets Editor or Import/Export external tool

PROBLEM


Accessing the assets editor or import/export client of OER it is necessary to download jnpl files to java web start initiate the necessary applications. Sometimes, the jnpl files cannot access the hosted jar files.


java.net.ConnectException: Connection refused: connect
...

at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)

or


com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://localhost:7101/oer-web/webstart/impexp/client.importtool-11.1.1.6.0.jar
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)





SOLUTION


Edit the impexp.jnlp or registrartool.jnlp download files to reference the host name instead of localhost or other non reachable host.

Oracle Enterprise Repository 11.1.6

Error after refactoring BPM project

PROBLEM
“<Feb 18, 2012 12:56:26 PM EET> <Error> <oracle.soa.services.workflow.task> <BEA-000000> <<.> Invalid task definition.
The task definition at default/This!1.0*soa_f7aa9b39-1458-41c2-9c78-8b6de5f875a6/ThisHT could not be read. The task definition is associated with workflow defa
ult/This!1.0*soa_f7aa9b39-1458-41c2-9c78-8b6de5f875a6/ThisHT.
Make sure that the task definition is available at the specified URL and that it is a valid XML document.”

SOLUTION

1.       Log to soainfra schema
2.       Check in BPM_CUBE_PROCESS for record with the PROCESSNAME equals to the process and STATUS = 1
3.       Change the status to -1 for all these records
4.       Redeploy

Best practice document

Start Small, Grow Fast

by Edwin Biemond, Ronald van Luttikhuizen, and Demed L'Her
A set of pragmatic best practices for deploying a simple and sound SOA footprint that can grow with business demand.


Wednesday 7 March 2012

Events and sdo losing transactions

PROBLEM


When triggering composites using events and on this composite there are transation management over SDO's some transactions are not commited

SOLUTION


Be sure that the events have Consistency set to one and only one and no set on Run as Publisher.


SOA Suite: 11.1.1.4

Attaching policies using the configuration plan

It is possible to attach policies to composites or components on deployment time using configuration plans.

To do that:

<service name="bpelprocess1_client_ep">
<binding type="ws">
<attribute name="port">
<replace>http://xmlns.oracle.com/Application1/TEST_XDN_CONGIFPLAN/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)</replace>
</attribute>
<wsp:PolicyReference URI="oracle/wss_username_token_service_policy"
orawsp:category="security"
orawsp:status="enabled"/>
<wsp:PolicyReference URI="oracle/log_policy"
orawsp:category="management"
orawsp:status="enabled"/>
</binding>
</service>

SOA Suite: 11.1.1.4

General Configuration Plan mixing endpoints

PROBLEM:

While using global config plan, the deployer is mixing endpoints

SOLUTION

What makes the cfg_plan act like this was this entry on the file:

<!--Template repository path references-->
<reference name="*">
<property name="........
</reference>
<!-- // -->

With this entry I was trying to attribute to all references the same configuration.

To avoid the unexpected behaviour described put all referencing of this kind after all references included on the configuration file.

Why sometimes we needed to add dehydration point after reply

Reply handling

We normally think of reply as causing the response to be sent back to the client, and if the transaction was initiated by the BPEL service engine, then it would be committed as part of the reply. In most cases, this is an accurate description of the end result, but this is not actually what happens. When a reply is reached, the response message is marked as available for returning to the requestor, but it is not returned to the requestor. Instead the BPEL engine will continue to process activities until it reaches a dehydration point. On reaching the dehydration point, the current thread (which was also the requesting thread) will return the reply message to the requestor. Note that this results in a delay in the returning of the result to the requestor, and it also causes the transaction scope to extend past the reply activity.

SOA Suite: 11.1.1.4

Tuesday 6 March 2012

XSL code erase empty nodes, trim spces and normalize strings

XSLT code snippet to trim all spaces, normalize strings and erase all empty nodes.

<xsl:template match="node()">
<xsl:if test="count(descendant::text()[string-length(normalize-space(.))>0]|@*)">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>

<xsl:template match="@*">
<xsl:copy/>
</xsl:template>

<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>

Deployment over different environments

Use ORAMDS for all XSD / WSDL files on the project (oramds:...) in all composite.xml and wrappers on location tag. Doing that you will garantee that you can deploy anywhere even when you don't have remote access to a environment. And in this way it is not necessary to change endpoints on composite.xml on compilation time (by script for instance)

then use configuration plans.

Deploying EJB using Worklist API




When deploying fro Jdev 11.1.1.4 I got the error:


[EJB:011023]An error occurred while reading the deployment descriptor. The error was:
oracle/bpel/services/workflow/task/model/Task.
[11:57:04 AM] Caused by: java.lang.NoClassDefFoundError: oracle/bpel/services/workflow/task/model/Task

Solution:

Be sure that you have a EJB JAR project deployment profile and a EAR Application Deployment Profile.

Add these library entry on weblogic-application.xml file accessible go on Application Resources view on Jdeveloper / descriptors / META-INF


<library-ref>
<library-name>adf.oracle.domain</library-name>
<implementation-version>11.1.1.1.0</implementation-version>
</library-ref>
<library-ref>
<library-name>oracle.soa.workflow</library-name>
<implementation-version>11.1.1</implementation-version>
</library-ref>



Wednesday 29 February 2012

Segmentation fault ./runInstaller $*

When deinstalling SOA Suite from Middleware I got:Segmentation fault ./runInstaller $*

The solution is to run the installer on Oracle_SOA/oui/bin with jreLoc option defined.

ex:
./runInstaller -deinstall -jreLoc /u01/app/oracle/product/Middleware/jdk1.6.0_31