Tuesday, December 28, 2010

Pack & UnPack

BEA provides several tools for creating domains and templates: the Configuration Wizard, the Domain Template Builder, WLST Offline, and the pack and unpack commands. The pack and unpackcommands provide a simple, one-step method for creating domains and templates from the command line. They do not, however, allow you to customize the contents of your domain or template in the same way as the other tools.


The command is residding at wlserver/common/bin


Although the pack command does not allow you to customize the contents of your template in the same way as the Domain Template Builder, it is a useful tool for quickly creating the following:

  • A domain template that contains a snapshot of an entire working domain that has been customized through the Administration Console, Configuration Wizard, or WebLogic Scripting Tool (WLST). This template can then be used to create a domain using unpack, the Configuration Wizard, or WebLogic Scripting Tool (WLST) Offline.
  • A Managed Server template that contains a subset of the files in a domain that are required to create a Managed Server domain directory hierarchy on a remote machine. You can then useunpack to create the Managed Server domain directory on the remote machine.  
About Domain and Managed Server Templates: The term template refers to a Java Archive (JAR) file that contains the files and scripts required to create a domain

  • Domain template—defines the full set of resources within a domain, including infrastructure components, applications, services, security options, and general environment and operating system options. Using the pack command, you can create a domain template from an existing domain. A domain template is used to create a new domain.
  • Managed Server template—defines the subset of resources within a domain that are required to create a Managed Server domain directory on a remote machine. You create a Managed Server template using the pack command, with the -managed=true option. Subsequently, when you use the Managed Server template with the unpack command, the Managed Server domain directory that is created contains sufficient bootstrap information to start the Managed Server on the remote machine. You can start the Managed Server on the remote machine in either of two ways: using Node Manager, or using customized start scripts created when you unpacked the template on the remote machine.


pack

The pack command creates a template archive (.jar) file that contains a snapshot of either an entire domain or a subset of a domain. You can use a template that contains a subset of a domain to create a Managed Server domain directory hierarchy on a remote machine.
The following table describes the files and directories that are included in both domain and Managed Server templates.
When you create this type of template . . .
The following occurs . . .
Domain
All files and directories in the source domain are included, with the following exceptions:
  • Temporary files that are created when you start a server.
  • The servers directory.
  • Files in the security directory that are created automatically when you create the domain, such as DefaultAuthenticatorInit.ldift andXACMLRoleMapperInit.ldift.
Note:If you configured additional security data, such as for users, groups, or roles, through the WebLogic Server Administration Console or other online tools, the security data is stored in the LDAP server and is not included in the template. You must first export the data and then import it into the target domain.
Managed Server (using the -managed=trueoption)
The following files and directories are included by default:
  • All files in the root directory with the following extensions: .cmd.sh.xml.properties, and.ini.
  • Any files with the.pem extension defined in the SSL configuration for your domain
  • bin directory
  • lib directory
  • All files and subdirectories in the config directory
The following files and directories are not included in a Managed Server template by default:
  • Applications and certain application initialization files
  • Temporary files that are created when you start a server
  • The servers directory
  • Files in the security directory that are created automatically when you create the domain, such as DefaultAuthenticatorInit.ldift andXACMLRoleMapperInit.ldift.
Note:The config.xml file of the domain from which you are creating your template must contain Managed Server definitions that specify the IP address and port for the target remote machine. The Managed Server template that you create from that domain can only be used, with the unpack command, on the specified remote machines to create Managed Server domain directories for the Managed Servers defined in the config.xml file.

Example

Executing the following command using a domain named mydomain in the directory C:\bea\user_projects\domains creates a template file named mydomain.jar in the directoryC:\bea\user_templates. The name of the template is specified as My WebLogic Domain.

pack -domain=C:\bea\user_projects\domains\mydomain
-template=C:\bea\user_templates\mydomain.jar -template_name="My WebLogic Domain"

unpack

Creates a full domain or a subset of a domain used for a Managed Server domain directory on a remote machine. You may use unpack only with a template compatible with your current installation. The template can be any of the following:
  • A domain template provided by BEA and packaged with your current installation
  • A domain template created using the Domain Template Builder or WLST Offline
  • A domain template created using the pack command
  • A Managed Server template created using the pack command. A Managed Server template, by default, contains only the files necessary for creating a Managed Server domain directory.
