Wednesday, October 21, 2015

OSB 11g and DB adapter



Update 9.8.2010: Just uploaded a video showing how the use case described in this blog has been developed.
Update 15.8.2010: Part II: Using an Inbound Database Adapter has been published today.
The JCA adapter framework we know from SOA Suite is supported by the Oracle Service Bus (OSB) since 10.3.1. The Database Adapter fills one gap of the Oracle Service Bus: there is no OSB transport for accessing a database and accessing the database was previously only possible from an XPath function in read-only mode.
Many blog articles have already been published about using the JCA adapters with Oracle Service Bus. There are two good blog articles from Edwin Biemond and from James Taylor about how to use the Database Adapter with Oracle 10g and 11g. Additionally the Oracle Service Bus Samples page holds a viewlet that demonstrates the usage of the DB adapter with 10.3.1. So why another blog article?
First the Database Adapter is a feature, which deserves many blog articles and second when I went through the samples mentioned above, I’ve found a way to better integrate the definition of the JCA adapter with the OSB proxy service and business service development, which makes the handling much easier.
One of the difficulties when using the JCA adapter framework with the OSB is the two different IDE’s being necessary. The adapter wizards are only available in JDeveloper and therefore for the definition of the adapters JDeveloper needs to be used. After that only the artifacts generated by the adapter wizard (WSDL, XSD, JCA config, toplink mappings, ..) are necessary.
The approaches described by the sources mentioned above show how to create a JDeveloper project first, create the adapters and then copy the necessary files into the OSB projects. What I don’t like about that is the copying of the resources. Of course this can be automated, but when you have to go back an forth between the adapters and the OSB project during development, because you need to change the settings of the adapters multiple times, its just a matter of time until you for once work with an non-actualized version of some files. So how can we avoid that?
Of course we can not change the fact that we have to work with Eclipse and JDeveloper in parallel, until Oracle has moved the whole OSB development environment to JDeveloper, probably with 11R2.
The approach I present here is actually quite simple. Instead of having to separate projects, I just create the JDeveloper project embedded inside the OSB project in a special folder (adapter) as shown in the image below.
000_nesting_of_projects
By that, all the adapter for one OSB project can be placed in one single JDeveloper SOA project and by that all the generated artifacts are always local to the OSB project. This way they can be used to generate a proxy or a business service directly.
If an adapter needs to be changed, then a refresh on the adapter folder is good enough to pick up the new version of the adapter files. No more copying of files between the two projects is necessary!
Some of the older sample available on the Web show how to use the OSB console to import the artifacts generated by the adapter. This is also no longer necessary! Everything can be done directly in Eclipse in 11g.

Use Case

The use case I will demonstrate is rather simple. The idea is to make the data of 3 tables in an Oracle DB accessible as a web service in a contract-first approach.
I will use the Database Adapter to access the data, wrap it by a business service and use a proxy service with two XQuery transformation to publish it as a SOAP WebService with its own WSDL and XSD. By that the data is immediately available to any SOAP WebService consumer. I will use SoapUI to demonstrate that.
The scenario is shown in the image below. I’m using the notation from our Integration Blueprint book.

000_use-case

Prerequisites

In order to follow the tutorial below, the following software has to be available:
  • JDeveloper 11g with SOA extension
  • Eclipse 3.5.2 with Oracle Enterprise Pack for Eclipse (OEPE) 11.1.1.5.0
  • Oracle Service Bus 11.1.1.3
  • Oracle Database (XE is good enough)
On the Oracle Database you have to install the SOA_SAMPLE schema available in download here. Just execute the cr_obj.sql located inside the database folder.
The Web Service interface (WSDL and XSD) to be published by the proxy service are available in the misc folder in the download. If you follow the tutorial then it’s assumed that this two files are available in c:\temp.

Project setup

