Showing posts with label jdeveloper. Show all posts
Showing posts with label jdeveloper. Show all posts

Monday, 13 November 2017

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 : Deployment Error MDS-00039: error while attempting to parse the document .diagram.xml

If you are trying to deploy a recently changed service composite to Enterprise Manager and getting the below error:

Deploying on "/Domain/soa_domain/soa_server1" failed!
There was an error deploying the composite on soa_server1: oracle.mds.transfer.TransferException:
MDS-00001: exception in Metadata Services layer
oracle.mds.exception.MDSRuntimeException: MDS-00039: error while attempting to parse the document /deployed-composites/Test/TestBPEL_rev1.0/SCA-INF/TestBPEL.diagram.xml using SAX.
oracle.xml.parser.v2.XMLParseException; lineNumber: 1; columnNumber: 1; Start of root element expected.
MDS-00001: exception in Metadata Services layer:

Reason: The SCA-INF folder contents are stale.

Here is what you should do.

1. In JDeveloper navigate to your project, select it.
2. Under tab Build (Alt + B), select Clean project.jpr
3. Re-build your project/sar and deploy.

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, 31 October 2017

SOA 12c JDeveloper: Error Unable to package module oracle.ide.ceditor.CodeEditorScrollableSectionView cannot be cast to oracle.tip.tools.ide.fabric.gui.components.DiagramEditor


If you are building your code in JDeveloper 12c and getting the below error in Deployment even though compilation is successful:

[06:05:14 PM] Deployment cancelled.
[06:05:14 PM] ----  Deployment incomplete  ----.
[06:05:14 PM] Unable to package module
[06:05:14 PM] oracle.ide.ceditor.CodeEditorScrollableSectionView cannot be cast to oracle.tip.tools.ide.fabric.gui.components.DiagramEditor

Well the solution is pretty simple.

Keep your composite.xml in design mode and rebuild. It will work.


Helpful? Please Comment.

Happy Learning!!

Wednesday, 18 October 2017

SOA 12c Security : SOADeployer role

Oracle Enterprise Manager Fusion Middleware Control supports the notion of role-based access. Users are mapped to different roles; each role corresponds to a different set of privileges. Using this mechanism, you can provision certain users with simple monitoring privileges (for instance view-only access), while administrators can be granted full access, including the ability to update configurations, restart servers, and so on.

The following roles have been defined for Oracle WebLogic Server in Oracle Enterprise Manager Fusion Middleware Control:

1. Administrator
2. Operator
3. Monitor

The actions that you can perform in Oracle Enterprise Manager Fusion Middleware Control are protected using Oracle WebLogic Server enterprise roles. To obtain the appropriate behavior in Oracle Enterprise Manager Fusion Middleware Control, you must correctly map either the user or enterprise role to the Oracle SOA Suite application role.

SOAAdmin -to- Administrator
SOAOperator -to- Operator
SOAMonitor -to- Monitor

There is no default mapping of the SOAMonitor and SOAOperator roles to Oracle WebLogic Server groups or users. These roles must be manually mapped in Oracle Enterprise Manager Fusion Middleware Control.

However we do not have any role SOADeployer.

This is what you should do if you want to create a custom role in Oracle EM Fusion Middleware control.

The role will have the below grants only:
1. Deploy Applications to WebLogic servers
2. Life-cycle SOA composites for all folders.

Steps:
1. Create SOADeployerUsersGroup
    a. Login to WebLogic console
    b. Navigate to Security Realms > myrealm > Users&Groups > Groups tab
    c. Create new Group SOADeployerUsersGroup
    d. Click on SOADeployerUsersGroup and under Membership tab add Deployers and Save.

2. Create Role
    a. Login to EM
    b. Navigate to WebLogic domain (soa_domain) > Security > Application Roles
    c. Select Application Stripe - soa-infra
    d. Create new Role SOADeployerCustomRole
    e. Under Membership section, Add > Group > SOADeployerUsersGroup
    f. Save

3. Create Principal
    a. On EM navigate to WebLogic domain (soa_domain) > Security > Application Policies
    b. Create Principal
    c. On Add Principal section, Search for Application Role > Select SOADeployerCustomRole
    d. Under Permissions, Click on Add
    e. Select Class - CompositePermission and filter Resource Name > Includes > *

       

    e. Select first resource and click on Next
    f. Under Customize, select read, provision and life-cycle
    g. Continue ans Save.

Now you can create a User in Weblogic Server add it to SOADeployerUsersGroup membership.

You can then deploy your code from JDeveloper or using scripts with this user to any SOA folder.

Helpful? Please Comment.

Happy Learning!!

Thursday, 12 October 2017

OSB 12c : Email Polling with Attachment

This is what you should do if you want to use the email protocol to initiate your OSB service based on email in the Mail Inbox.

Overview:
The Proxy service polls the Mail Inbox for the new messages and invokes the Business service whenever there is a new message in the Inbox.
The polling interval can be specified in the Proxy Service configuration.

You can read the contents of the email or can process an email attachment.

We will be using the 12c JDeveloper to create the service. You can do the same on the service-bus console.

Steps:
1. Create an Service Bus Application and Project.



2. Name your application and project.





3. Once your application and project are created, create your folder structure like below:



4. First we will create a Service Account, with static username/password of the mail account.

 



5.  Save.
6. Now we will create a Business Service which will be invoked based on the email.

Note: This Business Service can do anything you want to do with the data you receive.
Example:
a. Invoke a service (say BPEL) with the email body payload as input or
b. Read the attachment and process to a file location using file transport

We will cover example b today.

7. Name the service and select file transport. We are not using the file adapter jca here.



8. Keep the Service Type below:

 

9. Define the server directory path starting with the root till the directory you want to place the file.



10. On the Business Service leave other values default, Save.
11. Open your composite.xml and on the External Services swim-lane  right click > Choose > Business Service > Select Business Service WriteEmail_BS > Ok






 You can also drag-drop your business service to the swim-lane.

12. On the middle swim-lane, Pipelines/Split Joins, right-click > Insert > Pipeline
13. Name your pipeline, change Location to Services\Proxy Service , Next


 
14. Define the Service Type as Messaging - Text/None and check Expose as a Proxy Service.
Name your Proxy Service with transport as email.



15. Finish.
16. Your composite should look like below:

 

17. Open the Proxy Service, click on the Transport tab and provide the mail server host and port



Here we are using Outlook Office 365 email server on port 993 or 143

18. Click on the Transport Details tab, select the service account we created, email protocol as imap, specify the polling interval as per requirement, select the Post Read Action as per the requirement and also specify the Download/Archive/Error directories accordingly and Save All.




19. Open you Pipeline, right-click and add a pipeline-pair node
20.  In the request pipeline stage add an Assign action. We will use it to get the attachment name.
This value is part of the context variable - $attachments
Use the below expression:



assign it to variable attachmentname.

 21. Add one Assign  and Replace actions to map the attachment contents to outgoing $body like below


 


22. Add one Publish action and set the target Service to the Business Service WriteEmail_BS.bix
23. Inside the Publish insert a Transport Header action, with below parameters




Test:

Send an email to the user account email.


This will trigger your service and as a result write the attachment to the file location on the server.


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...