Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Wednesday, 22 January 2014

How to change Node Manager port in Oracle WebLogic Server

Some times when you try to start a managed server with node manager it may fail with the below error ín the 'nodemanager' log file saying that 'port 5,556: java.net.BindException: Address already in use: JVM_Bind>'' which means the specific port '5556' is already binded and is in use by some other process. 
<23 Jan, 2014 6:25:56 AM IST> <SEVERE> <The server is unable to create a server socket for listening. The address localhost might be incorrect or another process is using port 5,556: java.net.BindException: Address already in use: JVM_Bind>
Now you need to change the node manager port to some other port number to avoid theport conflict error. Please follow the below steps:

1) Go to nodemanager.properties file located in yourdomainname\nodemanager

Generic Path: C:\Oracle\Middleware\Oracle_Home\user_projects\domains\NodeDomain\nodemanager

Open the nodemanager.properties file and change the 'Listen Port' value to some other port which is not used.

2) Then login into the Weblogic Admin Console on the left pane yourDomainName --> Environment --> Machines

Click on the Machine name which is configured for the relative managed server. 

Click on 'Node Manager' and the on 'Lock and Edit' on the left pane

Change the 'Listen port' then Save and click on 'Release Configuration'

 Now no more re-starts are necessary. You can even monitor the node manager status from console by clicking on 'Monitoring' here.

Thursday, 16 January 2014

Pack and Unpack Command in Oracle Weblogic Server with Example

If you want to make use of an existing domain configuration while creating a new domain you can make use of pack and unpack commands.  The pack command creates a template .jar archive file that contains entire WebLogic domain or a subset of a WebLogic domain.
In the sense 'Pack' command will create a template on top of the existing domain.

pack command will be located in the generic path


 'C:\Oracle\Middleware\Oracle_Home\wlserver\common\bin' 
pack.cmd (windows)
pack.sh (unix)
Syntax:
pack -domain=domain -template=template -template_name="template_name"
The below parameters are optional: 
[-template_author="author"][-template_desc="description"] [-managed=true|false] [-log=log_file] [-log_priority=log_priority]

It is suggested to keep the log parameter, such that you can find the if any errors in creating the template

Example:

pack -domain=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp -template=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp\Temp.jar  -template_name="TempDom" -template_author="King" -template_desc="Temp Domain Template" -managed=true -log=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp\tempdom.log
Remember the while giving the template name it should be added with 'jar' extension. This will create the 'Temp.jar' in the location C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp

The unpack command will create a full WebLogic domain or a subset of a domain that is used for a Managed Server domain directory on the target machine.

unpack -template=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp\Temp.jar -domain=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\mynewdomain

Sntax:
unpack -template=template -domain=domain
The below parameters are optional:

[-user_name=username] [-password=password] [-app_dir=application_directory] [-java_home=java_home_directory] [-server_start_mode=dev|prod] [-log=log_file] [-log_priority=log_priority] [-overwrite_domain]

Example:

unpack -template=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp\Temp.jar -domain=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\unpackedDomain
This command will create a new domain called 'unpackedDomain' in the path C:\Oracle\Middleware\Oracle_Home\user_projects\domains\
 
Sample log of the pack command:

2014-01-16 22:45:36,266 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - read domain from "C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp"
2014-01-16 22:45:45,600 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - succeed: read domain from "C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp"
2014-01-16 22:45:45,602 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - set config option Managed to "true"
2014-01-16 22:45:45,698 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - succeed: set config option Managed to "true"
2014-01-16 22:45:45,699 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - write template to "C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp\Temp.jar"
2014-01-16 22:45:47,589 INFO  [Thread-2] com.oracle.cie.domain.TemplateGenerator - Template Generation Successfull!
2014-01-16 22:45:47,604 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - succeed: write template to "C:\Oracle\Middleware\Oracle_Home\user_projects\domains\Temp\Temp.jar"
2014-01-16 22:45:47,604 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - close template
2014-01-16 22:45:47,605 INFO  [runScript] com.oracle.cie.domain.script.ScriptExecutor - succeed: close template