Showing posts with label dbadapter. Show all posts
Showing posts with label dbadapter. Show all posts

Thursday, 21 December 2017

SOA 12c DBAdapter : Exception occured during invocation of JCA binding: Could not create/access the TopLink Session.

Recently created a new DataSource and adapter JNDI and when trying to test I got the below error:

Exception occurred when binding was invoked. Exception occurred during invocation of JCA binding: “JCA Binding execute of Reference operation ‘merge’ 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.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.ValidationException Exception Description: Cannot acquire data source [jdbc/Demo_DB]. Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.Demo_DB’. Resolved ‘jdbc’; remaining name ‘DemoDB’. 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 invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.


The solution was simple. Either you can;

1. Cross verify the DataSource name in the adapter JNDI connection pool and make sure to update the DBAdapter.

or

2. Check if your DataSource is targeted to the soa_server. If not, target it.


Helpful? Please Comment.

Happy Learning!!

Monday, 13 November 2017

SOA 12c DBAdapter : JCA Binding execute of Reference operation 'insert' failed Caused by java.sql.SQLException: Attempt to set connection harvestable to false but the connection is already closed.

Recently when trying to test a DBAdapter service I came across this issue. You can follow the same steps as I did to resolve the problem.

Error:
com.oracle.bpel.client.BPELFault: faultName:
{{http://schemas.oracle.com/bpel/extension}remoteFault} messageType:
{{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} parts: {{ summary=Exception occurred when binding was invoked.
 Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to:
 DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [EmpTemp.Emp_Temp]
Caused by java.sql.SQLException: Attempt to set connection harvestable to false but the connection is already closed.

Actual Reason:
DS that you are using is stale.
Means, lately the DBMS that you are connecting to, was restarted or refreshed and WebLogic Server lost the connection to it.

Why this happened?
You have not yet configured the pool to test connections, so once the connection is dead,
WLS still knows nothing about that, and will save and serve up dead connections until the pool is rebuilt.

Do one or both of the below things:

Solution: Enable test-connection-on-reserve (so that is does not happen again).
Or
Implement Work-around: Reset the datasource from the console after the DBMS is back up.

When you reset the database connections in a JDBC data source, WebLogic Server closes and recreates all available database connections in the pool of connections in the data source.

To reset database connections in a JDBC data source:

1. Navigate to the data source that you want to reset:
2. Select the Control tab.
3. On the Control page, select the instances of the data source that you want to reset.
    Date source instances are listed by the server on which they are deployed.
4. Click the Reset button.
5. Click Yes to confirm the action.

     Results are displayed at the top of the page, and the Status of Last Action is changed to SUCCESS for each data source that you selected to reset.


Helpful? Please Comment.

Happy Learning!!


SOA 12c JDeveloper : Configure Microsoft SQL Server Driver for DBAdapter

Here is what you should do if you want to create a database connection to Microsoft SQL Server.

Firstly, obtain the library for the SQLServer JDBC driver library bundle.
You can use the below link.
http://www.microsoft.com/en-us/download/details.aspx?id=21599

Unzip the archive.
Inside you will find sqljdbc4.jar, which will be the library we will use.

1. In JDeveloper, navigate to Tools > Preferences
2. Under Preferences, left margin, expand Database
3. Select 'JDBC Driver Options'



4. Click on +
5. Below, browse the Library
6. On 'Select Library', click on New
7. Enter library name, sqljdbc4.jar [no-spaces] and click on 'Add Entry'
8. Locate the library that we downloaded and extracted; sqljdbc4.jar
9. Click on OK, again OK and come back to Preferences page
10. Enter the driver class as 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
11. Click on OK.

12. Now go to Resource palette,  and create a New Database connection.
13. Select 'Connection Type' as SQLServer
14. Provide all the connection details of the SQLServer you want to connect to
15. Test your connection.
16. Click OK and you are done.

Helpful? Please Comment.

Happy Learning!!

SOA 12c DBAdapter : JDeveloper Error Element 'properties' used but not declared

If you are trying to open your DBAdapter configuration but getting the below error in popup:

java.util.InvalidPropertiesFormatException:
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 12; <Line 2, Column 12>:
XML-20149: (Error) Element 'properties' used but not declared.
    at sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:80)
    at java.util.Properties$XmlSupport.load(Properties.java:1201)

The configuration still opens if you ignore the error but properties don't load correctly.

The reason for this error is that the properties declaration is missing from the adapter-properties.xml file.

Add the below line before the properties element in your adapter-properties.xml file.

<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">

Save and retry.

Helpful? Please Comment.

Happy Learning!!

Tuesday, 26 September 2017

SOA 12c DBAdapter: Error while validating JCA Reference Binding meta data during composite deployment

What you need to do if you are deploying you DBAdapter service and getting the below error:

Error deploying archive sca_SOADBAdapter_rev1.0.jar to partition "default" on
server soa_server1
HTTP error code returned [500]
Error message from server:
There was an error deploying the composite on soa_server1: Deployment Failed:
Error while validating JCA Reference Binding meta data during composite
deployment.: JCA deployment validation errors for 'Adapters/DBReference_db.jca'.

Check server log for more details.
Error deploying archive sca_SOADBAdapter_rev1.0.jar to   partition "default" on server
soa_server1
Deployment cancelled.
----  Deployment incomplete  ----.
Error deploying archive  file deploy/sca_SOADBAdapter_rev1.0.jar
(oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)


The possible cause for this issue is that the JNDI being used in .jca is unavailable, incorrect or invalid.

Solution - Create or Correct your JNDI.
Also, Check if your JNDI has the correct DataSource configured and the DataSource test is successful.
If all these are good and you still have the same error, open your DBAdapter configuration and check table imports and settings.


Helpful? Please comment.

Happy Learning!!

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...