Welcome to Tech Mastery, your expert source for insights into technology and digital strategy. Explore topics like Adobe Experience Manager, AWS, Azure, generative AI, and advanced marketing strategies. Delve into MACH architecture, Jamstack, modern software practices, DevOps, and SEO. Our blog is ideal for tech professionals and enthusiasts eager to stay ahead in digital innovations, from Content Management to Digital Asset Management and beyond.
WLST script to migrate default File Stores to JDBC store in weblogic servers
The persistent store provides a built-in, high-performance storage solution for WebLogic Server subsystems and services that require persistence. For example, it can store persistent JMS messages or temporarily store messages sent using the Store-and-Forward feature. The persistent store supports persistence to a file-based store or to a JDBC-enabled database.
By default, File store is used as a persistence store for weblogic servers
File stores are generally easier to configure and administer, and do not require that WebLogic subsystems depend on any external component.
File stores generate no network traffic; whereas, JDBC stores will generate network traffic if the database is on a different machine from WebLogic Server.
JDBC stores may make it easier to handle failure recovery since the JDBC interface can access the database from any machine on the same network. With the file store, the disk must be shared or migrated.
This tutorial explains the approach to migrate the default JMS file store to a DB store through WLST script.
Data Source
As a first step, create a schema in target database(beloSQL for Oracle database)
alter session set “_ORACLE_SCRIPT”=true;
create user JDBC_STORE_USER identified by “jdbcstoreuser” temporary tablespace temp default tablespace users;
grant connect to JDBC_STORE_USER; grant resource to JDBC_STORE_USER; grant create session to JDBC_STORE_USER;
ALTER USER JDBC_STORE_USER quota unlimited on USERS;
Create a data source with name “JDBCStoreDataSource” to connect to the database
A JDBC store must use a JDBC data source that uses a non-XA JDBC driver and has Supports Global Transactions disabled.
Test the configurations and ensure the test connection successful
Target the data source to all the servers in the domain so the same data source can be used by all the servers to manage the JDBC stores(For demo i am targeting only to Admin Server)
Now the data source is ready and can be used for JDBC store configurations
WLST Script
The below wlst script migrate the existing File Store to JDBC Persistence store — my case the server is enabled with one persistence store(BAMMonitoringJMSFileStore) for JMS Server(BAMMonitoringServer) and targeted only to Admin Server so the script migrate the JMS store to JDBC store and target to Admin Server, modify the script based on the number of existing File store configuration
MigrateFileStoreToJDBSStore.py
import sysprint "@@@ Starting the script ..."from java.util import *
from javax.management import *#The directory of the domain configuration
#/app/oracle/products/11g/admin/domains
wlsDomain='C://Albin/SW/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain'
print "WLSDOMAIN="+wlsDomainadminURL='t3://localhost:7001'
adminUserName='weblogic'
adminPassword='weblogic1'
connect(adminUserName, adminPassword, adminURL)
edit()
startEdit()
############# JDBC stores for STANDALONE ADMINSERVER ## Enable and target unique JDBC Store for all the servers in the domain
cd('/')
cmo.createJDBCStore('BAMMonitoringJMSJDBCStore')
cd('/JDBCStores/BAMMonitoringJMSJDBCStore')
cmo.setDataSource(getMBean('/SystemResources/JDBCStoreDataSource'))
cmo.setPrefixName('bammonitoring')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))#### Add
#### end of creating jdbc stores############Set Persistent Stores for the sub systems e.g JMS Serverscd('/JMSServers/BAMMonitoringServer')
cmo.setPersistentStore(getMBean('/JDBCStores/BAMMonitoringJMSJDBCStore'))#################DESTROY ALL THE EXISTING FILE STOREScd('/')
cmo.destroyFileStore(getMBean('/FileStores/BAMMonitoringJMSFileStore'))
save()
activate()
Script
techforum-repo/youttubedata
Contribute to techforum-repo/youttubedata development by creating an account on GitHub.
github.com
Before executing the script, change the configurations as required.
Execute the script — <<Oracle_Home>>\oracle_common\common\bin\wlst.cmd MigrateFileStoreToJDBSStore.py
The existing file store is deleted after enabling the JDBC store for the modules.
For clustered environment the same should be executed for all the servers in the cluster with unique JDBC store name(e.g BAMMonitoringJMSJDBCStore for server 1 and BAMMonitoringJMSJDBCStore2 for server 2).
Restart the servers, the required tables({PrefixName}WLStore) — BAMMonitoringWLStore will be created.
The config.xml file will be enabled with required JDBC store configurations as below.
The table with name “BAMMONITORINGWLSTORE” created in database
select object_name as table_name from user_objects where object_type = ‘TABLE’ order by object_name;
The required data now stored into the JDBC store
This concludes the migration of existing Default File Store to JDBC store. The File Store and JDBC store has its own merits and demerits, the stores should be selected based on the uses cases — File Store provides better performance but JDBC store provides better recovery support.
WLST script to update Graceful Shutdown parameters in weblogic server
A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress.
Graceful Shutdown
The Graceful Shutdown command transitions a server instance from the RUNNING state to the SHUTDOWN state, allowing work in process to be handled gracefully, with this sequence of state transitions:
Ignore Sessions During Shutdown — If you enable this option WebLogic Server will drop all HTTP sessions immediately, rather than waiting for them to complete or timeout. Waiting for abandoned sessions to timeout can significantly lengthen the graceful shutdown process, because the default session timeout is one hour.
Graceful Shutdown Timeout — Specifies a time limit for a server instance to complete a graceful shutdown. If you supply a timeout value, and the server instance does not complete a graceful shutdown within that period, WebLogic Server performs a forced shutdown on the server instance.
This tutorial explains the approach to update graceful update parameters through WLST script in weblogic
WLST Script
The script will help us to update the Graceful Shutdown parameter for the servers in the weblogic domain.
UpdateGracefulShutdownParameters.py
def updateGraceFulShutdownTimings():
edit()
startEdit()
print
print '##############'
print '# Update Graceful Shutdown to 300 Seconds and ignore session true#'
print '##############'
print
serverNames=cmo.getServers()
for name in serverNames:
try:
print 'Updating Server==>'+ name.getName()
cd("/Servers/" + name.getName())
cmo.setGracefulShutdownTimeout(300)
cmo.setIgnoreSessionsDuringShutdown(true)
except WLSTException,e:
# this typically means the server is not active, just ignore
print 'Exception While Update the attribute'
print '========================================='
save()
activate()def main():
adminURL='t3://localhost:7001'
adminUserName='weblogic'
adminPassword='weblogic1'
connect(adminUserName, adminPassword, adminURL)
updateGraceFulShutdownTimings()
print 'Successfully updated Graceful Shutdown Parameters'
disconnect()
main()
oracle.webservices.preemptiveBasicAuth for invoking the webservices with Basic Authentication- Oracle SOA Suite
HTTP basic authentication can have two types of authentication handshake methods, one is Reactive another one is Preemptive,
Reactive:
The client makes a request for a resource which needs
authentication;
The server returns an HTTP 401 Authorization required
response (indicating the authentication scheme and realm) with WWW-Authenticate header.
The client re-submits the request with an Authentication
header;
The server verifies client credentials and returns the
resource if authenticated successfully..
Preemptive:
The client can preemptively pass the credentials on the
first request. The server returns immediately the resource if authenticated
successfully.
Not all the authentication server accepts the Preemptive authentication mode, The NTLM authentication will not support the Preemptive handshake method it should be Reactive.
In Oracle SOA 11g the parnerlink binding property oracle.webservices.preemptiveBasicAuth will help us to set the handshake method accordingly.
Response is displayed in compressed form while testing the Siebel webservices from SOAP UI
When i am trying to test the Siebel web services from SOAP UI the response is displayed in compressed form, seems the response is return in compressed for(i am not sure this is part of some Siebel configuration)
To display the response in decompressed form, make sure the option "Accept compressed responses from hosts" option in SOAP UI preference.
Backing up the MDS Repository Artifacts - Oracle SOA Suite
In Oracle SOA Suite 11g and Oracle SOA Suite 12c , all the common artifacts , the deployed composites and the common configurations are stored in the MDS database schema. Sometimes there is a possibility of MDS schema getting corrupted (the best example is the composites getting corrupted frequently)those scenario we will not be able to bring up the soa-infra and also we may loose all the deployments.
Backing up the MDS artifacts is the the solution for these kind of issues.
In this post i will be explaining some of the different options to back up the MDS artifacts.
The best approach is do a full back up of MDS repository schema using database backup utilities(dbexp).The backup can be restored if there is any issue with the MDS schema.
EM console - MDS configuration Page :
Right click on soa-infra and click on Administration and MDS Configuration.
Click Export on MDS Configuration page.
This will export the MDS artifacts to local machine as zip file.
BINDING.JCA-11822 JPublisher error occurred in JDeveloper
Sometimes you may receive the following exception in DBAdapter wizard while regenerating the adapter configuration for the option "Call a Stored Procedure or Function through JDeveloper in Oracle SOA Suite 11g".
BINDING.JCA-11822
JPublisher error occurred.
An error occurred while running JPublisher.
An error occurred when JPublisher was invoked: ERROR: missing method.
Analyze the error and correct if possible. Contact oracle support if error is not fixable.
at oracle.tip.adapter.db.sp.xsd.oracle.JPublisher.findWrapperProcedureName(JPublisher.java:222)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.ProcedureObject.setWrapperInfo(ProcedureObject.java:256)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.oracle.DBAdapterStoredProcPage.loadProcedureBrowseDialog(DBAdapterStoredProcPage.java:213)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.AbstractStoredProcPage.browseProcButton_actionPerformed(AbstractStoredProcPage.java:369)
at oracle.tip.tools.ide.adapters.designtime.adapter.db.sp.AbstractStoredProcPage$1.actionPerformed(AbstractStoredProcPage.java:197)
The exception will be thrown while browsing the procedure in the wizard and the procedure has one of the following RECORD, TABLE, or BOOLEAN as input/output type.
Dynamic where condition in DB Adapter - Query By Example
Sometime we may have the scenario to query the data in a table with dynamic where condition through DB Adapter in Oracle SOA Suite 11g.
The Query by Example option in the DB Adapter provides the option to construct the where condition dynamically based on the input data provided.Query-by-example uses the AND operator to tie the input attributes together to form the where condition.
For example when we are defining the Query By Example option for the Employee table the adapter will consider the Employee object as input and returns the Employee Object list.
Oracle Cloud Adapter for Salesforce.com - Oracle SOA Suite
Oracle introduces the Cloud Adapter for Salesforce.com as the extension of Oracle SOA Suite and this is certified only with the version 11.1.1.7.0.This will help the customers to integrate with the the Salesforce.com cloud easily.
When integrating the Salesforce.com via web service integration the main concerns are the Security management and the Session management.The web service integration requires more manual configurations, we have to connect to the Enterprise login with the authentication details to get the token values then using the token we have to do a API call to perform the operations in Salesforce.Oracle Cloud Adapter for Salesforce.com provides Intelligent Session management and security management and also provides a GUI to perform all the configurations.
public class GetMessageBridgeStatus {
private static MBeanServerConnection connection;
private static JMXConnector connector;
public static void getMessageBridgeStatus() {
try
{
getRuntimeMBeanServerConnection();
String son = "com.bea:ServerRuntime=AdminServer,Name=Bridge-0,Location=AdminServer,Type=MessagingBridgeRuntime";
ObjectName service = new ObjectName(son);
String status = connection.getAttribute(service,"State").toString();
System.out.println("Status: "+status);
Re-Targeting the singleton Applications to a single OSB node through WLST script
While setting up a OSB cluster environment some of the singleton applications should be targeted to a single node in the cluster.Also we have to make sure these applications are targeted to the active OSB node in the cluster.
The below WLST script will help us to re-target the singleton applications to a single active OSB node.
Unable to obtain metrics data from the server - Oracle OSB Non Clustered Environment
In Oracle OSB Monitoring Dashboard page we were receiving the warning message "Unable to obtain metrics data from the server" and not able to see any of the collected metrics.
This is a single node non clustered Dev setup, the OSB is running part of the AdminServer.
After analysis the issue is with the configuration of the singleton applications - ALSB Cluster Singleton Marker Application and ALSB Domain Singleton Marker Application.
Unfortunately the ALSB Domain Singleton Marker Application got undeployed and ALSB Cluster Singleton Marker Application was deployed as library instead of Enterprise Application.
The both the differences pointing to the same xsd in the same component, one is design time xsd and another one is run time xsd.
While comparing, we were able to see some small differences between these two xsd's but unfortunately we could not able to correct it because both are pointing to the same xsd.
After a long struggle i was able to find out the root cause, the actual root cause is the annotations defined in the xsd.
After removing the annotation sections from the specified schema and redeploying the composite(A), i was able to invoke successfully from other composite(B).
It seems to be when the xsd's have the annotation defined , the BPEL run time generated xsd has difference compare to the original local schema.
While deploying Oracle ADF application sometimes we may receive the following exception
weblogic.management.DeploymentException:
at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:184)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:112)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:103)
at weblogic.application.internal.flow.HeadLifecycleFlow.createListeners(HeadLifecycleFlow.java:175)
at weblogic.application.internal.flow.HeadLifecycleFlow.prepare(HeadLifecycleFlow.java:281)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:59)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) Caused By: java.lang.ClassNotFoundException: oracle.adf.share.weblogic.listeners.ADFApplicationLifecycleListener
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at
The issue is due to missing ADF web Run-time libraries in the war file.This can be resolved by adding the ADF web Runtime libraries into the war file.
Steps to resolve the issue
If you are deploying through JDeveloper then follow the below steps.
Add the ADF Web Runtime to the project libraries.
Include the ADF Web Runtime library as part of the war.
Project Properties-->Edit the deployment profile.
Select the ADF Web Runtime library as part of WEB-INF/lib contributors.
Getting the Audit Detail of a BPEL instance in JAVA - Oracle SOA Suite
In Oracle SOA Suite 11g and Oracle SOA Suite 12c,the audit trail of the BPEL is stored in the table AUDIT_TRAIL.If the size of the payload crossed the threshold size configured in the EM console then the details are stored in the AUDIT_DETAILS table.
The payload in the AUDIT_DETAILS table is in compressed binary form, you can use the below approach to get the actual payload.
import java.sql.*;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
public class GetPayload {
public static Connection getConnection() throws Exception {
Recovering the composites to JDeveloper from MDS - Oracle SOA Suite
Sometimes there is a possibility the latest code changes of the deployed composite in JDeveloper might have lost in other hand some cases we will not be having the implementation code for the deployed composites.
These scenarios the Oracle SOA Suite composite artifacts can be exported from MDS through em console and the same can be converted to design time artifact in JDeveloper.
This post will explain the steps to recover the composite to JDeveloper from MDS.
Steps to recover the composite from MDS
Login to Em console, right click on the particular composite and click on Export
Select the appropriate options as shown and click on Export
Not able to save the projects into the JWS file(Application) in JDeveloper
I was facing a issue while saving the project to the application JWS file and getting "Unable to save GettingPayload.jws".
Receiving the following exception in the JDeveloper console. java.io.IOException at oracle.ide.marshal.xml.StructureIO.loadUsingSAX(StructureIO.java:251) at oracle.ide.marshal.xml.StructureIO.loadImpl(StructureIO.java:167) at oracle.ide.marshal.xml.StructureIO.loadImpl(StructureIO.java:156) at oracle.ide.marshal.xml.HashStructureIO.load(HashStructureIO.java:46) at oracle.ideimpl.extension.RoleManagerImpl.getRolePreferences(RoleManagerImpl.java:80) at oracle.ideimpl.extension.ExtensionManagerImpl.runRoleSelectionDialog(ExtensionManagerImpl.java:1112) at oracle.ideimpl.extension.ExtensionManagerImpl.initialize(ExtensionManagerImpl.java:943) at javax.ide.Service.getService(Service.java:68) at javax.ide.extension.ExtensionRegistry.getExtensionRegistry(ExtensionRegistry.java:400) at oracle.ide.ExtensionRegistry.getExtensionRegistry(ExtensionRegistry.java:191) at oracle.ide.IdeCore.startupImpl(IdeCore.java:1384) at oracle.ide.Ide.startup(Ide.java:703)
While restating the JDeveloper, i could not able to see the projects listed under the corresponding applications, i have to manually add them to the application.
Not able to connect to Remote Oracle SOA Suite Server through JDeveloper – Oracle SOA Suite
Sometimes we could have faced the issue to establish the connection
to remote Oracle SOA Suite Server through JDeveloper; this might be due to different reasons.
Below are some of the basic steps to resolve the connection issue.
Verify whether the Weblogic Server’s user name, password, IP
Address, Port and the domain name are entered in the connection wizard
properly.
Make sure the option “Always use SSL” in the connection
wizard has not been set.
Make sure the option “Use HTTP Proxy Server” in the
JDeveloper has not been set. Disable the proxy settings: Tools ->
Preferences -> Web Browser and Proxy -> Uncheck 'Use HTTP Proxy Server'
option.
The issue is due to wlsbJMSServer target is not defined in weblogic server.
We can avoid this error and continue with the deployment by selecting the option as Deploy to selected instances in the domain and selecting the particular server or cluster instead of selecting the option as Deploy to all instances in the domain from the JDeveloper deployment wizard.
This is a temporary solution to continue with the deployment but we have to correct the Target issue.
Before WLS release 10.3.5, weblogic servers's hostname verification code did not supports the wildcard certificate by default we have to create a custom hostname verification code to handle this scenario but from WLS release 10.3.5, weblogic servers hostname verification code by default supports the wildcard certificates.
Wildcard SSL Certificates work the same way as a regular SSL Certificate, allowing you to secure the connection between the client and server(www.abc.com) but a single Wildcard SSL Certificate covers any and all of the sub-domains of the main domain(*.abc.com)
Configuring Wildcard SSL HostnameVerifier:
Launch WLS console
Click on Environment -> Servers and click on the server
Then go to SSL tab
Lock & Edit
Scroll down and expand advanced section
Change Hostname verification entry to Custom Hostname Verifier
Enter Below in Custom Hostname verifier "weblogic.security.utils.SSLWLSWildcardHostnameVerifier"