Tuesday, July 14, 2015

XML-20129: (Error) Namespace prefix 'wsp' used but not declared.


I was trying to call a secured service from SOA , I added the Ws policies in Jdevloper

passed the user name and password in composite.xml and tried to compile the project and i got below error in compilation

Error(35,59): : XML-20129: (Error) Namespace prefix 'wsp' used but not declared.
Error(35,59): : XML-20129: (Error) Namespace prefix 'orawsp' used but not declared.

The reason for this error was that some how the namespace was not declared for the policies

the actual policies files were using these two namespace prefix


wsp:PolicyReference URI="oracle/wss_username_token_client_policy"
orawsp:category="security"
orawsp:status="enabled"

To resolve this issue i added the following two namespace declaration in the composite and i was able to compile and deploy the project

xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:orawsp=http://schemas.xmlsoap.org/ws/2004/09/policy





Thursday, July 09, 2015

SCA Engine deployment failure.: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException


In continuation of the previous exercise


I created a simple spring project and tried to deployed it to the integrated weblogic server and i got below error


[11:38:01 AM] Error deploying archive sca_HelloWorld_rev1.0.jar to partition "default" on server DefaultServer [http://localhost:7101]
[11:38:01 AM] HTTP error code returned [500]
[11:38:01 AM] Error message from server:
There was an error deploying the composite on DefaultServer: Error occurred during deployment of component: Spring to service engine: implementation.spring, for composite: HelloWorld: SCA Engine deployment failure.: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 6 in XML document from URL [oramds:/deployed-composites/default/HelloWorld_rev1.0/Spring/Spring.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 1523; : XML-24500: (Error) Can not build schema 'http://www.springframework.org/schema/util' located at 'http://www.springframework.org/schema/util/spring-util.xsd'.

[11:38:01 AM] Check server log for more details.
[11:38:01 AM] Error deploying archive sca_HelloWorld_rev1.0.jar to partition "default" on server DefaultServer [http://localhost:7101]
[11:38:02 AM] Deployment cancelled.
[11:38:02 AM] ---- Deployment incomplete ----.
[11:38:02 AM] Error deploying archive file:/C:/JDeveloper/mywork/OSBApplication/HelloWorld/deploy/sca_HelloWorld_rev1.0.jar
(oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)


The reason for this issue is because of xml parsing as explained in the http://stackoverflow.com/questions/5005901/duplicated-definition-for-identifiedtype

Using the information in the post i changed the following entry in my spring.xml

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://xmlns.oracle.com/weblogic/weblogic-sca META-INF/weblogic-sca.xsd"


to

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://xmlns.oracle.com/weblogic/weblogic-sca META-INF/weblogic-sca.xsd"


After this i was able to deploy my process to the integrated server.

Wednesday, July 08, 2015

Spring in SOA 12c


I was trying to find sample of Spring in SOA 12c but some how i was not able to get any sample in the intenet, so i thought of creating my own sample so that others can benefit from that.

Using spring component requires you to have some basic concepts of Java.

If you do not have basic concepts of JAVA i will recommend first get the basics of Java and try this exercise.

Create a new project in SOA 12c




Give the project a name and select SOA



Select SOA with spring as option and say finish



Name the context



Now create a new interface



Specify the name of the interface



An interface declares the method so we will just try to declare a method and later we will define it in a class



Just define a simple method



Create a new class



select the interface you have created earlier for the class





Now implement the class for the business logic you wanted to have



Now define the sca service

type should point to the Interface definition i.e package.interface name

and

class should point to the actual class who is defining the interface

it will represented as package.class name




Now drag and drop the spring content to the exposed service swim lane and select web service as option



After selecting the service you will following service design



Deploy the service to the server and test it

Sunday, July 05, 2015

Logging in BPMN 12c


This is in continuation to my previous blogs on BPMN

Part1 and Part2

In this part we will use the first exercise itself to show how logging can be implemented in BPMN process.


The transaction was rolled back.


I was tyring to insert data in to MS SQL table using Oracle SOA suite DB adpater and i got this error

The transaction was rolled back. The work performed for bpel instance "1001" was rolled back, but the audit trail has been saved for this instance.If this is a sync request, please resubmit the request from the client. If it is an async request, please recover from the recovery console by resubmitting the invoke message.

My SQL Server connection was supporting Global transaction and i was using XA data source for the same.

I was using DB adapter feature to insert the data in to the SQL table.

Ideally with oracle db xa data source works fine but surprisingly for MS SQL this didn't worked fine for me so i did the following changes


I unchecked the Support global transaction button in the datasource



Then i used this data source as a non xa datasource while creating the jndi and the process worked fine for me.


java.sql.BatchUpdateException: String or binary data would be truncated


I was trying to insert data in to MS SQL server table using db adapter in Oracle SOA Suite and my process was giving this error.


Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [MS.Errors]. Caused by java.sql.BatchUpdateException: String or binary data would be truncated.. Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-8152" 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


The reason for this error is data issue. I checked the data i was passing to insert into the MS SQL table and then i compared it with the actual XML schema that get generated by default for the db adapter and i found that one of the field was having a restiction on length as 10 digit however in my actual payload i was sending a 17 digit number.

After fixing the payload my process ran fine.