Sunday 1 March 2020

Interview question for Error Handling--2

Catch & CatchAll block
Catch block
1. This is used to handle specific fault
2. Store fault information in fault variable
3. We can add more than one Catch block in one BPEL process.
CatchAll block
1. This is used to handle any type of fault.
2. We need to use functions to get the fault details.
3. We can add only on CatchAll block in one BPEL process.


Function we use to get Fault Name and Fault description in CatchAll block
We use

ora:getFaultName() to get fault name 
ora:getFaultAsString() function to get fault description 

Fault Handling framework
Oracle SOA Suite provides generic fault management framework to handle the faults. We use this framework to handle the fault that occur during invocation time.


Catch blocks and Fault Handling Framework
CatchAll Blocks
1. We use Catch & CatchAll block to handle all types of error.
2. These can be used only for BPEL component.
3. We can use this for all BPEL templates (Sync, Async, Oneway).


Fault Handling Framework

1. We use this framework only to handle invocation faults; we can’t use this framework to handle all types of fault.
2. This can be used for BPEL as well as Mediator component.
3. We should use this only for two BPEL templates (Async and OneWay).


Fault Handling Framework works:

Fault Handling Framework is based upon two files.


Fault-policy.xml: This file is used to define one or more fault policies with conditions and actions.


Fault-binding.xml: This file is used to associates a policy with a composite, component or reference.


All actions we have in fault-policy.xml file
1. Retry
2. Human Intervention
3. Terminate
4. Java call
5. replay
6. rethrow


How to handle errors in mediator component
We use fault handling framework to handle fault in mediator.


File rejection handler
File rejection handler is used to handle rejected file while performing polling.


Types of rejection handlers 
1. Web Service Handler
2. Custom Java handler
3. Queue handler
4. File Handler

Saturday 18 January 2020

Issue for Weblogic-3

JDBC

Stale connections causing high CPU and high memory utilization and eventually breakdown of database.


Soln:

The hardware and software could not be easily replaced due to the cost it.They can be incurred due to complexity of the application. So the challenge was to make the best utilization of the database, reduce the connections, if possible effectively use the connections made and refine the code

All the  connections to the database were being made by the connections pools configured on Web logic, so web logic was the target for refinement. 

During the periods when the issue occurred it was observed that the number of sessions rapidly increases from 1400 to 1800,database was capable of handling 1400 sessions it couldn’t support 1800 sessions at all. Most of these 1800 sessions were connections created by web logic in response to application request. 

We mainly concentrated on two parameters:

1. Shrink Frequency 
2.Inactive Connection Timeout. 

Shrink Frequency: The number of seconds  before Web Logic Server shrinks the connection pool to the original number of connections or number of connections currently in use. 

Startup Issue:

when you are  tying to start Web logic as a Windows service the Service Manager throws an exception – 
“Error 1067 the process terminated unexpectedly.”

When it appears there will not be any information recorded in the web logic logs as the Service Manager had failed to initiate web logic startup process itself. But we need to check the Windows Event logs for more information on this.


Soln:


 To start Web logic as a Windows service the Service Manager throws an exception – “Error 1067 the process terminated unexpectedly.”


When this happens there will not be  store any information recorded in the web logic logs as the Service Manager had failed to initiate web logic start-up process itself. But there we need to check the Windows Event logs for more information on this.



Issues for Weblogic-2

The solution for  Log files not rotating
  Check the Status of the Server
 ./startWeblogic.sh
 ./startManagedWeblogic.sh <manageservername>
 Another option:
 Check in the console.
 Check the disk Space(if fit is full, Delete the logs and then  restart the Server)
 du –kh (folder)
 df –kh (filesystem)

If the avail capacity is 45% 90%
 If full , mv <source > <destination>
 Delete, rm –rf <filename: adminserver.log>

Major Server Errors:

Check the Status of Servers.
 ./startWeblogic.sh
 ./startManagedWeblogic.sh <manageservername>
 [0R]
 Need to do from console.
 Check the Server logs
 /apps/bea/domain/gwmp_destop/logs
 Adminserver.log
 Managedserver.log
 For this Database Errors, Check the Connection pool and Datasource.
 Services->jdbc->connectionpool,datasource
 Check out the Deployment Descriptors.
 Weblogic.xml,web.xml
 Based on the logs we can change Configuration Changes, Make the Changes and then restart instances one by one if in Cluster.