When you use the unpack command with a domain template, it creates a domain containing all of the application and resource files defined in the template. It also creates necessary start scripts, and certain security and configuration files.
When you use the unpack command with a Managed Server template, it creates a Managed Server domain directory that includes the following:
  • A customized start script for each Managed Server in the domain
  • config_bootstrap.xml file (based on the config.xml in the template)
  • nm_password.properties file
  • SerializedSystemIni.dat file
An entry for the Managed Server domain directory is also created in the NM_HOME/nodemanager.domains file, where NM_HOME designates the Node Manager installation directory for the product installation on the remote machine. By default, this directory is located in WL_HOME/common/nodemanager, for example, C:\bea\weblogic92\common\nodemanager\nodemanager.domains.

Note:By default, application files are not included in a Managed Server template created using the pack command. If an application in the domain from which you created a Managed Server template was deployed using external_stage mode, the Managed Server domain directory that you create with the unpack command will not contain any of the external_staged applications. Before you start the Managed Server, you will need to make sure that it has access to the externally staged application files. For more information, see Controlling Deployment File Copying with Staging Modes in Deploying Applications to WebLogic Server.

Example

Executing the following command using a template named mydomain.jar in the directory C:\bea\user_templates creates a domain named my_new_domain in the directoryC:\bea\user_projects\domains.
unpack -template=C:\bea\user_templates\mydomain.jar -domain=C:\bea\user_projects\domains\my_new_domain
Use pack to Create a Managed Server Template
You create a Managed Server template by executing the pack command, with the -managed=true option, on an existing domain that already includes the definition of one or more Managed Servers. This domain must also contain Managed Server definitions in the config.xml file.
  1. From the command line on the local machine (that is, the machine that contains the Administration Server and the definition of Managed Servers), navigate to the WL_HOME\common\bindirectory. In this pathname, WL_HOME is the product directory in which you installed WebLogic Server.
  2. Execute the following command:
  3. pack -managed=true -domain=domain
    -template=template.jar -template_name="template_name"
    
    In this command line:
    • domain—The full or relative path to the domain from which the template is to be created.
    • template.jar—The full or relative path to the template, and the filename of the template to be created.
    • template_name—Descriptive name for the template enclosed in quotes.
    • For example, executing the following command creates a Managed Server template named mydomain_managed.jar from a domain named mydomain.
      pack -managed=true -domain=C:\bea\user_projects\domains\mydomain
      -template=C:\bea\user_templates\mydomain_managed.jar
      -template_name="My Managed Server Domain"
Use unpack to Create a Managed Server on a Remote Machine
  1. Install WebLogic Server on each machine that you want to host a Managed Server for the domain.
  2. Note:All WebLogic Server instances within a domain must run the same version of the WebLogic Server software. For more information about installing WebLogic Server, see the Installation Guide.
  3. Establish a session with the remote machine that will host the Managed Server. You may use any valid method, such as telnet, to do so.
  4. Note:The IP address and port number of the remote machine must match the definition of the Managed Servers specified in the Managed Server template.
  5. Copy the Managed Server template to the remote machine. For details about how to create a Managed Server template, see How Do I: Use pack to Create a Managed Server Template.
  6. On the remote machine, navigate to the WL_HOME\common\bin directory. In this pathname, WL_HOME is the product directory in which you installed WebLogic Server.
  7. Execute the following command, using the Managed Server template that you copied to the machine in Step 3.
  8. unpack -domain=domain -template=template.jar
    
    In this command line:
    • domain—The full or relative path to the domain to be created.
    • template.jar—The full or relative path to the template from which the domain is to be created.
    • For example, executing the following command using a template named mydomain_managed.jar creates a domain named myManagedDomain.
      unpack -domain=C:\bea\user_projects\domains\myManagedDomain
      -template=C:\bea\user_templates\mydomain_managed.jar

 Start Managed Servers on a Remote Machine

When you create a domain directory for Managed Servers using the unpack command, it contains a customized start script for each Managed Server targeted to the current remote machine. For example, if you create a domain that contains two Managed Servers, my_managed_server1 and my_managed_server2, and you target the servers to machine m1, when you create the Managed Server domain directory on machine m1, four custom start scripts are created: startmy_managed_server1.cmd/startmy_managed_server1.sh andstartmy_managed_server2.cmd/startmy_managed_server2.sh. You can use these scripts to start the corresponding Managed Servers. Alternatively, you can use the startManagedWebLogicscript with the required parameters.
  1. Start the Administration Server for the domain as described in Starting and Stopping Servers in Managing Server Startup and Shutdown.
  2. On the remote machine, navigate to the directory for the domain that you created in How Do I: Use unpack to Create a Managed Server on a Remote Machine.
  3. Start the Managed Server on the remote machine by doing one of the following:
    • On a Windows system, open an MS-DOS command prompt window and enter one of the following at the prompt:
    • startmy_managed_server
      startManagedWebLogic my_managed_server admin-url
    • On a UNIX system, enter one of the following at the prompt:
    • ./startmy_managed_server.sh
      ./startManagedWebLogic.sh my_managed_server admin-url
      In these command lines, my_managed_server is the name of the Managed Server to be started and admin-url specifies the listen address (host name or IP address) and port number of the machine hosting the Administration Server. For your convenience, the startManagedWebLogic_Readme.txt file provides a list of all the Managed Servers and the admin-url for the domain. http://download.oracle.com/docs/cd/E13179_01/common/docs92/pack/tasks.html

