Tuesday, 18 March 2014

[BEA-310003] OutofmemoryError when starting Weblogic


To solve out of memory error on Windows 7 64 bit platform, ensure the following

Open  <WL_HOME>\common\bin\commEnv.cmd

set  JAVA_HOME=<64 bit JDK Home>

set  JAVA_VENDOR=Oracle

set JAVA_USE_64BIT=true

Save the commEnv.cmd

Open domain\bin\setSOADomainEnv.cmd

Set the memory options as follows

set JAVA_OPTIONS=%JAVA_OPTIONS%
set DEFAULT_MEM_ARGS=-Xms1024m -Xmx2048m -XX:MaxPermSize=1024m -XX:CompileThreshold=8000
set PORT_MEM_ARGS=-Xms1024m -Xmx2048m -XX:MaxPermSize=1024m -XX:CompileThreshold=8000

if "%JAVA_VENDOR%" == "Oracle" goto OracleJVM
set DEFAULT_MEM_ARGS=%DEFAULT_MEM_ARGS% -XX:PermSize=512m -XX:MaxPermSize=1024m
set PORT_MEM_ARGS=%PORT_MEM_ARGS% -XX:PermSize=512m -XX:MaxPermSize=1024m


Save setSOADomainEnv.cmd

Restart the server

Configuration plans for Oracle SOA Composites



Deployments of SOA composite(s) onto a SOA server environment is one of the challenging task for a SOA Developer/Admin, more so when certain composite or components parameters will need to be set differently from one server environment to another.  For instance, a composite with DB Adapter poller component deployed on a multi-node server(Clustered environment) will need to have a singleton property set to true to ensure that only one instance of adapter is triggered for a transaction. However, the singleton property may not hold good in a single node environment. The values of such properties and many such changes can be handled using the configuration plan during deployment of composites.


Unlike Java applications, SOA composite applications do not rely on property files to maintain environment specific configuration. Many SOA projects may include references to other external services, for example, http://payment-processing-server-dev:7777/proc/servlet/createCustomer. As you can see from this URL, the developer is referencing some external development server as identified by the hostname payment-processing-server-dev. This URL is hardcoded within the code and ultimately included within the deployable SAR. Prior to deploying this code to the test environment, the administrator must find a way to ensure that the test URL is referenced instead (which may have a different host, port, and protocol) as shown by https://payment-processing-server-test:7778/proc/servlet/createCustomer.


