Wednesday, January 30, 2008

Server, Cluster and Domain

Server: Well, we all know what a server is so lets talk abt Cluster and Domain :}

Cluster: A Server cluster consists of multiple server instances running simultaneously and working together to provide increased scalability and reliability

A cluster appears to clients to be a single Server instance.

Domain: A domain includes one or more Server instances, which can be clustered, non-clustered, or a combination of clustered and non-clustered instances. A domain can include multiple clusters. A domain also contains the application components deployed in the domain, and the resources and services required by those application components and the server instances in the domain. Examples of the resources and services used by applications and server instances include machine definitions, optional network channels, connectors, and startup classes.


In each domain, one Server instance acts as the Administration Server.—the server instance which configures, manages, and monitors all other server instances and resources in the domain. Each Administration Server manages one domain only. If a domain contains multiple clusters, each cluster in the domain has the same Administration Server.


you cannot "split" a cluster over multiple domains.Similarly, you cannot share a configured resource or subsystem between domains. For example, if you create a JDBC connection pool in one domain, you cannot use it with a server instance or cluster in another domain. (Instead, you must create a similar connection pool in the second domain.)


Benefits of Clustering:

Scalability
The capacity of an application deployed on a WebLogic Server cluster can be increased dynamically to meet demand. You can add server instances to a cluster without interruption of service—the application continues to run without impact to clients and end users.

High-Availability
In a WebLogic Server cluster, application processing can continue when a server instance fails. You "cluster" application components by deploying them on multiple server instances in the cluster—so, if a server instance on which a component is running fails, another server instance on which that component is deployed can continue application processing.

Capabilities of a Cluster

Failover: Using session replication and replica-aware stubs
Load Balancing

Objects that can be clustered

Servlets, JSPs ,EJBs ,Remote Method Invocation (RMI) objects ,Java Messaging Service(JMS) destinations ,Java Database Connectivity (JDBC) connections


Objects that cannot be clustered

File services ,Time services ,WebLogic Events (deprecated in WebLogic Server 6.0) ,Workspaces (deprecated in WebLogic Server 6.0)

Wednesday, January 23, 2008

Unix Commands.. SCP, TAR,GZIP etc

Creating a TAR file in Unix.

What is a TAR File..?

Tar is most commonly used pack/unpack program in unix. Used for packaging files be sent across machines in a network.

Use 'c' command to package tar and 'x' command to unpack tar

Ex: if you want to create a tarfile from files A B C.. here is the command

tar cf g.tar A B C

Note: Always make sure you specify the file name before specifying the file names. Or unix will over write the first file mentioned. ex:

tar cf A B C. File 'A' will be overwritten.

Options in Tar: 'c' : Create command
'v' displays/echos the files being archived
'f' is the file name.

Unpack a Tar File:

tar xf
tar xf g.tar

Compressing a tar file..

gzip and bzip are used to compress the tar file. Compressed tar file In many ways both reduce network transfer time and to save space on the disk.


Command to compress tar:

gzip g.tar

the file will be renamed g.tar.gz

saved a significant amount of time using gzip file compred to transferring regular tar file. took 2.14 mins using .gz format and ~7 mins using regular .tar.

Cut down my waiting/turn around time here... :)

to uncompress the gzip file use..

gzip -d g.tar.gz

will create a file called g.tar

and now to unpackage tar use

tar xc g.tar

yay ..!!!!! I did QA deployment today using all the commands..

SCP: Secure file transfer from one unix box to another.

What is SCP: Copies a single file or a folder with multiple files using secure protocol over TCP/IP (the network) from one computer to another

Syntax:

scp username@location of the remote server:path to be copied to

$ scp suneetha.sh sunny@cmcad54323:/cri_staging/omen/discovery/QA
Next line will prompt u for pwd

$ scp suneetha.sh sunny@cmcad54323:/cri_staging/omen/discovery/QA
sunny's Password:
Could not chdir to home directory /home/u496798: No such file or directory
suneetha.sh 100% |*****************************| 551 00:00

using regular FTP, you'll have to first copy the file to ur local and then copy to the other server..its a 2 step process. Using scp u can eliminate it and directly connect to remote server.. Its cool try it out sometime. :))

Happy Reading :)

Thursday, January 17, 2008

Bose-Einstein Condense

A Nobel prize in physics was awarded to 3 scientists(2 US n 1 German) in 2001 for achieving Bose-Einstein Condense, a theory since 70 years.

