Sunday, July 31, 2011

JMS in weblogic9

How to configure a Queue:


1) Create a JMS server and target to our managed server.
2) Create a jms module and target to managed server
3) Create a connection  factory and target only to our managed server "dont go for AdvancedTargetting" Also dont configure subdeployment for connection factory as it was not a pinned service.
4) Create a destination and go for subdeployment and target to JMS Server.


Thats it configuration done.


How to Configure DistributedDestinations:


1) Create JMSserver-1 and filestore-1 and target to ms1(migratable)
2)  Create JMSserver-2 and filestore-2 and target to ms2(migratable)
3) Create JMS module and targeted to cluster.
4) Create SUBdeployment and targetted to both JMSServer-1 and JMSserver-2.
5) Create connection factory and it will automatically targetted to cluster(because jmsmodule was targeted to the cluster)
6) Create the distributed queue even though it will target to c1(automatically) go for advanced targetting and give it for subdeployment(which was automatically targetted to jmsserver-1 and jmsserver-2)

Thursday, July 28, 2011

URL vs URI

A URI does not have to specify the location of a specific representation

ex:  x.motorola.com/login

A URL is a URI but a URI is not a URL. A URL is a specialization of URI that defines the network location of a specific representation for a given resource

ex:  x.motorola.com/login.jsp

Tuesday, July 26, 2011

NodeManager


1 created 1 Admin and 1 managedin 169.254.17.145
2 created 1 managed in 169.254.208.93

Configuring node manager:
1) created machine for admin and ms1 with their ip and port
2) Go to C:\bea10.3\wlserver_10.3\server\bin take nminstalsvc backup and make the changes
3) created folder nodemanager in C:\Weblogic\apps\nodemanager\nmDomain\nodemanager in 17.145  edited the installservices set NODEMGR_HOST=169.254.17.145
set NODEMGR_PORT=5556 and start the nodemanger
4) you will get nodemanager.properties and nm_data.properties
5) fro CrashRecovery and startupScriptsEnabled:
    We wnat to enable nodemanager to restore from their last known state after server reboot.

6)Enroll the domain in nodemanger:
- run setDomainenv
- java weblogic.WLST
-wls:/offline> connect('weblogic','weblogic','t3://169.254.17.145:5001')
-wls:/nmDomain/serverConfig> nmEnroll(domainDir='C:/Weblogic/apps/nodemanager/nmD
 omain',nmHome='C:/Weblogic/apps/nodemanager/nmDomain/nodemanager')
 Enrolling this machine with the domain directory at C:/Weblogic/apps/nodemanager
 /nmDomain ...
 Successfully enrolled this machine with the domain directory at C:\Weblogic\apps
 \nodemanager\nmDomain.  ---- make sure all are forward slashes.
- now you will get nodemanagers.domain in nodemagers home directory.

7) Prvide the approprivate values to server start in server tab in console

-javahome: C:\bea10.3\jdk160_05
-vendor= oracle
-Bea home=C:\bea10.3\wlserver_10.3
RootDir;C:\Weblogic\apps\nodemanager\nmDomain
Arguments: Xrs for jdk and -Xnohup for jrocket

if you dint provide also no issue you can able to start or stop remotely, but the server dint recovered automatically under any circumstances. If you provide remote start up then only any thing happened it will restart automatically.

So for any servers needs to configure remotely we need to enroll first

Friday, July 22, 2011

Class Loader in weblogic

The class loading hierarchy in the weblogic will be
System -- where commanenv and setdomain env will be called
Domain -- where the domain/.lib libraries will be loaded.
Application -- where application specific jar will be loaded. The root class loader was application loader for an application,
WebApp -- for particular to webapplication. web-inf/lib

So in order to deploy only webapplication without ejb we can inform classloaders to load particular jars in the .xml with the tag <prefer-application-package> from 10.3.4. before <prefer-web-inf-package>. so it will load the classes from web-inf.

We have one good feature in 10.3.4 called FilteringClassLoaders which overrides the classes loaded by weblogic server allowing you to use your libraries.

we have one feature in 10.3.4 Classloader analysis tool -- which check the class conflicts and classpath conflicts. we can also find where the conflict was and help us to resolve the conflict.