The configuration plan is applied to the composite during deployment. In this post, let's look at the way to generate a configuration plan, explain different section of a configuration plan and few of the ways the plan can be applied during composite deployments. Normally, the case is a developer's environment will not have any configuration plan and the default values specified in the project files are taken into account during composite deployment (It's true in the projects that I  had worked until now). The configuration plan is applied during composite deployment in server environment higher up to the development like test and production environments and values of the development environment can be over-ridden to environment specific values. Note that the configuration plan can also be defined at the SOA application level in which case it is applied to all projects within that application. In this post, to keep it simpler let's look at the plan being defined at the project level.



Generate a Configuration Plan
In order to create a configuration plan in JDeveloper, right click on the composite.xml file of the project and then select the Generate Config Plan option. 


Key in a meaningful value to your configuration plan file name and then click on Ok (I generally suffix the plan name with the environment name, that way one will know to which environment is the configuration plan will need to be applied as in my case I had a different config plan for stage and production environments).




Configuration Plan Explained
The configuration plan of the project so generated will contain changes to be done at two levels - composite.xml file, and the other to the WSDL and schema files defined in the project.


The composite section in turn contains different sub sections - import, component, service and reference sub sections. Key in the appropriate values to search and replace the URL/properties of sub sections to suit to your deployment environment.



The wsdlAndSchema section by default points to all the wsdl, schema and jca files in the project where a search and replace rules are mentioned. Change them with appropriate search and replace strings




Additionally, you can validate the configuration plan for valid tags and its syntax using the Validate Config Plan option of the menu popped up when you right click on the composite.xml file.

Applying Configuration plan during composite deployment

Configuration plan can be applied to the composite during deployment onto the server. Two such ways are mentioned below:
1. Using JDeveloper in the deployment wizard, while deploying to SAR file or to application server as shown below: 





2. In the Weblogic EM console, while deploying the Service Archive (SAR) file onto the server partition

Once deployed, you can validate if the properties specific to deployment environment mentioned in the configuration plan applied to the composites in the EM console.



                                                                                                     By DeepthiReddy

Saturday, 15 March 2014

Error Starting Weblogic Admin Server: Could not reserve enough spacefor object heap



The first time that I run my weblogic admin server after installing and configuring oracle soa in weblogic 10.3.6, I encountered the following error:
Could not reserve enough space for object heap.
Could not create the Java virtual machine.

I resolved this by creating a new environment variable called EXTRA_JAVA_PROPERTIES with the following value "-Xms512m -Xmx512m".
From the JDeveloper 11g Release Notes:
Running applications with limited free memory (7343786)

Under certain circumstances, if you do not have enough free memory available, you may receive an error when running an application:

Error occurred during initialization of VM
Could not reserve enough space for object heap

Normally you would resolve this by adding -Xms and -Xmx arguments to the project's Run/Debug profile. However, there are existing entries for these settings in the WebLogic startup that will override the project's settings. The proper way to resolve this error is to add EXTRA_JAVA_PROPERTIES to your environment, as follows:

On Linux
setenv EXTRA_JAVA_PROPERTIES "-Xms512m -Xmx512m"

On Windows
set EXTRA_JAVA_PROPERTIES="-Xms512m -Xmx512m"

Important update to this post!

"-Xmx512" is not sufficient to run and test an application in a SOA server, because it would be incredibly slow. If you encounter the above issue using the default config of "-Xmx1024m", then try to decrease the number until it will work. There is no hard rule, you could try "-Xmx1000m" for instance. If it still doesn't work, then try decreasing the number again.
Alternate Method :

Error

"Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine. "


Reason for this error is when we make changes memory variable and assign more memory and we don't have enough memory available... server startup is failed with this error.

Solution

You can remove this error while decreasing heap size in setSOADomainEnvt.cmd

%ORACLE_HOME%\user_projects\domains\DOMAIN\BIN\setSOADomainEnvt.cmd

set DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m
set PORT_MEM_ARGS=-Xms768m -Xmx1536m
set DEFAULT_MEM_ARGS=%DEFAULT_MEM_ARGS% -XX:PermSize=128m -XX:MaxPermSize=512m
set PORT_MEM_ARGS=%PORT_MEM_ARGS% -XX:PermSize=256m -XX:MaxPermSize=512m
 
 
I have lowered my heap to below values


set DEFAULT_MEM_ARGS=-Xms768m -Xmx768m
set PORT_MEM_ARGS=-Xms768m -Xmx768m


instead of


set DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m
set PORT_MEM_ARGS=-Xms768m -Xmx1536m
                                                                                                             By DeepthiReddy

Installing Oracle SOA-BPM Release 11gR1 (11.1.1.7.0)


This blog describes how to install SOA-BPM Suite (including Oracle Service Bus) from scratch on Windows 7 64bit machine.


Step1: Downloading Required Software.


Go to Oracle SOA suite download page here.
Under Oracle SOA Suite 11g Installations, select release 11.1.1.7 and then Generic 64-bit JVM.


JDK 64 bits from Sun  jdk-6u27-windows-x64.exe
Database  - Oracle XE Universal - OracleXE112_Win32.zip
Oracle WebLogic Server 10.3.6 - wls1036_generic.jar
Repository Creation Utility 11.1.1.7.0 - ofm_rcu_win_11.1.1.7.0_32_disk1_1of1.zip    
SOA Suite 11.1.1.7.0 (2 parts)
  ofm_soa_generic_11.1.1.7.0_disk1_1of2.zip
  ofm_soa_generic_11.1.1.7.0_disk1_2of2.zip
Oracle Service Bus 11.1.1.7.0 ofm_osb_generic_11.1.1.7.0_disk1_1of1.zip
OEPE Windows All-In-One (x86 64-bit) oepe-indigo-all-in-one.zip
JDeveloper 11.1.1.7.0 Generic (jar)  jdevstudio11117install.jar
JDeveloper extension for SOA - download here

Create c:\stageFMW to hold the download files used for installation 

Step2: Installing the JDK.


JDK, SOA Suite, OEPE and OSB will be installing to the middleware home (C:\Middleware\ SOASuite11gR1PS6). If you use a different middleware home then adjust accordingly.
Provide folder name as C:\Middleware\ SOASuite11gR1PS6\JDK160_27 as shown below and install the JDK 64 bit
Click Ok.


<!--[endif]-->



<!--[endif]-->











Click Next and finish

















Step 3: Installing Database:

Run file OracleXEUniv.exe and install the XE database. You may refer the Oracle XE installation guide.
After installing XE, run below commands to meet the requirements of SOA 11g installation –

connect sys/password as sysdba;
alter system set processes=500 scope=spfile;
shutdown immediate;











Start database.











If you are using Oracle XE as your database, you need to set the RCU_JDBC_TRIM_BLOCKS environment variable to TRUE prior to running RCU.

















Step 4: Install database schema using RCU


Run the Repository Creation Utility (RCU) to create the database schemas:













Click Next
















Enter the database information.



Ignore any warning messages during installation.
Select the component SOA and BPM Infrastructure. Dependent schemas are selected automatically.  



















Select the radio button to Use the same password for all schemas. Enter a schema password.




























Click Create to create the tables.




On “Completion Summary” page you should see success status for all the components you chosen.



















Step 5: Install WebLogic 10.3.6 Server 64 bits on windows


In a command window enter
Cd C:\stageFMW\Weblogic
java -D64 -Xmx1024m -jar wls1036_generic.jar




Click Next

Select Create a new Middleware Home and enter C:\Middleware\SOASuite11gR1PS6. If you use a different middleware home then adjust accordingly.


















Deselect the checkbox to receive security updates and Click Next.


(If you are behind firewall or using using proxy to connect internet then wizard may not show next window immediately. Deselect multiple times till you receive the below window.)
Select the check box as shown below to disable internet access.


 Select Typical installation and Click Next.


 As we downloaded the generic version of Weblogic, Select the installed JDK (C:\Middleware\SOASuite11gR1PS6\jdk160_27). 



Review the directories and Click Next.



 You will see the installation summary. Click next.


 Uncheck ‘Run Quickstart’ and Click Done when the installation completes.


Step6: Install SOA Suite – Base Components


In a command window enter (-jreLoc JDK installation location)
cd C:\stageFMW\SOA\Disk1
setup.exe -jreLoc C:\Middleware\SOASuite11gR1PS6\jdk160_27

(-jreLoc point to the JDK installation location)








Click Next.

















Skip software updates and click Next.

















Click Next. After the prerequisite check.

















On the Specify Installation Location screen, select the 
Middleware home: C:\Middleware\SOASuite11gR1PS6
 Accept the default Oracle home: Oracle_SOA1

















Click Next


















Accept the default on the Application Server page and click Next
Review summary
Click Install 


















Wait for the install to complete – takes a few minutes.

When install reaches 100%, click Next


















Click Finish
















Step 7: install OEPE


Unzip the oepe-indigo-all-in-one-11.1.1.8.0.201110211138-win32-x86_64.zip to the folder C:\Middleware\SOASuite11gR1PS6\oepe11118



Step 8: Service Bus installation


In a command window enter 
cd c:\stageFMW\OSB\Disk1 
setup.exe -jreLoc C:\Middleware\SOASuite11gR1PS6\jdk160_27










Click Next
















Select “Skip Software Updates” and click Next 

















On the Specify Installation Location screen, select the Middleware home: 
C:\Middleware\SOASuite11gR1PS6 
Accept the default Oracle home: Oracle_OSB1 


















For the installation type, select Typical and press Next.

















Click Next. After the prerequisite check.


















Select the OEPE location C:\Middleware\SOASuite11gR1PS6\oepe11118. Click Next and Install

















Once the installation process has finished, press the Next button

















The installation is now complete. Press the Finish button to exit the installer.

















Step 9: Create a SOA Developer Domain


In a command window enter
Cd C:\Middleware\SOASuite11gR1PS6\wlserver_10.3\common\bin
Config.cmd








When the configuration wizard welcome screen comes up, select Create a new WebLogic 
domain, click Next   Select “Generate a domain….“ and select 
a) Oracle SOA Suite for developers – 11.1.1.0 [Oracle_SOA1]: This automatically selects 
Oracle WSM Policy Manager – 11.1.1.0 [oracle_common] 
b) Oracle Enterprise Manager – 11.1.1.0 [oracle_common] 