Thursday, November 18, 2010

My Findings

For DB the sid is nothing but name of the database

when db was down it will through
weblogic.common.resourcepool.ResourceDeadException: Could not create pool connection. The DBMS driver exception was: [BEA][Oracle JDBC Driver][Oracle]ORA-12505 Connection refused, the specified SID (XE) was not recognized by the Oracle server. at weblogic.common.resourcepool.ResourcePoolImpl.checkAndReturnResource(ResourcePoolImpl.java:1445) at weblogic.common.resourcepool.ResourcePoolImpl.checkAndReturnResource(ResourcePoolImpl.java:1401) at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:329) at


A complete message could not be read on socket: 'weblogic.rjvm.t3.T3JVMConnection'" on WebLogic :
weblogic.rjvm.PeerGoneException: ; nested exception is: java.io.IOException: A complete message could not be read on socket: 'weblogic.rjvm.t3.T3JVMConnection@12c22dd4', in the configured timeout period of '60' secs
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)



for this we can increase timeout period by setting the parameters 
-Dweblogic.CompleteT3MessageTimeout=<value in seconds>
-Dweblogic.CompleteMessageTimeout=<value in seconds>



T3 Protocol in WebLogic Server:

T3 is Oracle WebLogic Server's proprietary RMI protocol. Basically, t3 protocol is a protocol that sits on top of Java RMI. There is some documentation available.
RMI communications in WebLogic Server use the T3 protocol to transport data between WebLogic Server and other Java programs, including clients and other WebLogic Server instances.
If you need to control T3 access through a firewall, you may use the protocol filter "T3".

Any two Java programs with a valid T3 connection—such as two server instances, or a server instance and a Java client—use periodic point-to-point “heartbeats” to announce and determine continued availability. Each end point periodically issues a heartbeat to the peer, and similarly, determines that the peer is still available based on continued receipt of heartbeats from the peer.
  • The frequency with which a server instance issues heartbeats is determined by the heartbeat interval, which by default is 60 seconds.
  • The number of missed heartbeats from a peer that a server instance waits before deciding the peer is unavailable is determined by the heartbeat period, which by default, is 4. Hence, each server instance waits up to 240 seconds, or 4 minutes, with no messages—either heartbeats or other communication—from a peer before deciding that the peer is unreachable.
  • Changing timeout defaults is not recommended.
java.lang.NumberFormatException: null from the Embedded LDAP:

This is happens because of corruption of EmbededLdap file
we can fix this issue by removing replica.props under data/ldap/config else change the prop file add replica.num=0


Weblogic server dint support mixed jdk version for the same domain.
Message bridge cant work if u specify the name of domain and jms resources are same.


Some times we find that our access.log are not updating this is because the server buffer the logs upto its default value 8kb and once it fills then it directs to our disk. By putting these flags we can set the buffer size to 0
-Dweblogic.logging.bufferSizeKB={BUFFER SIZE (KB)}
-Dweblogic.logging.bufferSizeKB=0 



We can cahnge jdk to jrocket easily by changing the java home in setDomainEnv.cmd then the server will start using jrocket

Domain Creation in console mode

[root@unknown000c2996ab4a bin]# ./config.sh -mode=console





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Welcome:
--------

Choose between creating and extending a domain. Based on your selection, the Configuration Wizard guides you through the steps to generate a new or extend an
existing domain.

 ->1|Create a new WebLogic domain
    |    Create a WebLogic domain in your projects directory. 

   2|Extend an existing WebLogic domain
    |    Extend an existing WebLogic domain.  Use this option to add applications and services, or to override existing database access (JDBC) and messaging (JMS)
    |settings. You can also incorporate additional functionality in your domain, for example, by including AquaLogic Service Bus.





