Showing posts with label weblogic. Show all posts
Showing posts with label weblogic. Show all posts

Sunday, 14 October 2018

SOA 12c : Shell Script to set Environment variables

This is what you you should do if you want to use a shell script to set your environment variable.

1. Create a .sh file ex: setEnv.sh
2. Edit and add like below:

#!/bin/sh

#*****************************************************************************
# This script is used to set up your environment for development with WebLogic
# Server.  It sets the following variables:
#
# JAVA_HOME    - Location of the version of Java
# ANT_HOME     - Location of the version of ANT
#*****************************************************************************

JAVA_HOME="/jdk/jdk1.8.0_131"
ANT_HOME="/oracle_common/modules/org.apache.ant_1.9.2"

export JAVA_HOME ANT_HOME
echo "Your environment has been set."


3. Edit paths based on you machine/environment.
4. Save
5. Execute the script using the command . ./setEnv.sh

6. Validate by executing the command echo $JAVA_HOME

You can add other variables as required.


Helpful? Please comment.

Happy Learning!!

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, 11 December 2017

SOA 12c : Error JTA transaction is not in active state/The action "update action" cannot be performed on the instance

Today while I was testing a service I was seeing errors intermittently on EM instances.
My service was invoking a sync partner link and even with successful response the error was  happening.

Well turns out the error was due to the default JTA setting to 30 seconds.

Error:
JTA transaction is not in active state.
bpel engine can not execute activities without an active transaction. please debug the invoked subsystem on why the transaction  is not in active status. the bpel instance id is "448".
The reason was The execution of this instance "448" for process "App/ProjectBPEL!1.0*soa_3cd6576b-91bd-4992-afaf-3620d3509180" is supposed to be in an active jta transaction, the current transaction status is "MARKED_ROLLBACK" .
Consult the system administrator regarding this error.

or

Cannot access instance.
The action "update action" cannot be performed on the instance "9579" because of its current state ("unknown").
The current instance state did not allow the requested action to be performed.
Consult the product documentation for a list of all the permissible actions that can be performed on an instance when it is in the "unknown" state.

Solution:
1. Login to WebLogic console.
2. Navigate to JTA settings
3. Increase your JTA to a higher value.

JTA values can depend on the processing time that your partner may take in a sync exchange set globally.

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


Wednesday, 25 October 2017

SOA 12c Security : Create Users & Groups

Here is what you do if you want to create users or groups in WebLogic 12c.

1. Login to WebLogic server console
2. Navigate  to Security Realms on the Home page
3. Select myrealm
4. Click on tab Users and Groups
5. Click on Groups
6. Create new Group
7. Provide Name, Description and leave Provider default


8. Save
9. Now select the group created above, Click on Membership
10. Choose required group(example: Deployers) from available groups and Save.


Similarly,

1. Click on User
2. Create new User
3. Provide Name, Description and Password
4. Click on OK
5. Select the created User
6. Click on Groups tab
7. Select the Group from available ones based in the role you want to assign to User.
8. Save

Note: If you will not assign atleast one Group to the user, you will not be able to login to the console with that user

Login with this user and check access levels.

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

Tuesday, 3 October 2017

ANT : java.lang.NoSuchMethodError: org/apache/xerces/impl/xpath/regex/RegularExpression.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Locale;)V


This is what you should do if you are trying to deploy SOA code using ANT and facing the below issue:


[wldeploy] java.lang.NoSuchMethodError: org/apache/xerces/impl/xpath/regex/RegularExpression.<init>(Ljava/lang/String;Ljava/lang/String;Ljava/util/Locale;)V
[wldeploy]     at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets(Unknown Source)
[wldeploy]     at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets1(Unknown Source)
[wldeploy]     at org.apache.xerces.impl.dv.xs.BaseSchemaDVFactory.createBuiltInTypes(Unknown Source)
[wldeploy]     at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes(Unknown Source)
[wldeploy]     at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.<clinit>(Unknown Source)


Solution-
Check your ANT jars are imported correctly and the ANT_HOME is set and retry.

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