Server Down/Unknown Type:
Login to the Server through Putty/ Open the Admin Console

Check for the respective Instance Process from putty and also  the instance Status from Admin Console
If Processes does not exist and Instance Status is Unknown, check the logs of the Server Instance and Admin Logs.
Admin and managed server logs.
Node manage status.
Find the root Cause from the logs And Restart the required instances

If the URL is not working:

Need to the Status of the Server instances on which this Application is deployed.
next Default Queue threads or (Application Specified Queue if any)
1.If idle threads are zero or not. 
2.Then Server logs and Application logs (Out logs) for Errors and Exceptions.
 3.If idle threads are Zero, Check which Application is consuming all threads and if it is the same application which you are accessing, then check with the Application Owner.
 4.Need to restart the Corresponding Instances, need to check with  App owner why they are getting consumed
5.Check the Corresponding Connection pool and Datasource whether they are running fine or not.

Application errors:
Access the Application URL whether the instances and their status Errors

Check the logs of the Server as well as App(Out) logs
Check Connection pool Parameters and Datasource

Friday 17 January 2020

important commands for weblogic -2

Syntax for zip and unzip afile.
 gzip <filename>
 guzip <filename.>

display top 10 disk usage files.
 du -sh *|sort -nr|head -10

To retrive a field in a file.
cut -f 1,2 stud.

command for search a string in a file.
grep

command for end of the line in Vi editor
 G

Copy 10 line in vi editor
 10yy

To insert mode in vi editor
 Esc+i

T
o search a string in file(filename=sample,string=weblogic)
grep weblogic sample

copyfile from one unix Server to other unix system and syntax 
 scp -rp sample.txt username@192.167.11.128:/home/bea

To find out CPU utilisation
 Top

To execute a script using nohup
  nohup ./startWeblogic.sh &

command  used to search and replace a string
   sed

Command used to search astring in multiple files
  fgrep

save and quit from vi Editor's?
WQ!

ping and tracert:

ping :                  
1)It is check the connectivity.   
2)It is display all at a time.  
  
tracert:
1.It is packet information one place to another place destination.

2.It display only 30 hubs in tracert.

   

Thursday 2 January 2020

Weblogic Server as Server:(Two Way SSL Communications:)2

To configure the Two Way SSL.
On the Admin Server

Select  SSL tab: Advanced options
Two Way Client Cert Behaviour should be Client Cert Requested and Enforced.
Save it.
Now if you will can try to access the Admin Console over SSL then you will throw some SSL Handshake exception. Because of this process  two way SSL, Client is also requested to submit the certificate and we have not configured any certificate for our client 
So, we need to configure the certificate for the Client and for that again we need the Certificates for the Client.
We will be using the same CertGen utility of Weblogic Server to create the certificate.

java utils.CertGen <-certfile >ClientCert <-keyfile>ClientKey <-keyfilepass> keypass
Again it will create four certificates for the client.
To convert the client certificate into the PKCS12 format because the browsers generally accept PKSC12 keystore format for storing certificates.

Go to the OpenSSL bin directory and run the openssl.exe file then it will open up the OpenSSL command window where we can run the OpenSSL command.

 On this OpenSSL command use run the following command:
pkcs12 -export -in C:ServerCertClientCert.pem -inkey C:ServerCertClientKey.pem -out C:ServerCertclient-pkcs-12-cert

  • This will ask for a ClientKey.pem password: <xxxx>
  • Enter the Export Password: <xxx>
  • Confirm the Export Pass:<xxx>
  • This will create the client-pkcs-12-cert.
  • Now configuring the above certificate into the Browser:
  •  Open Mozilla Firefox >>> Tools >>> Options >>> Encryption >>> View Certificates:
  •  Certificates Tab >>> click on import >>>
  •  Select the client-pkcs-12-cert created above.
  • Enter the Key password: <xxx>
  •  This will import the Client certificate into the Browser.
  •  Now Restart the required Browser.
  • Try accessing the Admin Console through the Bowser.
  • Now the Browser will be able to access the Admin Console.