Friday, February 24, 2017

SOA12c MySQL adapter configuration platform error

Error: When you configure MySQL adapter in 12c SOA server (or in other platforms as well) you won't see any error, the Test Connection returns you success during configuration.  But when you try to use the dataSource in your BPM, BPEL or OSB projects you will see the error com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"name") VALUES ('hhh')' at line 1.
Please see the logs for the full DBAdapter logging output prior to this exception.  ConnectionFactory property platformClassName was set to org.eclipse.persistence.platform.database.oracle.Oracle10Platform but the database you are connecting to is MySQL.  Please validate your platformClassName setting.  This mismatch can cause the adapter to trigger runtime exceptions or execute SQL that is invalid for the database you are connected to.  This exception is considered not retriable, likely due to a modelling mistake.  To classify it as retriable instead add property nonRetriableErrorCodes with value "-1064" to your deployment descriptor (i.e. weblogic-ra.xml).  To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.  All properties are integers.".

Solution:  The solution is quite same even for all other platforms. In the datasource configuration properties you will give the connection pool JNDI name (say  jdbc/MYSQLCONNECTION).  In the same properties there is one more property  PlatformClassName.  Change its default value org.eclipse.persistence.platform.database.oracle.Oracle10Platform   to org.eclipse.persistence.platform.database.MySQLPlatform .  For more clarity see below image.

Note: Most of the time if you are configuring to a database connection other than Oracle then make sure you also have a look on this property, and set it with right platform names.

List of the platformClassName used for different database:-

Oracle10+ (including 11g)

org.eclipse.persistence.platform.database.Oracle10PlatformOracle9+ (optional)

org.eclipse.persistence.platform.database.Oracle9Platform

Oracle8
org.eclipse.persistence.platform.database.Oracle8Platform

Oracle7
org.eclipse.persistence.platform.database.OraclePlatform

DB2
org.eclipse.persistence.platform.database.DB2Platform

DB2 on AS400e
oracle.tip.adapter.db.toplinkext.DB2AS400Platform

Informix
org.eclipse.persistence.platform.database.InformixPlatform

SQLServer 
org.eclipse.persistence.platform.database.SQLServerPlatform

MySQL
org.eclipse.persistence.platform.database.MySQLPlatform

Any other database
org.eclipse.persistence.platform.database.DatabasePlatform



ENJOY LEARNING NEW THINGS..... MAN LIFELONG IS A STUDENT.


Monday, February 20, 2017

XSD not referring from WSDL in Local File MDS configured in JDeveloper11g

Error: Most of the time, we create our WSDL and refer the XSD from that WSDL.  However we see that the Element structure won't show in in the JDeveloper in the design time. as shown in the below picture.

Solution:  when you look at the WSDL and XSD every thing looks good wherne you can't traceout the error.  But there is a chance that in the XSD, very first line is an empty line and in the second line in your XSD might be present a XML header  as      xml version='1.0' encoding='UTF-8'?> 
Any XML file the should have the this line as th fist line and fist char onwards.  No spaces is allowed.  So take out if there are any errors.

Now you should be able to see the element structure presenting in your assign activity when you expand the element as shwon eblow.



Similarly, if there is a space in the WSDL file then you might see the below error while you are trying to load the WSDL into your project as a pertner reference.  Error is   ( oracle.j2ee.ws.wsdl.LocalizedWSDLException: WSDLException: faultCode=INVALID_WSDL: Invalid XML in document at: oramds:/apps/AsyncErrorHandlerBPEL/AsyncErrorHandlerBPEL.wsdl, line: 2, column: 6: oracle.xml.parser.v2.XMLParseException: PI with the name 'xml' can occur only in the beginning of the document.  )

So the a solution could be checking and taking out if there ane any empty lines before the first XML header line present in the WSDL's  XML  header section.



Friday, February 10, 2017

Exception - Problem building schema in the BPEL assign activity in JDeveloper 11g during design time

Error:  Assume you have a BPEL project in SOA 11g which has multiple external WSDLs and adapter connections.  Let us say you have created a DB adapter connection for a SELECT operation from a database table then Schema, wsdl generated properly.  But you may see the Exception - Problem building Schema in the assign activity as shwon in the below image.


Solution:  In most of the cases the namespace is not properly placed.  Bus sometimes even the namespaces and all other references related DB adapter looks fine, but still we see the error. The reason behind this error is JDeveloper is not able to reach the schema building due to some other unexpected errors.  So the JDeveloper is not able to form the proper Element structure of the complex messages/elements.

If you have changed any WSDL URLs in the composite.xml  (specially host names to point to a new systems which is active while you are working) then make sure that the host also changed in the corresponding .componentType  file.  If this is not changed then the WSDL partnerlink not able to reach the target schema details, so it will fail to build all the other complex elements as well.

So to fix this, make sure that all the endponts are reachable while compiling/building the BPEL processes.



Wednesday, May 18, 2016

SOA DBAdapter error Cannot call Connection.commit in distributed transaction