Let’s first create the Oracle Service Bus project and inside in the adapter folder the nested JDeveloper SOA project
  1. First create a new Oracle Service Bus Project and create a folder structure for the different artifacts created later.001_initial-osb-project-with-folder
  2. The adapter folder is the place where we will embed the JDeveloper project. Check and copy the name of the folder to be used when creating the JDeveloper SOA project.
    005_adapter-folder-to-create-jdev-in
  3. Now let’s switch to JDeveloper for a while and create the new SOA Project (inside the adapter folder of the OSB project), which will define and hold the adapter artifacts.
    010_create-jdev-soa-project-in-osb-project 
  4. Choose Empty Composite for the Project template. We will only use the SCA composite to place a Database Adapter and we won’t use any of the components like BPEL or Mediator.
    015_create-empty-composite
  5. The empty composite window shows up. You can think of the Components section as the place where your OSB proxy and business services are located, although that’s not true before probably 11gR2. Using that mnemonic trick you can place the adapters in the same way as you are used from SOA Suite. Inbound adapters (file polling, database polling, de-queuing) should be placed on the Exposed Services swimmlane and outbound adapters (file write, database read/write, enqueueing, …) should be placed on the External References swimmlane.
    020_composite-overview 
All the JCA adapters used by one OSB project can be defined in the same SOA project.

Create the Database Adapter

With the project setup in place, let’s now configure the Database Adapter by going through the adapter wizard.
  1. We will need an outbound Database Adapter, so we drag it to the right hand side swimmlane.

    025_drag-database-adapter-to-external-references
     
  2. Give the adapter service a meaningful name
    030_db-adapter-wizard-step2-4
  3. Create a connection to be used only at development time during the wizard and specify a JNDI Name to be used to retrieve the database connection factory at runtime. The Connection Factory object need to be setup on WebLogic before deploying the OSB project.
    032_db-adapter-wizard-step2-3
  4. For the Operation we choose Select, we only want to read from the database.
    034_db-adapter-wizard-step4-5
  5. In the next step the tables to SELECT from are specified. We want to read from PERSON_T, ADDRESS_T and COUNTRY_T all together; the PERSON_T should be the root table to start the query from.
    036_db-adapter-wizard-step5-10
  6. The next step allows for creating the necessary relationships between the tables. PERSON_T has a 1:m relationship to ADDRESS_T which has a 1.1 relationship to COUNTRY_T
    038_db-adapter-wizard-step6-10
  7. In the Attribute Filtering step all the attributes returned from the tables are shown and you can uncheck the attributes you don’t want the service to return. Here we specify that we don’t want to return the ISO Country number. You can also see that the hierarchical structure resembles the relationships defined above.
    040_db-adapter-wizard-step7-10
  8. In the next step we define the restriction to be applied by the service. By default all the rows in PERSON_T would be returned. Our service should only return a given person defined by it’s primary key. So we define a personId parameter and add it in a WHERE clause.
    042_db-adapter-wizard-step8-10
  9. By that the adapter is defined an we can click finish on the next page. The adapter wizard now generates the necessary artifacts like WSDL, XSD, JCA configuration and toplink mapping files.
    045_composite-with-adpter
This finishes the work in JDeveloper. Let’s switch back to Eclipse and the OSB project created before.

Create the Business Service

In order to use the Database Adapter from OSB, we either need a business or proxy services configured to use JCA transport. For outbound adapters, a business service is necessary, whereas for inbound adapters, a proxy service is used.
  1. First let’s make the artifacts from the JDeveloper project visible in the OSB project by doing a refresh on the adapter folder. We can see the structure of our SOA project nested in the OSB project.
    050_refresh-project-in-osb-project            055_osb-project-after-refresh
  2. Now let’s create the business service, which will wrap our outbound Database Adapter defined above. We can do that directly in Eclipse, there is no longer a need to use the OSB console for that. Just right-click on the jca configuration file (RetrievePersonService_db.jdca), select Oracle Service Bus | Generate Service and specify the name and the folder where the business service and the WSDL should be created (folder business-service).060_generate-business-service      062_generate-business-service
  3. The transport configuration is automatically done for us, nothing needs to be done here:065_busienss-service-with-jca-transport
By that the business service is created and ready to be used. It could already be tested from the OSB console, but we want the service to be reachable from outside via a SOAP Web Service. So let’s create the proxy services doing exactly that.

Create the Proxy Service