So what is Bose-Einstein Condense or a race for absolute zero, a program which I just saw in PBS Nova (inspired me to make a note in my blog)

In the quest to reach colder and colder temperatures, physicists in 1995 created a remarkable new form of matter—neither gas, nor liquid, nor solid—called a Bose-Einstein condensate (BEC). First envisioned by Albert Einstein and a young Indian physicist named Satyendra Bose in the 1920s (Proud to be an Indian moment more info at http://en.wikipedia.org/wiki/Satyendra_Nath_Bose), BECs reveal properties of quantum mechanics—their atoms seem to merge together and lose their individual identity, behaving less like discrete particles and more like waves. If you're having trouble picturing this, not to worry; even physicists who work with BECs find them mind-boggling. In this interview, Luis Orozco of the University of Maryland, College Park offers some metaphors to help us begin to comprehend BECs and get a grasp of research in the strange world of ultracold atoms.


As things start to move slower and slower you're able to look at them for extended periods of time. It is as if I were to ask you, "Could you tell me something about the handles of a car that is passing on a highway at 50 or 60 miles an hour?" Definitely you won't be able to say anything. But if the car is moving rather slowly, then you would be able to tell me, "Oh yes, the handle is this kind, that color, has these properties." Or: "There is no handle." And it's precisely that ability to interrogate the car—I am looking at the car for a long, long time—so I can get information out of it.

In the same sense, if we have cold atoms and they're moving very, very slowly, then I should be able to learn a lot and get information out of those atoms. I extend the time that they are available.

At room temperature an atom is moving at roughly 500 meters per second.Slowing down to absolute zero, the atoms start to move about 20 centimeters per second [about 0.45 mph].

Applications: 1) At this slow velocity, we can study the atoms much closer that we ever thought of like studying weak force in atoms

2) Coherence of atoms

3) Quantum computers.

Formatting Millisecond in Oracle Date

Had this weird problem today.. timestamp is stored into date field..and so there there is this extra 0 ... which is throwing an error if I am using regular oracle date formatting with to_date.

Sample dt stored in db: 1/5/2006 12:38:30.000 PM

expected date in to_date function is something like.. to_date('10/01/2007 00:00:00','MM/DD/YYYY HH24:MI:SS')

there is no 'SSS' which takes millisecond.

here is what I did. Process it first as to_char to eliminate the extra 0 in millisec and use it for ur date function.

to_date(to_char(PROPOSAL_CREATION_DATE,'MM/DD/YYYY HH24:MI:SS') ,'MM/DD/YYYY HH24:MI:SS')

here is a sample query to get all rows in a month

select * from table1 where to_date(to_char(CREATION_DATE,'MM/DD/YYYY HH24:MI:SS') ,'MM/DD/YYYY HH24:MI:SS') > to_date('10/01/2007 00:00:00','MM/DD/YYYY HH24:MI:SS')
and to_date(to_char(CREATION_DATE,'MM/DD/YYYY HH24:MI:SS') ,'MM/DD/YYYY HH24:MI:SS')<= to_date('11/01/2007 00:00:00','MM/DD/YYYY HH24:MI:SS')

it works perfectly well ..yay.. happy coding. :)

Sunday, January 13, 2008

Build using new workspace

Ear built from the new workspace when deployed on the server doesnt seem to be working.. particularly on a single pg where it calls the external service. Reason being the JRE I am using in the new the workspace is not consitent with the JRE of the server on which EAR is being deployed to.. so what did is try to change ur pref vars in ur eclipse used to build..?

Change it every where reqd.

In ur eclipse windows --> Preferences--> Buildpath --> Class Variables

JAVA_HOME c:\bea92\jrockit90_150_06

JRE_LIB c:\bea92\jrockit90_150_06\jre\lib\rt.jar

JRE_SRC c:\bea92\...\src.zip


In window prefs installed JRE's
c:\bea92\jrockit90_150_06

Use it as ur default JRE for this workspace

Ant Runtime:

global entries: c:\bea92\jrockit .... \lib\tools.jar

Wednesday, January 9, 2008

argument type mismatch at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod

I was getting the following error when ever I submit the form..

java.lang.IllegalArgumentException:

Cannot invoke mismatch at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1778) at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759) at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648) at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677) at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022) at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

took me a looong time to realize that I was setting the value to a worng variable.. which would obviously cause type mismatch and thus IllegalArgumentException....

Be sure to chk ur form variables in the jsp and values are being set to right variables when the form is submitted. :)) In my case the error was at



Happy Coding :))