Enter index number to select OR [Exit][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select Domain Source:
---------------------

Select the source from which the domain will be created. You can create the domain by selecting from the required components or by selecting from a list of
existing domain templates.

 ->1|Choose Weblogic Platform components
    |    You can choose the Weblogic component(s) that you want supported in your domain.

   2|Choose custom template
    |    Choose this option if you want to use an existing  template. This could be a custom created template using the Template Builder.





Enter index number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> Required





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x


    ** Invalid input, only integer selection or page movement command are
    ** accepted: Required


Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                                         |
   3| *Confirm user password: |                                         |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"




Enter option number to select OR [Exit][Previous][Next]> p 





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> p





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select Domain Source:
---------------------

Select the source from which the domain will be created. You can create the domain by selecting from the required components or by selecting from a list of
existing domain templates.

 ->1|Choose Weblogic Platform components
    |    You can choose the Weblogic component(s) that you want supported in your domain.

   2|Choose custom template
    |    Choose this option if you want to use an existing  template. This could be a custom created template using the Template Builder.





Enter index number to select OR [Exit][Previous][Next]> p





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Welcome:
--------

Choose between creating and extending a domain. Based on your selection, the Configuration Wizard guides you through the steps to generate a new or extend an
existing domain.

 ->1|Create a new WebLogic domain
    |    Create a WebLogic domain in your projects directory. 

   2|Extend an existing WebLogic domain
    |    Extend an existing WebLogic domain.  Use this option to add applications and services, or to override existing database access (JDBC) and messaging (JMS)
    |settings. You can also incorporate additional functionality in your domain, for example, by including AquaLogic Service Bus.





Enter index number to select OR [Exit][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select Domain Source:
---------------------

Select the source from which the domain will be created. You can create the domain by selecting from the required components or by selecting from a list of
existing domain templates.

 ->1|Choose Weblogic Platform components
    |    You can choose the Weblogic component(s) that you want supported in your domain.

   2|Choose custom template
    |    Choose this option if you want to use an existing  template. This could be a custom created template using the Template Builder.





Enter index number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                                         |
   3| *Confirm user password: |                                         |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"




Enter option number to select OR [Exit][Previous][Next]> 2





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    "*User password:" = []




Enter new *User password: OR [Exit][Reset][Accept]>




<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                ********                 |
   3| *Confirm user password: |                                         |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"
    5 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]> 3





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    "*Confirm user password:" = []




Enter new *Confirm user password: OR [Exit][Reset][Accept]>




<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                ********                 |
   3| *Confirm user password: |                ********                 |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"
    5 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Domain Mode Configuration:
--------------------------

Enable Development or Production Mode for this domain.

 ->1|Development Mode

   2|Production Mode




Enter index number to select OR [Exit][Previous][Next]> 2





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Java SDK Selection:
-------------------

 ->1|JRockit SDK 1.5.0_12 @ /Weblogic/apps/weblogic9.23/jrockit_150_12
   2|Sun SDK 1.5.0_12 @ /Weblogic/apps/weblogic9.23/jdk150_12
   3|Other Java SDK




Enter index number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Choose Configuration Option:
----------------------------

    *Do you want to modify any of the preconfigured settings or defaults in your template?
    *
    *To keep the default or template settings, and proceed directly to name and create your domain, leave No selected.

   1|Yes

 ->2|No





Enter index number to select OR [Exit][Previous][Next]> 2





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select the target domain directory for this domain:
---------------------------------------------------

    "Target Location" = [Enter new value or use default "/Weblogic/apps/weblogic9.23/user_projects/domains"]




Enter new Target Location OR [Exit][Previous][Next]> /Weblogic/domains/weblogic9/test1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  |    Value    |
   _|________|_____________|
   1| *Name: | base_domain |




Enter value for "Name" OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: |   1   |

Use above value or select another option:
    1 - Modify "Name"
    2 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: |   1   |
Enter option number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: |   1   |




Enter value for "Name" OR [Exit][Previous][Next]> test1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: | test1 |

Use above value or select another option:
    1 - Modify "Name"
    2 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Creating Domain...

0%          25%          50%          75%          100%
[------------|------------|------------|------------]
[***************************************************]


**** Domain Created Successfully! ****

It will crearte a domain in particular directory, 
for ex: the name of the domain is test1 need to create at /root/bea/web9.2. Just give the till where to create and it will create the folder automatically. 

-----------------------

 Available Templates
    |_____WebLogic Server (Required)x
    |_____Workshop for WebLogic Platform [2]



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>