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.