When creating the proxy service it’s good to first think about the service interface it should provide. A SOAP based WebService interface is what we want, but what format do we use? Can’t we just use the WSDL generated by the Database Adapter also for the proxy service? It’s so easy, isn’t it?
It would be possible, but by that, we would expose information from the database to the outside and by that create a much stronger coupling between the service consumer and the database than necessary. We would use a contract-last approach, where the contract is just generated based on some artifacts already available! A change on the database (table name, column name, data type) would almost for sure have an impact on the interface, something we definitely want to avoid when using the service in a larger context in a Service-Oriented Architecture (SOA).
What we want to use is a contract-first approach, where we can independently define the service contract first. Fortunately that’s well supported by OSB and easily achieved by defining a new WSDL, using it when defining the proxy service and creating two transformation operation to translate to/from the new format.
The WSDL and XSD forming the service contract PersonService is available in the download. It uses a canonical format of a person and its addresses which is somehow different to the format used on the database and independent of any backend service.
  1. First import the WSDL and XSD files into the wsdl folder of the OSB project
    067-copy-wsdl-and-xsd-into-osb-project
  2. Now let’s create the proxy service 
     070_create-proxy-service
  3. Select the WSDL PersonService-1.0.wsdl for the interface of the proxy service
    075_create-wsdl-based-proxy-service
  4. Add a Route Node with a Routing action to the empty message flow of the proxy service
    077_create-route-node 
  5. Select the business service just created as the service to call by the route action
    080_select-service-for-proxy

Create the two transformations

For the transformation of the request and of the response we need one XQuery transformation each.
  1. First we create the XQuery transformation for the request, which is very easy, all we need to map is the personId query parameter. With the graphical mapper feature provided by the OSB Eclipse plugin it’s even easier!
    090-data-transformation-request
  2. Next we create the XQuery transformation of the response. This is a bit harder, as more items need to be mapped, but with the build in graphical mapper it’s again not a lot of work!
    092-data-transformation-response

Add transformation to the message flow of the proxy service

Now the only thing left to do is inserting the two transformations into the message flow.
  1. First we use the request transformation in the Request Action of the Routing action. By using a Replace action the already existing body with the <soap-env:Body> tag is reused and only the content is replaced by the result of the XQuery.
    095_use-request-data-transformation-with-replace
  2. The response is handled similar to the request by another Replace action
    100_use-response-data-transformation-with-replace
  3. In the parameter binding to the XQuery we manually have to specify the PersonTCollection element which holds the response from the DB adapter.
    101_select-xquery-for-response
  4. Additionally we also have to add a user-defined namespace
    102_custom-namespace

Create DataSource and Connection Factory in WebLogic

Before we can deploy and use the OSB service we need to create the necessary objects in WebLogic.
  1. First we create the DataSource object with the JNDI alias jdbc/SoaSampleDataSource109_data-source
  2. Create the DB Adapter Connection Factory object 110_create-connection-factory
  3. and configure the DataSource jdbc/soaSampleDataSource created above
    112_define-data-source-in-connection-factory
Don’t forget to update the DB Adapter in order to activate the configuration changes.
Now it’s time to deploy and test the OSB service.

Deployment and Testing with soapUI

Deploy the OSB service to the OSB server and then start soapUI.
  1. Create a new soapUI project and specify the WSDL the proxy service on the OSB exposes. On my machine this is  http://localhost:7001/DbAdapterOSBProject/PersonService?wsdl.
    120_create-soap-ui-project
  2. Now let’s use the generated request and send a message with personId = 1.
    125_test-request-with-soapui
  3. We should get a successful response like the one shown in the image below. This is the information from the database in the canonical format.127_test-request-with-soapui-2

Conclusion