we can get the Analysing tool by adding wls-cat at the end of the url of console.

http://www.oracle.com/technetwork/middleware/weblogic/overview/index.html


Thursday, July 21, 2011

How to install patches in weblogic


Installing a Service Pack Upgrade Using Graphical Mode
Follow these steps to download and install a service pack or rolling patch in graphical mode on UNIX and Windows systems:
  1. Download the service pack upgrade installer specific to your platform from the BEA Customer Support Web site at http://support.bea.com.
Note: You will need to log in using your eSupport username and password to download a service pack or rolling patch. If you do not have an eSupport account, you can register for one on the BEA Customer Support Web site.
  1. Start the upgrade installer as described in Table 6-2:
Table 6-2 Starting an Upgrade Installer in Graphical Mode
To start the upgrade installer on this platform . . .
Perform the following steps . . .
Windows
1. Go to the directory where you downloaded the installation program and double-click filename.exe, where filename.exe is name of the installation file you downloaded from the BEA Customer Support Web site, for example, serverXXX_upgrade_win32.exe.
The installation program begins to install the upgrade.
2. Proceed to step 3 below this table.
UNIX
For installers with filenames ending in .bin
1. Go to the directory where you downloaded the installation program and invoke the installation procedure by entering the following commands:
chmod a+x filename.bin
./filename.bin
where filename.bin is the name of the upgrade installation program you downloaded from the BEA Customer Support Web site, for example serverXXX_upgrade_solaris.bin.
The installation program begins to install the upgrade.
2. Proceed to step 3 below this table.
For installers with filenames ending in .jar
1. Include the bin directory of the JVM at the beginning of the PATH variable on the target system. For example:
PATH=JAVA_HOME/bin:$PATH
export PATH
where JAVA_HOME is the full path to the JVM directory.
2. Go to the directory where you downloaded the installation file and launch the installation program by entering the following command:
java -jar filename.jar
where filename.jar is the name of the upgrade installation program you downloaded from the BEA Customer Support Web site, for example pj_serverXXX_upgrade_generic.jar.
The installation program begins to install the upgrade.
3. Proceed to step 3 following this table.

 
  1. Review the text in the Welcome window and click Next.
The Choose BEA Home Directory window is displayed.
Note: You may cancel the installation at any time by clicking Exit.
  1. Select the BEA Home directory containing the release of WebLogic Server you want to upgrade and click Next.
The Confirm Product Directory window is displayed, which includes the path to the BEA home directory and to the directory in which the WebLogic Server software will be updated.
  1. Click Next.
A progress window is displayed during the upgrade installation. When the installation is finished, the Installation Complete window is displayed.
  1. Click Done on the Installation Complete window to exit the installation program.
Installing a Service Pack Upgrade Using Console Mode
Follow these steps to download and install a service pack or rolling patch in console mode on UNIX and Windows systems:
Note: The sample console text and directory pathnames in this section use UNIX conventions (forward slashes) in pathnames, for example, /home1/bea/weblogicXXX. When entering pathnames on a Windows system, use the Windows convention (backward slashes) for pathnames, for example c:\bea\weblogicXXX.
  1. Download the service pack upgrade installer specific to your platform from the BEA Customer Support Web site at http://support.bea.com.
Note: You must log in using your eSupport username and password to download a service pack or rolling patch. If you do not have an eSupport account, you can register for one on the BEA Customer Support Web site.
  1. Start the upgrade installer as described in Table 6-3:
Table 6-3 Starting an Upgrade Installer in Console Mode
To start the upgrade installer on this platform . . .
Perform the following steps . . .
Windows
1. Open an MS-DOS command prompt window.
2. Go to the directory where you downloaded the installation program and invoke the installation procedure by entering the following command:
filename.exe -mode=console
where filename.exe is name of the installation file you downloaded from the BEA Customer Support Web site, for example, serverXXX_upgrade_win32.exe.
The upgrade installer begins to install the WebLogic Server maintenance release.
3. Proceed to step 3 following this table.
UNIX
For installers with filenames ending in .bin
1. Go to the directory where you downloaded the installation program and invoke the installation procedure by entering the following commands:
chmod a+x filename.bin
./filename.bin -mode=console
where filename.bin is the name of the upgrade installation program you downloaded from the BEA Customer Support Web site, for example serverXXX_upgrade_solaris.bin.
The installation program begins to install the upgrade.
2. Proceed to step 3 following this table.
For installers with filenames ending in .jar
1. Include the bin directory of JVM at the beginning of the PATH variable on the target system. For example:
PATH=JAVA_HOME/bin:$PATH
export PATH
where JAVA_HOME is the full path to the JVM directory.
2. Go to the directory where you downloaded the installation file and launch the installation program by entering the following command:
java -jar filename.jar -mode=console
where filename.jar is the name of the upgrade installation program you downloaded from the BEA Customer Support Web site, for example pj_serverXXX_upgrade_generic.jar.
The installation program begins to install the upgrade.
3. Proceed to step 3 following this table.

 
Note: To create a verbose log file during installation, include the -log=/full_path_to_log_file option in the command line.
For example:
serverXXX_upgrade_solaris.bin -mode=console -log=/home/bea/logs/server_install.log
The path can be to a file or folder. All folders in the path must exist before you execute the command or the installation program will not create the log file.
  1. At the Welcome prompt, type next or press Enter to continue with the installation process.
The Choose BEA Home directory prompt is displayed.
  1. Select the BEA Home directory associated with the installation of WebLogic Server that you want to update. If you have only one installation of WebLogic Server installed on the current machine, only one BEA Home directory is listed. For details about the BEA Home directory, see BEA Home Directory.
The installation program displays the following prompt:
Choose BEA Home Directory:
->1| /nfs/home/user1/bea1

  2| /nfs/home/user1/bea2
Enter index number to select OR [Exit][Previous][Next]>
Press Enter to use the selected BEA Home directory or type the number of the BEA Home directory that you want to select.
Whether you accept the selected BEA Home directory or select a different BEA Home directory, you are prompted to confirm your selection, as shown in the following example:
Choose BEA Home Directory:





   ->1¦ Yes, Use this BEA home directory [/nfs/home/user1/bea1]

     2¦ No, return to BEA home directory selection



Enter index number to select OR [Exit][Previous][Next]>
Type 1 or press Enter to accept your selection. Otherwise, type 2 to return to the Choose BEA Home Directory panel where you can modify your entry.
The Confirm Product Directory panel is displayed.
  1. The Confirm Product Directory panel indicates the folder in which the WebLogic Server software will be updated. For example:
Confirm Product Directory:
    Product Installation Directory: [/nfs/home/user1/bea1/weblogicXXX]
Files in /nfs/home/user1/bea1/weblogicXXX will now be upgraded to the X.X.X.X maintenance level.
Enter [Exit][Previous][Next]>
Press Enter or type next to continue.
  1. After you confirm the product directory, the installation program makes a backup copy of specific files from the previous installation and then installs new versions of the files.
When the installation is complete, the following prompt is displayed:
Install Complete
Congratulations! WebLogic Platform X.X.X.X

has been successfully installed to

/nfs/home/user1/bea1/weblogicXXX.
Press any key to continue OR [Exit]>
  1. Press any key to exit the installation program.




http://download.oracle.com/docs/cd/E13222_01/wls/docs81b/install/instsp.html

Tuesday, July 19, 2011

Xargs Commands

http://en.wikipedia.org/wiki/Xargs

xargs -0  The above command uses GNU specific extensions to find and xargs to separate filenames using the null character; -- to grep the filename even with the null charecter.


Xargs -r cp/vi if there is no file, if you use -r then it wont supply any files to cp/vi.



find . -name "*.foo" -print0 | xargs -0 -I {} mv {} /tmp/trash
The above command uses -I to tell xargs to replace {} with the argument list. Note that not all versions of xargs supports the {} syntax. In those cases you may specify a string after -I that will be replaced, e.g.

find . -name "*.foo" -print0 | xargs -0 -I xxx mv xxx /tmp/trash
The above command uses string xxx instead of {} as the argument list marker.