Error message could look like
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'EbsCreateAccountProcedureDb' failed due to: DBWriteInteractionSpec Execute Failed Exception.
unknown failed. Descriptor name: [unknown].
Caused by java.sql.SQLException: Cannot call Connection.commit in distributed transaction.  Transaction Manager will commit the resource manager when the distributed transaction is committed..
Please see the logs for the full DBAdapter logging output prior to this exception.  This exception is considered retriable, likely due to a communication failure.  To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your deployment descriptor (i.e. weblogic-ra.xml).  To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff.  All properties are integers.
".
The invoked JCA adapter raised a resource exception.

Please examine the above error message carefully to determine a resolution.

The Solution could be, your Datasource might have been configured to support global transactions.  Uncheck the "Support Global Transactions" check box in your data source connection pool.

Note: After doing the modification, server need to be bounced.

Wednesday, May 11, 2016

ORA-01861: literal does not match format string (SOA Date time formatting error)

Error:
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'ReadQuotesFromStagingDbSelect' failed due to: DBReadInteractionSpec Execute Failed Exception. Query name: [ReadQuotesFromStagingDbSelect], Descriptor name: [ReadQuotesFromStagingDb.XxlscQuoteIntHeaderTbl]. Caused by java.sql.SQLDataException: ORA-01861: literal does not match format string . See root exception for the specific exception. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-1861" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.

Use Case:
If we want to get the latest records that are updated recently, we use the condition that the LASTUPDATED_DATE greater than or equal to the input date time parameter say afterDate.

Now the afterDate field is added as the input parameter to the DB adapter call, and the afterDate is always a String.  

If we are not passing the input date time in the default format (say DD-MON-YYYY), then we get the above mentioned biding error of ORA-01861: literal does not match format string

Solution:  The solution is to send the input dateTime in a proper format and then use the same format in the DB Adapter Query.  Means converting string to oracle date format.

1. Take a  dateTime type field as input parameter in the BPEL process.

2. Use the format  "[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]"  in the XSLT  and convert to a      formatted string.    
Ex:     

3. User the TO_DATE function in the query that is called from the DBAdapter and user the format  string as   'YYYY-MM-DD"T"HH24:MI:SS'

                                Ex:   TO_DATE('2011-07-28T23:54:14', 'YYYY-MM-DD"T"HH24:MI:SS')


Wednesday, April 13, 2016

ORABPEL-05250 Error - Few possible solutions

If you see the below error while deploying the SOA composite into the SOA11g server

Deploying on partition "default" of "/Farm_soa_prod/soa_prod/soa_server1" ...
Deploying on "/Farm_soa_prod/soa_prod/soa_server1" failed!
There was an error deploying the composite on soa_server1: Deployment Failed: Error occurred during deployment of component: GTM_CLM_Process_ScreeningResults to service engine: implementation.bpel for composite: GTM_CLM_Process_ScreeningResults: ORABPEL-05250

Error deploying BPEL suitcase.
error while attempting to deploy the BPEL component file "/netapp01/fmwprodbin/Oracle/Middleware/user_projects/domains/soa_prod/servers/soa_server1/dc/soa_dbc0254e-8aa1-4d20-9cef-457b9f5fa15c"; the exception reported is: java.lang.Exception: BPEL 1.1 compilation failed

This error contained an exception thrown by the underlying deployment module.
Verify the exception trace in the log (with logging level set to debug mode).

There might be few reasons, but look at the last changes you made and try to think.

Here are few what we have faced and found the resolutions. It may help you as well.

Resolution1:  This issue is coming while using the cloud service.  Need to find solution.   The reason is, one of the custom field is not available in the targeted (here OSC service for us) web service WSDL, so while compiling with configuration file it used to fail.


Resolution2:  Using Java Embedded Activity is causing the error with java classed used.  For example the Class name using directly as  InetAddress   without using the package name.  So the solution was to use the complete package name as  java.net.InetAddress;

Friday, April 1, 2016

How to get SOA host server DVM file path to refer dynamically from that SOA server MDS

When we develop a BPEL process, most of the time it will connect different external (target) systems.  Some times we need to use the DVMs for getting the values dynamically.  So we create a DVM in the SOA server and load the DVM values file into the MDS database.  Now the BPEL process has to use the SOA host dynamically to identify the DVM file path from the MDS.

So to identify the SOA server host name dynamically we can follow the below steps.


1. Create a DVM  TestDVM.dvm with two columns, OrganizationId, OrganizationIdValue.

TestDVM.dvm
=============
OrganizationId    |    OrganizationIdValue
---------------------------------------------------
host1                              abc123
host2                              def234

2. Create a string variable HostName in BPEL process
3. Inside the BPEL process use a Java Embedding activity and write the below code init.

                   String HostName = null;  
                    try{                                                                        
                          InetAddress addr = InetAddress.getLocalHost();  
                          HostName = addr.getHostName();  
                          addAuditTrailEntry("Host name is " + HostName);  
                          setVariableData("HostName",HostName);  
                    } catch (Exception ex) {                                                                  
                          ex.printStackTrace();  
                        addAuditTrailEntry(ex.getMessage());  
                    }

Now the value is available in the BPEL string variable.

4. If we need to use this value in the XSL files then pass the BPEL variable as input element to the XSL file.

Inside the XSL file use the DVM function to get the value.
dvm:lookupValue("TestDVM.dvm","OrganizationId",$HostName,"OrganizationIdValue",$HostName).