This finishes the tutorial of using the Database Adapter with the Oracle Service Bus.
I hope I was able to show how easy it is to integrate the JCA adapter framework with Oracle Service Bus 11g. Although there are two IDE’s involved, the strategy of embedding the JDeveloper SOA project inside the OSB project helps in keeping the OSB project in sync with the SOA project. By that it’s much easier to maintain the adapter, just change the settings by restarting the adapter wizard and after refreshing the OSB project everything is in sync.
In a next blog article I will show how to use the Database Adapter in an inbound scenario, where the adapter will trigger an OSB proxy service whenever a new row is added to the database.
The source code with the implementation of this use case can downloaded from here.




  1. OSB Learner
    August 12, 2010 at 04:18


    Hi,
    I am a learner of OSB. I read many blog articles on that topic but all seems to be for more expert person. But here all the things are described in a very good way and obviously the video helped me a lot.
    Thanks for the great post. BTW, when the DB Adapter for inbound scenario will be posted (as u mentioned on the conclusion of this post).
    Thanks again.


  2. gschmutz
    August 13, 2010 at 14:02


    Thanks for your feedback, good to hear that the video helped!
    I should have the next post with the DB adapter for inbound ready by this weekend! The video and screenshots are done, just the text needs to be written!
    So stay tuned!

  3. August 22, 2010 at 12:18


    I enjoy read this post, good resources.thx


  4. Chris Judson
    August 25, 2010 at 05:52


    Hey Guido,
    This is a great blog post!! Well done
    Chris


    • gschmutz
      August 27, 2010 at 20:39


      Hey Chris, thanks for your feedback. See you soon at OOW!


  5. G.
    September 15, 2010 at 20:14


    Great post, and the video is a lot of help. Thanks.
    I ran into an issue however. I got to step 3 of ‘Create the Business Service’ and ‘jca’ was not selected as the protocol on the Transport Configuration tab of the business service. I clicked the drop-down field and found that ‘jca’ wasn’t even an option.
    Any ideas?


  6. Roshan
    October 26, 2010 at 18:33


    Hi Guido,
    I learned alot from this blog and video. I am a learner in oracle soa suite.
    I am looking more on db adapter with different database integration.
    Thanks alot for your blog.
    Roshan


  7. Martin Carpio
    November 15, 2010 at 02:32


    Hi,
    This is a great post and very helpful! .. thank you very much.
    Just One question, I am new in all these OSB things, and I would like to know, what do you recommend to create The WSDL and XSD forming the service contract PersonService (For this example)
    Thank you in advance for your help


  8. Sakari Isoniemi
    December 12, 2010 at 10:37


    Hello
    The generate Business Service in Workbench doesn’t show
    protocol JCA in Transport Configuration page.
    Allowed values are http (default),dsp,sp,soa.direct,ws.


    • gschmutz
      January 4, 2011 at 10:27


      Strange …. are you shure that you have the latest OSB Eclipse plugin installed?


  9. vinay
    January 4, 2011 at 09:54


    In the previous tutorial you said
    Just right-click on the jca configuration file (RetrievePersonService_db.jdca), select Oracle Service Bus | Generate Service
    When I am trying to do the above step the Generate service is disabled and also retrievepersonservice_db.jdba is having a cross mark. unable to generate service
    Thanks,
    Vinay


  10. Bruce
    January 28, 2011 at 06:52


    Hi,
    I did an example following the steps of your article.
    But encountered an error as follow:
    BEA-380001: Invoke JCA outbound service failed with application error, exception:
    com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/DBAdapterTest/DBReader [ DBReader_ptt::DBReaderSelect(DBReaderSelect_inputParameters,PersonTCollection) ] – WSIF JCA Execute of operation ‘DBReaderSelect’ failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SOADataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SOADataSource’. Resolved ‘jdbc’; remaining name ‘SOADataSource’.
    ; nested exception is:
    BINDING.JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SOADataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SOADataSource’. Resolved ‘jdbc’; remaining name ‘SOADataSource’.
    You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
    ——————————————————————————————————–
    The JNDI seems good, I developed a simple project which will get data from a table in the data source in JDeveloper then I deployed the project in Weblogic server. And I tested, it returns the expected results.
    When I click ‘view JNDI tree’, I can see the data srouce is registered.
    Binding Name: jdbc.SOADataSource
    Class: weblogic.jdbc.common.internal.RmiDataSource_1033_WLStub
    Hash Code: 92966755
    toString Results: ClusterableRemoteRef(8348400613458600489S:10.2.1.143:[8001,8001,-1,-1,-1,-1,-1]:base_domain:soa_server1 [8348400613458600489S:10.2.1.143:[8001,8001,-1,-1,-1,-1,-1]:base_domain:soa_server1/285])/285
    ——————————————————————————————————-
    I am using:
    JDeveloper version: 11.1.1.3.0
    WebLogic server version: 10.3.3.0
    OSB version: 11.1.1.3.0
    Would you please give me some suggestion about how to fix this error?
    Thanks and Regards!
    Bruce


  11. Bruce
    January 31, 2011 at 12:39


    Hi Guido,
    Thank you for your suggestion.
    It solves my problem.


  12. Sylvester Creado
    January 31, 2011 at 21:27


    Hi Guido,
    Thanks for the clear and concise directions for this example. I am getting a wierd error
    “Conflicts found during publish.
    [JCATransport:381987]An error occured while validating JCA transport endpoint. JNDI lookup with URL: jca://eis/DB/SoaSampleConnection failed. Missing JNDI configuration such as undeployed or misconfigured JCA Adapter RAR or connection factory.”
    Can you help?
    Thanks and Regards,
    Sylvester


  13. Gupta Bros
    February 3, 2011 at 10:47


    Dear Guido,
    Help reqd on related issue of DB Adapter. Any help/pointer would be highly appreciated. Thanks.
    I have got one DB Adapter, which is polling the database for changes. I added one Parameter and wanted to pass/set the parameter at the start/new instance of BEPL process. I am using Jdeveloper and not getting option any where to pass the internal variable to this newly added parameter. DBAdapter.wsdl is not showing this parameter as input but DBAdapter-or-mapping.xml shows this parameter in content. Am i doing something wrong ? Do i have to re-configure the adapter from scratch ?


  14. abs
    February 4, 2011 at 13:57


    Hello Guido,
    I am a learner of OSB. This article has been a real help as all the things are described in a very good way and obviously the video helped me a lot. Just one request can u please share the code for the WSDl and XSD the ones used to generate the proxy service, reason being im interested in the way it is generatead as it is in the canonical format.
    Thanks in advance


  15. A.N.
    February 16, 2011 at 02:52


    Hi,
    You can’t imagine how much time is saved going through this article in order to implement my solution, rather than doing it on my own.
    Thanks heaps!


  16. Yiftah
    April 13, 2011 at 08:35


    hi
    very good post. great idea on how to merge eclipse and jdev files.
    We are currently making our first steps with OSB11g and JCA DB Adapter.
    we have noticed that packages were created in the DB with functions named SQL_TO_PL0 and PL_TO_SQL0
    are these created by the DB Adapter? what are they used for?
    thanks,
    Yiftah


  17. Denilson
    June 14, 2011 at 00:57


    Hi dear,
    I have one question. If my application that are pooling the database is unavailabe and new records are inserted into the database or updated? what happens with these recoreds?
    As soon as I start my application with the adapter, these new record will be triggered atomatically? Or I lost these new records?
    I wanto use this technique to equalize two database.


    • gschmutz
      February 13, 2012 at 20:25


      By “my application” do you mean the OSB doing the pooling through the JCA adapter? If yes, then the records are not lost, if you for example use a timestamp or flag strategy on the adapter. In that case, the JCA adapter will just pick up all the new records the next time he (the OSB service) is up and running and flag them as “done” after it has processed them.


  18. Hernan
    June 17, 2011 at 14:42


    Hi, thanks for your post.
    Iam trying to follow the steps. Iam using Eclipse (ver 3.5.2). When I’m generating the JCA business service, the IDE doesn’t let me choose the JCA transport protocol. I tried to import the plugins that contain the JCA protocol, but with any sucessfull result.
    Do you have any idea of the step Iam missing? thanks…


  19. Jimmy
    October 1, 2011 at 05:06


    Hi Guido, nice article.I’m beginner of OSB,I tried with sample project but I’m getting error’s like JCA adapter outbound error.
    For person service (proxy service),I create XSD and based on the Schema I create WSDL.one request can u please share the code for the WSDl and XSD the ones used to generate the proxy service.And also I’m not getting the WSDL of the proxy for testing.
    jimmy


  20. dumbu
    October 3, 2011 at 14:18


    Hi Guido,Good article,I’m also tried but I’m getting the error.can you plz me help me it’svery urgent.The error is.
    BEA-380001: Invoke JCA outbound service failed with application error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/DbAdapterOSBProject/adapters/AdapterJdevProject/RetrivePatientDetails [ RetrivePatientDetails_ptt::RetrivePatientDetails(InputParameters,OutputParameters) ] – WSIF JCA Execute of operation ‘RetrivePatientDetails’ failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    ; nested exception is:
    BINDING.JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
    com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/DbAdapterOSBProject/adapters/AdapterJdevProject/RetrivePatientDetails [ RetrivePatientDetails_ptt::RetrivePatientDetails(InputParameters,OutputParameters) ] – WSIF JCA Execute of operation ‘RetrivePatientDetails’ failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    ; nested exception is:
    BINDING.JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
    at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:155)
    at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendRequestResponse(JCATransportEndpoint.java:209)
    at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:170)
    at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:598)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
    at $Proxy143.sendMessageAsync(Unknown Source)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:558)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:426)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:670)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:585)
    at stages.routing.runtime.RouteRuntimeStep.processMessage(RouteRuntimeStep.java:128)
    at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
    at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
    at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
    at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
    at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
    at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:96)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:332)
    at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
    at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
    at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
    at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/DbAdapterOSBProject/adapters/AdapterJdevProject/RetrivePatientDetails [ RetrivePatientDetails_ptt::RetrivePatientDetails(InputParameters,OutputParameters) ] – WSIF JCA Execute of operation ‘RetrivePatientDetails’ failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    ; nested exception is:
    BINDING.JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:259)
    at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:150)
    … 54 more
    Caused by: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/DbAdapterOSBProject/adapters/AdapterJdevProject/RetrivePatientDetails [ RetrivePatientDetails_ptt::RetrivePatientDetails(InputParameters,OutputParameters) ] – WSIF JCA Execute of operation ‘RetrivePatientDetails’ failed due to: Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    ; nested exception is:
    BINDING.JCA-11622
    Could not create/access the TopLink Session.
    This session is used to connect to the datastore.
    Caused by Exception [EclipseLink-7060] (Eclipse Persistence Services – 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.ValidationException
    Exception Description: Cannot acquire data source [jdbc/SampleDataSource].
    Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SampleDataSource’. Resolved ‘jdbc’; remaining name ‘SampleDataSource’.
    You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:662)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:353)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:312)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:350)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:253)
    … 55 more

  21. October 4, 2011 at 09:41


    Hello Guido,
    I’ve read your interesting article, and I’ve got one simple question: is it possible to define more than one operation (query) for an adapter, or I have to create many adapters?
    Thanks,
    Carlo


    • gschmutz
      February 13, 2012 at 20:17


      this is really depending on the adapter and the functionality you use. If you use the DB adapter to handle CRUD operations on the table, then each CRUD operation is a different operation in the WSDL. If you want different queries, then you have to create different adapters, if you can’t just do the dynamic part by defining parameters.


  22. Nits
    November 25, 2011 at 14:34


    Hey Guido,
    very well written post… The detailed steps and videos make it a cakewalk to follow it.
    keep it up.
    Whats your advice for packaging this code?? Do we need all the Jdev code to be deployed on OSB or can we get rid of some libraries or unwanted files before it goes to prod ???
    Nits


  23. saurabh
    March 21, 2012 at 06:22


    Hey Guido,
    I have a one requirement where I need to configure both the operation i.e.. select and insert in a single DB adapter, actually I want my DB adapter to first select 1 field table A and insert the same with other field in table B.
    Do you think it is possible if yes please help me.
    Best Regards,
    Saurabh


    • gschmutz
      March 21, 2012 at 11:38


      You have to configure two different db adapters, but of course they can be in the same JDeveloper project. You can only use the same DB adapter for insert/select operations on the same table or set of tables. In your case, where you want to read from one table and update another, this is not possible.
      You would then use the first adapter through an OSB callout action and the second one you would use in the Routing action.
      Hope this helps!
      Guido


  24. javed
    May 23, 2012 at 12:32


    Hey Guido,
    I bought the your OSB book and also downloaded the code from packtpub site, they when i try creating a basic osb service, i am not able to do it. I navigate to chapter-1>getting ready, but i do not get any component named as already exsiting project, what i get is too many basic-osb-service folders, and when i click ok, it flags error saying , basic-osb-service already exists. Please help.
    javed


  25. manohar
    September 17, 2012 at 17:49


    hi its urgent,can u tell me .. with out using jdeveloper can i make osb service communicate with database in oepe.. is there any possibilities.. now i am using ” oepe 11g ” can u send me one sample example. please its needed for me…..


    • gschmutz
      September 17, 2012 at 21:12


      Hi, no unfortunately you can not use the DB adatper without going throught JDeveloper. But JDeveloper is only needed for the definition of the metadata for the adapter. After that you can do everything from Eclipse OEPE.
      There is an XPath function (fn-bea:execute-sql) for accessing a database directly from OSB without going through the DB Adapter. I usually prefer the DB Adapter, as it is much easier to use and has much more functionalities. Hope this helps!

  26. September 20, 2012 at 13:31


    Guido,
    On the response transformation in the ‘Replace’ I get the following SOAP fault. I have manually configured the response element from the db adapter and also added the ‘db’ namespace. Any suggestions would be appreciated.
    soapenv:Server
    BEA-382513: OSB Replace action failed updating variable “body”: Error parsing XML: {err}FORG0005: expected exactly one item, got 0 items
    BEA-382513
    OSB Replace action failed updating variable “body”: Error parsing XML: {err}FORG0005: expected exactly one item, got 0 items
    RouteNode1
    response-pipeline

  27. January 10, 2013 at 23:30


    Hi Guido!
    Your tutorial helped me so much!
    Thank you!
    Regards,
    Eduardo


  28. niihar dash
    April 7, 2013 at 17:51


    How to retrive a CLOB Payload from AQ using OSB Proxy built using JCA Adapter.please suggest

  29. April 19, 2013 at 06:55


    Hi,
    I have to create a DB Adapter in BPEL on Reporting Database of OSB.
    I have a requirement to extract DATA_VALUE from *WLI_QS_REPORT_DATA* Table stored in BLOB datatype by passing parameters in *WLI_QS_REPORT_ATTRIBUTE* with a join condition of a common unique ID (MSG_GUID) in both tables.
    This DB Adapter files will be imported in OSB to generate Biz Service, which will perform this function.
    I have followed all steps as mentioned in this blog
    My query looks like this :
    SELECT t0.MSG_GUID, XMLTYPE(t0.DATA_VALUE,nls_charset_id(‘AL32UTF8’)) FROM osb_infra.WLI_QS_REPORT_DATA t0
    LEFT OUTER JOIN osb_infra.WLI_QS_REPORT_ATTRIBUTE t1
    ON (t0.MSG_GUID = t1.MSG_GUID)
    WHERE t1.DB_TIMESTAMP >= ADD_MONTHS(SYSDATE,-1)
    AND t1.DB_TIMESTAMP < SYSDATE AND
    t1.INBOUND_SERVICE_NAME =#serviceName
    AND (SUBSTR(t1.MSG_LABELS,22,10) =#keyValue OR SUBSTR(t1.MSG_LABELS,18,10)=#keyValue)
    AND t1.STATE='REQUEST'
    This query runs fine when run independently on DB. but gives no response when used in DB adapter generated Biz Service, while testing in OSB Test Console.
    I have done trials for this tool by modifying query as following.
    1. Query on 1 table : Report Attribute – Success
    2. Query on 1 table : Report data – Success but no XML data
    3. Query on both tables with ServiceName Hardcoded – Failure
    4. Query on both tables with keyValue hardcoded – Failure
    5. Query on both tables with both params hardcoded – Failure
    6. Query on both tables without XML data, selecting MSG_GUID only – Failure
    All the above queries give desired outputs with XML message converted as well when run independently on SQL woksheet.
    1. Query on multiple tables
    2. Fetching of data in XML format as response into OSB pipeline.
    I am still trying hard to somehow get data from DATA Table with providing MSG_GUID as parameter, but no progress.
    The query I used here is :
    SELECT XMLTYPE(DATA_VALUE,nls_charset_id('AL32UTF8')).getClobVal FROM osb_infra.WLI_QS_REPORT_DATA
    WHERE MSG_GUID = 'uuid:b2bf9a6e66ba73f5:-7d5e4cfc:13deecde95d:5434'
    This query runs fine in SQL Worksheet of JDeveloper with no issue and also extracts XML out of BLOB data.
    But no success in getting it inside OSB pipelines.
    Output in OSB for dataValue is :
    Please guide on this.
    Thanks
    Cheena Malhotra


  30. EN
    May 28, 2013 at 20:32


    Hi Guido, Thanks for this useful information. I had also come across a presentation by you called “Where and When should I use OSB”. That mentioned a bad practice titled “Batch Processing” and spoke of moving large amounts of data from one db to another. We have a similar situation where a process needs to be scheduled to process about 200K records and transform them into a file. So, Scheduler -> DB Adapter -> OSB -> File Adapter. We are locked into using OSB at this point and I was wondering if you had any advice to deal with this problem (debatching etc) ?


  31. Marlon
    July 25, 2013 at 20:14


    Hello Guido, Im a Web Services developer but a new-be on the OSB platform, and there’s a company developing a bunch of services in my job but there’s something that doesn’t seem to be good for me, when I test the proxy services over SOAPUI I cannot differentiate between the request parameters and the response, everything seems to be mixed and they claim that there’s nothing bad with this. Can you tell me if this is a good practice or they are just as new-be as me and don’t know how to build OSB services in the correct way.
    Regards
    Marlon


  1. August 9, 2010 at 11:26
  2. August 14, 2010 at 13:04

Leave a Reply

No comments:

Post a Comment