Thursday, 31 July 2014

Undeploying a SOA Composite when Soa-Infra is Down

This post describes about how to manage the composites when the server was down.

I have faced "java.lang.OutOfMemoryError" issue while restarting the server.Later on I came to know that  SOA Server getting down because of one error-ed composite.I googled the same thing and find out the solution as below.

One of the deployed composites is causing a problem. If you know which one it is, you can undeploy it then try to restart the server. If not and this is not a production installation, you can undeploy all composites and deploy them one by one again to verify which one is causing the problem.
As the server (soa-infra) is not running, you cannot use the Enterprise Manager to undeploy the composites. You can follow the instructions in the following note to undeploy composites while soa_infra is down:


Check the SOA logs and determine which composite is causing the problem and then follow the below process to undeploy the composite by editing deployed-composites.xml:

1. Download and copy the ShareSoaInfraPartition.ear file to                                               $MIDDLEWARE_HOME/oracle_common/common/bin

2. cd to $MIDDLEWARE_HOME/oracle_common/common/bin
and   run wlst.sh


3.connect()     and provide the username, password and server URL

4. run the below command to deploy ShareSoaInfraPartition.ear

deploy('ShareSoaInfraPartition','ShareSoaInfraPartition.ear',upload='true')

5. Now run the below command by changing the "toLocation" ('/fmw11g/fmw1115/Middleware' is some location path on SOA machine)

exportMetadata(application='ShareSoaInfraPartition',server='AdminServer',toLocation='/fmw11g/fmw1115/Middleware',docs='/deployed-composites/deployed-composites.xml')

6. A deployed-composites folder will be created at "toLocation" path with deployed-composites.xml in it

7. Delete the composite which is causing the problem and save the file

For example, the MediatorTest composite:

composite-series name="default/MediatorTest" default="default/MediatorTest!1.0"
composite-revision dn="default/MediatorTest!1.0" state="on" mode="active" location="dc/soa_58b98be8-9ec8-41af-composite dn="default/MediatorTest!1.0*soa_58b98be8-9ec8-41af-bb83-590f6004d1aa" deployedTime="2011-11-17T09:01:54.750+05:30"


8. Now run the below command by changing the "fromLocation" (this should be the same location as previous)
importMetadata(application='ShareSoaInfraPartition',server='AdminServer',fromLocation='/fmw11g/fmw1115/Middleware',docs='/deployed-composites/deployed-composites.xml')

9. Now bounce your server and the composite will not be deployed by SOA when it comes up and hence that should bring your soa-infra up.

You can download  ShareSoaInfraPartition.ear from the below link.
https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1380835.1%3AEARFILE&docType=HOWTO&action=download
 

Allocate specific JVM memory for the SOA

This post  describes how to control the allocation of memory resource in the JVM to the servers on a SOA or BAM install.

When we are trying to start the SOA Server, some times we will get the error like "java.lang.OutOfMemoryError: Java heap space"

It is possible that one of the deployed composites is using up more memory than expected, or the configured JVM heap space is too low for the deployed applications. If this problem began occurring recently, then this may be due to a recently deployed composite.

We can resolve this issue using either of the following solutions. 


Solution 1

Modify the setSOADomainEnv.sh file.
Note: Do not forget to make backup for the setSOADomainEnv.sh file before editing it.
This file can be found in: $FMW_HOME/user_projects/domains//bin
In the file setSOADomainEnv.sh
- replace

DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
- with

if [ "${SERVER_NAME}" = "soa_server1" ] || [ "${SERVER_NAME}" = "soa_server2" ]; then
      DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
      PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
elif [ "${SERVER_NAME}" = "bam_server1" ] || [ "${SERVER_NAME}" = "bam_server2" ]; then
      DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
      PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
elif [ "${SERVER_NAME}" = "" ] || [ "${SERVER_NAME}" = "AdminServer" ]; then
      DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
      PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
else
      DEFAULT_MEM_ARGS="-Xms2048m -Xmx2048m"
      PORT_MEM_ARGS="-Xms2048m -Xmx2048m"
fi

Solution 2

Specify the memory arguments in the Administration Console

a. Login into the Weblogic Administration Console
b. Expand Environmentc. Click on Serversd. For each Server click on the server name
e. On the Configuration tab
f. Go to the Server Start tab
g. Add the memory settings in the Arguments field: -Xms2048m -Xmx2048mh. Click Save

Tuesday, 29 July 2014

Different Date Formats For BPEL Process

This function returns the formatted string of dateTime using the format provided.

xp20:format-dateTime(dateTime as string, format as string)

  •   dateTime – The dateTime to be formatted
  •    format – The format for the output
Format String:-

Format Date Time: Year

Example
Expression
2012
[Y0001]
2012
[Y]
12
[Y01]
Two Thousand and Twelve
[YWw]

Format Date Time: Month

 Example
Expression
08
[M01]
8
[M]
VIII
[MI]
August
[MNn]
AUGUST
[MN]
Aug
[MNn,*-3]
AUG
[MN,*-3]

                                      
Format Date Time: Day

Example
Expression
05
[D01]
5
[D]
5
[D1]
31st
[D1o]
Tuesday
[FNn]


Format Date Time: Hour

Example
Expression
3
[h]
9
[H]
08
[H01]


Format Date Time: Minute
Example
Expression
03
[m01]
3
[m]

Format Date Time: Second
Example
Expression
09
[s01]
9
[s]

Format Date Time: Millisecond
Example
Expression
257
[f001]

Format Date Time: AM/PM
Example
Expression
PM
[PN]
Am
[Pn]


Format Date Time: GMT
Example
Expression
GMT+02:00
[z]



Example:-

xp20:format-dateTime(xp20:current-dateTime(),"[D01]/[M01]/[Y0001] [H01]:[m01]:[s01]")

add-dayTimeDuration-from-dateTime:

This function returns a new date time value adding dateTime to the given duration.
If the duration value is negative, then the resulting value precedes dateTime.

xp20:add-dayTimeDuration-from-dateTime(dateTime as string, duration as string)
  • dateTime as string – The dateTime to which the function adds the duration, in string format.
  • duration as string – The duration to add to the dateTime, or subtract if the duration is negative, in string format.
Duration:-

    P1D - a day
    P7D - a week
    P1M - a month
    P1Y1DT1H1S - One year, one day, one hour and one second
    PT5M - five minutes
Example:-

xp20:add-dayTimeDuration-to-dateTime(xp20:current-date(), 'P1D')

subtract-dayTimeDuration-from-dateTime:
This function returns a new dateTime value after subtracting duration from dateTime.
If the duration value is negative, then the resultant dateTime value follows input-dateTime value.

xp20:subtract-dayTimeDuration-from-dateTime(dateTime as string, duration as string)
  • dateTime as string – The dateTime from which the function subtracts the duration, in string format.
  • duration as string – The duration to subtract to the dateTime, or add if the duration is negative, in string format.

Duration:-

    P1D - a day
    P7D - a week
    P1M - a month
    P1Y1DT1H1S - One year, one day, one hour and one second
    PT5M - five minutes

Example:-
xp20:subtract-dayTimeDuration-from-dateTime(xp20:current-date(), 'P1D')