Optional (dependant on the components you want to use): 
c) Oracle Service Bus for developers – 11.1.1.7 [Oracle_OSB1]: This automatically selects 
WebLogic Advanced Web Services for JAX-RPC Extension – 10.3.6.0 [wlserver_10.3] 
d) Oracle Business Activity Monitoring – 11.1.1.0 [Oracle_SOA1] 
e) Oracle BPM Suite for developers – 11.1.1.0 [Oracle_SOA1] 
f) Oracle JRF WebServices Asynchronous services – 11.1.1.0 [oracle_common]

Click Next 















Enter the domain name, e.g. soaosbps6devdomain and choose a location of your choice. Click Next
















 Enter user name weblogic and a password welcome1.
















Click Next
















On the Configure JDBC Component Schema screen, you select the components that you want to change, and then enter the property value for those components. 
First, select all of the components and enter password in the Schema Password field. 
Or, if you used a different password when you created the schema with RCU, enter that password.  With all of the check boxes still selected, enter the Service, Host, and Port values
















The data source connections are all tested.
If all are successful, click Next, otherwise click Previous and correct any errors.
















Click Next
















Click Next
















Uncheck the check box (start the admin server) and Click Done.

















Step 10: Installing JDeveloper and JDev SOA Extension

In a command window enter 
cd c:\stageFMW\JDev 
java -D64 -Xmx1024m -jar jdevstudio11117install.jar









Click Next
















Use existing middleware Home C:\Middleware\SOASuite11gR1PS6
















Error window will be displayed as shown below.












So select a new Middleware Home directory and provide Middleware Home Directory as  C:\Middleware\SOASuite11gR1PS6\JDev11gR1PS6   to proceed JDeveloper installation.
















Choose Install Type: Complete, click Next
  















Select the installed JDK (C:\Middleware\SOASuite11gR1PS6\jdk160_27). Click Next
















Confirm Product Installation Directories. Click Next
















Click Next
















Review Installation Summary. Click Next.
















Wait for the installation to complete – a few minutes. Click Next
















When installation completes, deselect Run Quickstart and click Done.

Start JDeveloper Studio 11.1.1.7.0 from the Windows Programs menu: Oracle Fusion Middleware 11.1.1.7.0

 or run C:\Middleware\SOASuite11gR1PS6\JDev11gR1PS6\jdeveloper\jdeveloper.exe









Select Default Role, de-select Always prompt for role selection on startup, and click OK















If you see the Confirm Import Preferences dialog click Yes or No as desired, usually No is appropriate.












Step 11:Update JDeveloper with latest SOA extension



Select Help/Check For Updates















Click Next
















Select install from local file.
Browse for file soa-jdev-extension.zip and open. 
Click Next 















Click Next and Finish.

Click Yes to restart the JDeveloper and finish the installation of the SOA extension.











Step 12:Starting servers

Start the Admin Server

Open command window and enter the command
Cd C:\Middleware\SOASuite11gR1PS6\user_projects\domains\soaosbps6devdomain\bin

startWeblogic.cmd







Admin Server console








Weblogic Admin console URL: http://localhost:7001/console
















Weblogic Enterprise Manager Fusion Middleware Control (EM) console URL: http://localhost:7001/em













Weblogic osb console URL: http://localhost:7001/sbconsole
















Start BAM Server

Open command window and enter the command
Cd C:\Middleware\SOASuite11gR1PS6\user_projects\domains\soaosbps6devdomain\bin

startManagedWeblogic.cmd bam_server1







Enter admin user credentials 
username weblogic  
password welcome1






BAM console











Open internet explorer and type the URL : http://localhost:9001/OracleBAM






                                                                                       Happy Installing
                                                                                      DeepthiReddy