Wednesday, March 21, 2012

How To Log access.log in Weblogic Without Delay

We use Weblogic 10.3.2 here. By default, the access.log will not be updated immediately when a new http request is sent from the client. And currently there is no place in weblogic console where you can change this behavior. The way to work around this is to modify the config.xml file. The following needs to be inserted in between the <server> and </server> tag:
<web-server>
        <web-server-log>
          <buffer-size-kb>0</buffer-size-kb>
        </web-server-log>
    </web-server>

However, it has to be inserted at the correct location. Otherwise it will make config.xml invalid. The following is an example of the correct location:
<server>
    <name>AdminServer</name>
    <ssl>
      <enabled>true</enabled>
      <hostname-verifier xsi:nil="true"></hostname-verifier>
      <hostname-verification-ignored>false</hostname-verification-ignored>
      <export-key-lifespan>500</export-key-lifespan>
      <client-certificate-enforced>true</client-certificate-enforced>
      <listen-port>7022</listen-port>
      <two-way-ssl-enabled>true</two-way-ssl-enabled>
      <ssl-rejection-logging-enabled>true</ssl-rejection-logging-enabled>
      <inbound-certificate-validation>BuiltinSSLValidationOnly</inbound-certificate-validation>
      <outbound-certificate-validation>BuiltinSSLValidationOnly</outbound-certificate-validation>
      <allow-unencrypted-null-cipher>false</allow-unencrypted-null-cipher>
      <use-server-certs>false</use-server-certs>
    </ssl>
    <listen-port>7021</listen-port>
    <listen-port-enabled>true</listen-port-enabled>

    <web-server>
      <web-server-log>
        <buffer-size-kb>0</buffer-size-kb>
      </web-server-log>
    </web-server>

    <listen-address></listen-address>
    <java-compiler>javac</java-compiler>
    <client-cert-proxy-enabled>false</client-cert-proxy-enabled>
  </server>

In the above, it is for the AdminServer. I think this can be done for other servers.

Tuesday, March 13, 2012

Linux Kernel Space, Context Switch, etc

I am reading some stuff on Linux. Just want to summarize some information here.

Linux is a monolithic kernel; that is, the linux kernel executes in a single address space entirely in kernel mode. Linux dose not differentiate between threads and normal processes. A thread is merely a process that shares certain resources with other processes.

In Linux, each processor is doing exactly one of the three things below at any given moment:

  1. In user-space, executing user code in a process.
  2. In kernel-space, in process context, executing on behalf of a specific process.
  3. In kernel-space, in interrupt context, not associated with a process, handling an interrupt.

When executing kernel code, the system is in kernel-space executing in kernel mode. When executing a regular process, the system is in user-space executing in user mode.

When an application executes a system call, we say that the kernel is executing on behalf of the application. Furthermore, the application is said to be executing a system call in kernel-space, and the kernel is running in process context.

A context switch can mean a register context switch, a task context switch, a thread context switch, or a process context switch. What constitutes the context is determined by the processor and the operating system.

When an interrupt occurs, the hardware automatically switches a part of the context (at least enough to allow the handler to return to the interrupted code). The handler may save additional context, depending on details of the particular hardware and software designs. Often only a minimal part of the context is changed in order to minimize the amount of time spent handling the interrupt. The kernel does not spawn or schedule a special process to handle interrupts, but instead the handler executes in the (often partial) context established at the beginning of interrupt handling. Once interrupt servicing is complete, the context in effect before the interrupt occurred is restored so that the interrupted process can resume execution in its proper state.

When a transition between user mode and kernel mode is required in an operating system, a context switch is not necessary; a mode transition is not by itself a context switch. However, depending on the operating system, a context switch may also take place at this time.

When an interrupt occurs, unless the interrupt is disabled in the processor, the processor immediately stops what it is doing, disables the interrupt system, and jumps to a predefined location in memory and executes the code located there. To balance the large amount of work with the need for quick execution, the kernel divides the work of processing interrupts into two halves. The interrupt handler is the top half. The bottom half can be executed later.

References

1. Linux Kernel Development, 3rd edition, by Robert Love
2. http://en.wikipedia.org/wiki/Context_switch

Monday, March 12, 2012

JUnit Test

This is a presentation that I did for using junit test.

Introduction to JUnit Test


Uses

A framework for unit test. Used mainly to test individual classes and methods.

JUnit Library

In maven pom.xml:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
The scope is "test". So the junit.jar will not be packaged into the application for deployment.

Configure Maven for Running JUnit

In maven pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!--<skipTests>true</skipTests>-->
<testFailureIgnore>false</testFailureIgnore>
</configuration>
</plugin>
If skipTests is true, no unit tests will be run.
If testFailureIgnore is true, the tests will be run and the build maven will succeed even if some tests fail.
If testFailureIgnore is false, the tests will be run and build will fail if a test fails.

The test results will go to the directory:
project_base_directory\target\surefire-reports

Traditional JUnit Test

The test class must extend the JUnit class TestCase or its subclasses.
  1. Use setUp() to initialize resources.
  2. Use tearDown() to release resources
  3. Every test method must start with the lowercase "test".

The lifecycle of a TestCase

The lifecycle of a TestCase used by the JUnit framework is as follows:
  1. Execute setUp().
  2. Call a test-prefixed method.
  3. Execute tearDown().
  4. Repeat these steps for each test method. This will occur even if setUp() or tearDown() throws an exception
Notes:
If setUp() throws an Exception, the test method and tearDown() will not be executed.
If the test method fails and throws an error or exception, tearDown() will still be executed.

Utility Methods from Assert

  • assertTrue(String message, boolean condition)
  • assertFalse(String message, boolean condition)
  • fail(String message)
  • assertEquals(String message, Object expected, Object actual)
  • assertEquals(String message, String expected, String actual)
  • assertEquals(String message, double expected, double actual, double delta)
  • assertEquals(String message, int expected, int actual)
  • assertSame(String message, Object expected, Object actual)
  • assertNotNull(String message, Object object)
  • assertNull(String message, Object object)
See the class junit.framework.Assert for more methods.

A Sample Class for Testing

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Sound {
 private Map<String, String> voicemap = new HashMap<String, String>() {
  {
   put("bee", "buzz");
   put("cow", "moo");
   put("dog", "woof");
   put("cat", "meow");
   put("snake", "hiss");
   put("bird", "chir");
   put("goose", "honk");
  }
 };

 public String speak(String animal) throws Exception {
  if (animal == null) {
   throw new Exception("animial is not specified.");
  }
  String name = animal.toLowerCase();
  Set<String> animals = voicemap.keySet();
  if (!animals.contains(name)) {
   throw new Exception("not implemented yet for this animal.");
  }
  return voicemap.get(name);
 }

 public String yell(String animal) throws Exception {
  String sound = speak(animal);
  return sound.toUpperCase();
 }
}

A Sample JUnit Test Class

import junit.framework.TestCase;

public class SoundTest extends TestCase {

/* This is for demo only. In real life, you won’t need to initialize a simple object such as Sound here. The objects that need to be initialized  in the setUp() method are usually more complex resources such as database connection. 
*/
 private Sound sound = null; 

 @Override
 protected void setUp() throws Exception {
  super.setUp();
  sound = new Sound();  
 }

 @Override
 protected void tearDown() throws Exception {
  sound = null;
  super.tearDown();
 }

 public void testSpeak() throws Exception {
  String beeSound = sound.speak("bee");
  assertEquals("buzz", beeSound);
  try {
   String temp = sound.speak("fish");
   fail("Failed for fish. This statemente should not have been executed");
  } catch (Exception e) {
   return; // excepted
  }
 }

 public void testYell() {
  try {
   String gooseYell = sound.yell("goose");
   assertEquals("The sound of goose is not right", "HONK", gooseYell);
  } catch (Exception e) {
   fail("Test failed. This statement should not have been reached.");
  }
 }
}


Run JUnit in Eclipse


Run JUnit Test On CommandLine

JUnit provides the TestRunner classes for running all the tests. The two most popular test runners are a text-based one, junit.textui.TestRunner, and a Swing-based one, junit.swingui.TestRunner

Example:
java junit.textui.TestRunner org.example.SampleTest

TestSuite

JUnit tests can be grouped together by using the TestSuite class.
Example:
import junit.framework.Test;
import junit.framework.TestSuite;

public class GroupTests extends TestSuite {
      static public Test suite() {
            TestSuite suite = new TestSuite();
             suite.addTestSuite(SimpleTest1.class);
             suite.addTestSuite(SimpleTest2.class);
             return suite;
    }
}

When this test is run, both SimpleTest1 and SimpleTest2 will be invoked.

Junit Test Using Annotation in JUnit4

  1. No need to extend the class TestCase
  2. No need to use setUp() or tearDown(). Use @Before and @After instead.
  3. The test method name does not need to start with "test". But you need to put the @Test annotation before each test method.
  4. Use @Test(expected = YourException.class) to test exception
  5. Can use @Test(timeout = ?) for performance testing. Here "?" is time in milliseconds.
  6. Can use @Ignore to ignore a test
Example Using Annotation

import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

public class SoundAnnotationTest {

/** This is for demo only. In real life, you won’t need to initialize a simple object such as Sound here. The objects that need to be initialized  in the @Before method are usually more complex resources such as database connection. 
*/
 private Sound sound = null;

 /**
  * The method name does not have to be setUp. You can have multiple such
  * methods with the "Before" annotattion, each of which is run before each
  * test
  */
 @Before
 public void setUp() {
  sound = new Sound();
 }

 /**
  * The method name does not have to be tearDown. You can have multiple such
  * methods with teh "After" annotation, each of which is run after each
  * test.
  */
 @After
 public void tearDown() {
  sound = null;

 }

 @Test
 public void speak() {
  try {
   String beeSound = sound.speak("bee");
   Assert.assertEquals("buzz", beeSound);
  } catch (Exception e) {
   Assert.fail("Test failed.");
  }

  try {
   sound.speak("fish");
   Assert.fail("Failed for fish. This statemente should not have been executed");
  } catch (Exception e) {
   return; // excepted
  }
 }

 @Test
 public void testYell() {
  try {
   String gooseYell = sound.yell("goose");
   Assert.assertEquals("The sound of goose is not right", "HONK",
     gooseYell);
  } catch (Exception e) {
   Assert.fail("Test failed. This statement should not have been reached.");
  }
 }

 @Test(expected = Exception.class)
 // IndexOutOfBoundsException.class
 public void testFish() throws Exception {
  sound.speak("fish");
 }

 @Test(timeout = 700)
 public void testPerformance() throws Exception {
  Thread.currentThread().sleep(600);
 }

 @Ignore
 public void foo() throws Exception {
  for (int i = 0; i < 10; i++) {
   // no-op
  }
 }
}

Use EasyMock in JUnit

  1. Create Mock object using EasyMock.createMock
  2. Mock expected results using EasyMock's expect and the andReturn()/andThrow() method
    You can use andReturn to return the value you want.
    You can use andThrow to throw any kind of exception you like.
  3. Call the EasyMock replay() method.
  4. Do test and check results.

Example Using EasyMock

(MyServiceEndpointTest)
fooServiceMock = createMock(FooService.class);
barServiceMock = createMock(BarService.class);
endPoint = new MarshallingCommonServiceEndpoint(barServiceMock,
    fooServiceMock);
expect(barServiceMock.getSomeInput(arg1, arg2)).andReturn(Boolean.TRUE);
replay(barServiceMock);
GetBarResponse response = endPoint.getBar(request);
assertTrue("Invalid status", response.isStatus());

HSQLDB


HSQLDB stands for "Hyper Structured Query Language Database". It is a relational database management system written in Java. It offers a fast, small database engine which offers both in-memory and disk-based tables. Embedded and server modes are available.
Instead of connecting to the actual database, JUnit can use HSQLDB for tests related to database actions.
Example: LocationDaoTest.java. This test class extends
AbstractTransactionalDataSourceSpringContextTests. This is from Spring. It is a subclass of TestCase and offers features such as transaction management and bean injection.

Resources

  1. http://java.sun.com/developer/Books/javaprogramming/ant/ant_chap04.pdf
  2. http://www.ibm.com/developerworks/java/library/j-easymock/index.html
  3. http://www.ibm.com/developerworks/java/library/j-junit4/index.html
  4. http://www.methodsandtools.com/tools/tools.php?junit

Tuesday, February 14, 2012

Class Loader Hierarchy Of An Application On Weblogic Server

Some Background Knowledge About the Java Class Loaders

When the JVM is started, three class loaders are used:

  1. Bootstrap class loader
  2. Extensions class loader
  3. System class loader

The bootstrap class loader loads the core Java libraries located in the <JAVA_HOME>/jre/lib directory. This class loader, which is part of the core JVM, is written in native code.

The extensions class loader loads the code in the extensions directories (<JAVA_HOME>/jre/lib/ext, or any other directory specified by the java.ext.dirs system property). It is implemented by the sun.misc.Launcher$ExtClassLoader class.

The system class loader loads code found on java.class.path, which maps to the CLASSPATH environment variable. This is implemented by the sun.misc.Launcher$AppClassLoader class.

The Weblogic Server and Application Configuration

This is weblogic 10.3.2. The application is deployed to the myAppwls10loc domain. There is a startup class for the domain. The domain lib directory has a jar jt400.jar.
In the command startWeblogic.cmd, two additional jars are put onto the classpath:
set CLASSPATH=C:\workshop\myclient.jar; %MAVEN_HOME%\oracle\jars\aqapi-9.0.2.jar ;%CLASSPATH%
The application is an ear. It has two modules: a war and an ejb jar. The ear has the following layout:
APP-INF
  classes
  lib
    x.jar
META-INF
myejb.jar
mywar.war

In summary, the results are the following.
  1. The classes in myclient.jar ( used by the startup class ) are loaded with the following hierarchy:
    |
    sun.misc.Launcher$ExtClassLoader@19134f4
    |
    sun.misc.Launcher$AppClassLoader@47858e
    

  2. The classes in APP-INF/lib/x.jar and the classes in myejb.jar are loaded with the following hirearchy (NOTE: their context class loaders are different though):
    |
    sun.misc.Launcher$ExtClassLoader@19134f4
     |
    sun.misc.Launcher$AppClassLoader@47858e
     |
    java.net.URLClassLoader@164dbd5
     |
    weblogic.utils.classloaders.GenericClassLoader@1db6942
     |
    weblogic.utils.classloaders.FilteringClassLoader@11f9cee
     |
    weblogic.utils.classloaders.GenericClassLoader@f8d6a6
    

  3. Add the code to print the class loader hierarchy in the jsp file in mywar.war. The output is the following:
    |
    sun.misc.Launcher$ExtClassLoader@19134f4
     |
    sun.misc.Launcher$AppClassLoader@47858e
     |
    java.net.URLClassLoader@164dbd5
     |
    weblogic.utils.classloaders.GenericClassLoader@1db6942
     |
    weblogic.utils.classloaders.FilteringClassLoader@11f9cee
     |
    weblogic.utils.classloaders.GenericClassLoader@f8d6a6
     |
    weblogic.utils.classloaders.ChangeAwareClassLoader@17b51e8
     |
    weblogic.servlet.jsp.TagFileClassLoader@18d70a6
     |
    weblogic.servlet.jsp.JspClassLoader@a3af1c
    
    You can see that this is a child class loader of the class loader that loads the classes in myejb.jar and x.jar.

Below are more details. In the following log file, the class SampleBo is in a jar that resides in the directory APP-INF/lib directory. And the class XyzMessageHandlerImpl is in myejb.jar.

The following functions are used to print out the classloader tree:

private void printClassloaders(Class clazz) {
  ClassLoader classLoader = clazz.getClassLoader();
  System.out.println("==============================");
  System.out.println("Class name:" + clazz.getName());
  printCLtree(classLoader, "");
  System.out
    .println("Thread.currentThread().getClass().getClassLoader():");
  ClassLoader cl = Thread.currentThread().getClass().getClassLoader();
  printCLtree(cl, "");
  System.out.println("==============================");
 }

 private void printCLtree(ClassLoader cl, String indent) {
  if (cl == null) {
   return;
  }
  System.out.println(indent + "ClassLoader=" + cl);
  ClassLoader pcl = cl.getParent();
  if (pcl == null) {
   System.out.println(indent + "  ClassLoader=" + pcl);
  } else {
   printCLtree(pcl, indent + "  ");
  }
 }

 public static void printClassLoaderHierarchy(Class c) {
  ClassLoader cl = c.getClassLoader();
  System.out.println("___________________START_______________________");
  System.out.println("\nClass loader tree");
  printClassLoaderTree(cl);
  System.out.println("\nContext loader tree");
  ClassLoader l = Thread.currentThread().getContextClassLoader();
  printClassLoaderTree(l);
  System.out.println("____________________END_______________________");
 }

 public static void printClassLoaderTree(ClassLoader l) {
  ClassLoader p = l.getParent();
  if (p != null)
   printClassLoaderTree(p);
  String u = "";
  if (l instanceof URLClassLoader)
   u = getURLs(((URLClassLoader) l).getURLs());
  System.out.println((new StringBuilder("\t|\n")).append(l).append(" ")
    .append(u).toString());
 }

 public static String getURLs(URL urls[]) {
  if (urls == null)
   return "{}";
  StringBuffer b = new StringBuffer("{");
  for (int i = 0; i < urls.length; i++)
   b.append(urls[i]).append(":");

  b.append("}");
  return b.toString();
 }



The following is the log file:

.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m  -XX:MaxPermSize=128m
.
WLS Start Mode=Development
.
CLASSPATH=C:\workshop\myclient.jar; C:/workspace/maven \oracle\jars\aqapi-9.0.2.jar ;C:\bea1032\patch_wls1032\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\bea1032\patch_oepe1032\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\bea1032\JDK160~1.5-3\lib\tools.jar;C:\bea1032\utils\config\10.3\config-launch.jar;C:\bea1032\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\bea1032\WLSERV~1.3\server\lib\weblogic.jar;C:\bea1032\modules\features\weblogic.server.modules_10.3.2.0.jar;C:\bea1032\WLSERV~1.3\server\lib\webservices.jar;C:\bea1032\modules\ORGAPA~1.0/lib/ant-all.jar;C:\bea1032\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\bea1032\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar;C:\bea1032\WLSERV~1.3\server\lib\xqrl.jar
.
PATH=C:\bea1032\patch_wls1032\profiles\default\native;C:\bea1032\patch_oepe1032\profiles\default\native;C:\bea1032\WLSERV~1.3\server\native\win\32;C:\bea1032\WLSERV~1.3\server\bin;C:\bea1032\modules\ORGAPA~1.0\bin;C:\bea1032\JDK160~1.5-3\jre\bin;C:\bea1032\JDK160~1.5-3\bin;C:\bea1032\jrockit_160_14_R27.6.5-32\jre\bin;C:\Program Files\CA\SC\CAWIN\;C:\PROGRA~1\CA\SC\ETPKI\lib;C:\Program Files\Java\jdk1.6.0_14\bin;C:\Program Files\JavaFX\javafx-sdk1.3\bin;C:\Program Files\JavaFX\javafx-sdk1.3\emulator\bin;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\Perl\site\bin;C:\Perl\bin;C:\ant\apache-ant-1.7.1\bin;C:\notes\;C:\notes\data\;C:\oracle\ora90\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Intel\DMIX;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\apache-maven-2.2.1\bin;C:\JavaKit\j3d\bin;C:\Program Files\Borland\CaliberRM SDK 2008\lib;;C:\Program Files\SEAGULL\BlueZone\;C:\PROGRA~1\CA\SC\CAM\bin;C:\Program Files\CA\DSM\bin;C:\Program Files\CA\SC\Csam\SockAdapter\\bin;C:\Program Files\Enterprise Vault\EVClient\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Subversion\bin;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\bea1032\WLSERV~1.3\server\native\win\32\oci920_8
.
***************************************************
*  To start WebLogic Server, use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration, use the WebLogic Server *
*  console at http:\\hostname:port\console        *
***************************************************
starting weblogic with Java version:
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)
Starting WLS with line:
C:\bea1032\JDK160~1.5-3\bin\java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m  -XX:MaxPermSize=128m -Dweblogic.Name=myAppAdminServer -Djava.security.policy=C:\bea1032\WLSERV~1.3\server\lib\weblogic.policy  -Xverify:none  -da -Dplatform.home=C:\bea1032\WLSERV~1.3 -Dwls.home=C:\bea1032\WLSERV~1.3\server -Dweblogic.home=C:\bea1032\WLSERV~1.3\server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\bea1032\patch_wls1032\profiles\default\sysext_manifest_classpath;C:\bea1032\patch_oepe1032\profiles\default\sysext_manifest_classpath  weblogic.Server
<Feb 14, 2012 10:01:54 AM EST> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
C:\bea1032\user_projects\domains\myAppwls10loc\lib\jt400.jar> 
<Feb 14, 2012 10:01:54 AM EST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 14.0-b16 from Sun Microsystems Inc.> 
<Feb 14, 2012 10:01:55 AM EST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.2.0  Tue Oct 20 12:16:15 PDT 2009 1267925 > 
<Feb 14, 2012 10:01:58 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 
<Feb 14, 2012 10:01:58 AM EST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool> 
<Feb 14, 2012 10:01:59 AM EST> <Notice> <LoggingService> <BEA-320400> <The log file C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\myAppAdminServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> 
<Feb 14, 2012 10:01:59 AM EST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\myAppAdminServer.log00138. Log messages will continue to be logged in C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\myAppAdminServer.log.> 
<Feb 14, 2012 10:01:59 AM EST> <Notice> <Log Management> <BEA-170019> <The server log file C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\myAppAdminServer.log is opened. All server side log events will be written to this file.> 
<Feb 14, 2012 10:02:07 AM EST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.> 
<Feb 14, 2012 10:02:11 AM EST> <Notice> <LoggingService> <BEA-320400> <The log file C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\access.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> 
<Feb 14, 2012 10:02:11 AM EST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\access.log00080. Log messages will continue to be logged in C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\access.log.> 
TimerStartUp static block

Class loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {
file:/C:/workshop/myclient.jar:
file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:
file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:
file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:
file:/C:/bea1032/utils/config/10.3/config-launch.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:
file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:
file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:
file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:
file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}

Context loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {
file:/C:/workshop/myclient.jar:
file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:
file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:
file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:
file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:
file:/C:/bea1032/utils/config/10.3/config-launch.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:
file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:
file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:
file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:
file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:
file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {
file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}

Tue Feb 14 10:02:11 EST 2012; INFO: binding to jnditree [t3://localhost:7001]
Tue Feb 14 10:02:11 EST 2012; INFO: binding fakequeue [App1Queue] as [javax.naming.InitialContext@1fd9726]
Tue Feb 14 10:02:11 EST 2012; INFO: timeout set [100] to [javax.naming.InitialContext@1fd9726]
Tue Feb 14 10:02:11 EST 2012; INFO: create queueconnection [timeout=100] as [com.myapp.messaging.aq.qfc.FakeQueueConnectionFactory@e0c07c]
Tue Feb 14 10:02:11 EST 2012INFO:  start connection[null] closed[false]
Tue Feb 14 10:02:11 EST 2012; INFO: binding fakefactory [App1ConnectionFactory] as [com.myapp.messaging.aq.qfc.FakeQueueConnectionFactory@e0c07c]
Tue Feb 14 10:02:11 EST 2012; INFO: creating fakeconnct [] as [com.myapp.messaging.aq.qfc.FakeQueueConnection@18a8bfasession=nullclosed=falsesession_list=0]
Tue Feb 14 10:02:11 EST 2012; INFO: TimerStartup [finished]
<Feb 14, 2012 10:02:16 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY> 
<Feb 14, 2012 10:02:16 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 
==============================
Class name:com.myapp.business.sample.SampleBo
ClassLoader=weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@
  ClassLoader=weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation: 
    ClassLoader=weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation: 
      ClassLoader=java.net.URLClassLoader@164dbd5
        ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
          ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
            ClassLoader=null
Thread.currentThread().getClass().getClassLoader():
ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
  ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
    ClassLoader=null
==============================
___________________START_______________________

Class loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@ 

Context loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@ 
 |
weblogic.utils.classloaders.ChangeAwareClassLoader@17b51e8 finder: weblogic.utils.classloaders.CodeGenClassFinder@1ad65f7 annotation: myApp@myApp 
____________________END_______________________
==============================
Class name:com.myapp.business.sample.SampleBo
ClassLoader=weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@
  ClassLoader=weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation: 
    ClassLoader=weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation: 
      ClassLoader=java.net.URLClassLoader@164dbd5
        ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
          ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
            ClassLoader=null
Thread.currentThread().getClass().getClassLoader():
ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
  ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
    ClassLoader=null
==============================
___________________START_______________________

Class loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@ 

Context loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@ 
 |
weblogic.utils.classloaders.ChangeAwareClassLoader@17b51e8 finder: weblogic.utils.classloaders.CodeGenClassFinder@1ad65f7 annotation: myApp@myApp 
____________________END_______________________
<Feb 14, 2012 10:02:54 AM EST> <Notice> <LoggingService> <BEA-320400> <The log file C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\myAppwls10loc.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> 
<Feb 14, 2012 10:02:54 AM EST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\myAppwls10loc.log00095. Log messages will continue to be logged in C:\bea1032\user_projects\domains\myAppwls10loc\servers\myAppAdminServer\logs\myAppwls10loc.log.> 
<Feb 14, 2012 10:02:54 AM EST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.> 
<Feb 14, 2012 10:02:54 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> 
<Feb 14, 2012 10:02:54 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> 
<Feb 14, 2012 10:02:54 AM EST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 10.77.121.138:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Feb 14, 2012 10:02:54 AM EST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Feb 14, 2012 10:02:54 AM EST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "myAppAdminServer" for domain "myAppwls10loc" running in Development Mode> 
Tue Feb 14 10:02:56 EST 2012; INFO: create queueconnection [timeout=100] as [com.myapp.messaging.aq.qfc.FakeQueueConnectionFactory@1620d83]
==============================
Class name:com.myapp.messaging.aq.qfc.FakeQueueConnection
ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
  ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
    ClassLoader=null
Thread.currentThread().getClass().getClassLoader():
ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
  ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
    ClassLoader=null
==============================
___________________START_______________________

Class loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}

Context loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@ 
 |
weblogic.utils.classloaders.GenericClassLoader@fcfd10 finder: weblogic.utils.classloaders.CodeGenClassFinder@1d1bb4d annotation: myApp@ 
____________________END_______________________
Tue Feb 14 10:02:56 EST 2012; INFO:  construct queueSession
Tue Feb 14 10:02:56 EST 2012; INFO:  scheduling delayed start[5000ms], timeout[100ms] session[com.myapp.messaging.aq.qfc.FakeQueueSession@17b3b61queue=nullmessageListener=nullstopped=false]
Tue Feb 14 10:02:56 EST 2012; INFO:  session#1, queueSession created[com.myapp.messaging.aq.qfc.FakeQueueConnection@97cd75session=com.myapp.messaging.aq.qfc.FakeQueueSession@17b3b61queue=nullmessageListener=nullstopped=falseclosed=falsesession_list=1]
Tue Feb 14 10:02:56 EST 2012; INFO:  setMessageListener(weblogic.ejb.container.internal.MDListener@1598d5f)
Tue Feb 14 10:02:56 EST 2012INFO:  start connection[null] closed[false]
<Feb 14, 2012 10:02:57 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> 
<Feb 14, 2012 10:02:57 AM EST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode> 
<Feb 14, 2012 10:03:01 AM EST> <Warning> <JMX> <BEA-149517> <An attempt was made to unregister an mbean that was already unregistered: weblogic.servlet.internal.ServletRuntimeMBeanImpl@bb303> 
------------------------
classLoader=weblogic.servlet.jsp.JspClassLoader@a3af1c finder: weblogic.utils.classloaders.CodeGenClassFinder@1ed70df annotation: 
  classLoader=weblogic.servlet.jsp.TagFileClassLoader@18d70a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@deaa44 annotation: 
    classLoader=weblogic.utils.classloaders.ChangeAwareClassLoader@17b51e8 finder: weblogic.utils.classloaders.CodeGenClassFinder@1ad65f7 annotation: myApp@myApp
      classLoader=weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@
        classLoader=weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation: 
          classLoader=weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation: 
            classLoader=java.net.URLClassLoader@164dbd5
              classLoader=sun.misc.Launcher$AppClassLoader@47858e
                classLoader=sun.misc.Launcher$ExtClassLoader@19134f4
                  classLoader=null
classLoader=null now
------------------------
___________________START_______________________

Class loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@ 
 |
weblogic.utils.classloaders.ChangeAwareClassLoader@17b51e8 finder: weblogic.utils.classloaders.CodeGenClassFinder@1ad65f7 annotation: myApp@myApp 
 |
weblogic.servlet.jsp.TagFileClassLoader@18d70a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@deaa44 annotation:  
 |
weblogic.servlet.jsp.JspClassLoader@a3af1c finder: weblogic.utils.classloaders.CodeGenClassFinder@1ed70df annotation:  

Context loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
java.net.URLClassLoader@164dbd5 {file:/C:/bea1032/user_projects/domains/myAppwls10loc/lib/jt400.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@1db6942 finder: weblogic.utils.classloaders.CodeGenClassFinder@1fe2c10 annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@11f9cee finder: weblogic.utils.classloaders.CodeGenClassFinder@77e77a annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@f8d6a6 finder: weblogic.utils.classloaders.CodeGenClassFinder@8f53c8 annotation: myApp@ 
 |
weblogic.utils.classloaders.ChangeAwareClassLoader@17b51e8 finder: weblogic.utils.classloaders.CodeGenClassFinder@1ad65f7 annotation: myApp@myApp 
____________________END_______________________



Class loaders for the class in APP-INF/lib and myejb.jar

In another test, I found the class loader that loads the class in the EJB module is the same as the one that loads the classes in the jars in the APP-INF/lib directory. In this test, there is no jar in the lib directory of the domain:C:/bea1032/user_projects/domains/myAppwls10loc/lib
The following is the log for the class in APP-INF/lib:
==============================
Class name:com.myapp.business.sample.SampleBo
ClassLoader=weblogic.utils.classloaders.GenericClassLoader@48268a finder: weblogic.utils.classloaders.CodeGenClassFinder@10e0edb annotation: myApp@
  ClassLoader=weblogic.utils.classloaders.FilteringClassLoader@38bbd7 finder: weblogic.utils.classloaders.CodeGenClassFinder@b44131 annotation: 
    ClassLoader=weblogic.utils.classloaders.GenericClassLoader@5b78cf finder: weblogic.utils.classloaders.CodeGenClassFinder@241f4e annotation: 
      ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
        ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
          ClassLoader=null
Thread.currentThread().getClass().getClassLoader():
ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
  ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
    ClassLoader=null
==============================
___________________START_______________________

Class loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@5b78cf finder: weblogic.utils.classloaders.CodeGenClassFinder@241f4e annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@38bbd7 finder: weblogic.utils.classloaders.CodeGenClassFinder@b44131 annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@48268a finder: weblogic.utils.classloaders.CodeGenClassFinder@10e0edb annotation: myApp@ 

Context loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@5b78cf finder: weblogic.utils.classloaders.CodeGenClassFinder@241f4e annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@38bbd7 finder: weblogic.utils.classloaders.CodeGenClassFinder@b44131 annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@48268a finder: weblogic.utils.classloaders.CodeGenClassFinder@10e0edb annotation: myApp@ 
 |
weblogic.utils.classloaders.ChangeAwareClassLoader@faaa93 finder: weblogic.utils.classloaders.CodeGenClassFinder@5532da annotation: myApp@myApp 
____________________END_______________________

And the following is the log for the class in myejb.jar:
==============================
Class name:com.myapp.messaging.xyz.XyzMessageHandlerImpl
ClassLoader=weblogic.utils.classloaders.GenericClassLoader@48268a finder: weblogic.utils.classloaders.CodeGenClassFinder@10e0edb annotation: myApp@
  ClassLoader=weblogic.utils.classloaders.FilteringClassLoader@38bbd7 finder: weblogic.utils.classloaders.CodeGenClassFinder@b44131 annotation: 
    ClassLoader=weblogic.utils.classloaders.GenericClassLoader@5b78cf finder: weblogic.utils.classloaders.CodeGenClassFinder@241f4e annotation: 
      ClassLoader=sun.misc.Launcher$AppClassLoader@47858e
        ClassLoader=sun.misc.Launcher$ExtClassLoader@19134f4
          ClassLoader=null
Thread.currentThread().getClass().getClassLoader():
==============================
___________________START_______________________

Class loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@5b78cf finder: weblogic.utils.classloaders.CodeGenClassFinder@241f4e annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@38bbd7 finder: weblogic.utils.classloaders.CodeGenClassFinder@b44131 annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@48268a finder: weblogic.utils.classloaders.CodeGenClassFinder@10e0edb annotation: myApp@ 

Context loader tree
 |
sun.misc.Launcher$ExtClassLoader@19134f4 {file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/dnsns.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/localedata.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunjce_provider.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunmscapi.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/jre/lib/ext/sunpkcs11.jar:}
 |
sun.misc.Launcher$AppClassLoader@47858e {file:/C:/workshop/myclient.jar:file:/C:/bea1032/user_projects/domains/myAppwls10loc/%20C:/workspace/maven%20/oracle/jars/aqapi-9.0.2.jar%20:file:/C:/bea1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/patch_oepe1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:file:/C:/bea1032/jdk160_14_R27.6.5-32/lib/tools.jar:file:/C:/bea1032/utils/config/10.3/config-launch.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic_sp.jar:file:/C:/bea1032/wlserver_10.3/server/lib/weblogic.jar:file:/C:/bea1032/modules/features/weblogic.server.modules_10.3.2.0.jar:file:/C:/bea1032/wlserver_10.3/server/lib/webservices.jar:file:/C:/bea1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:file:/C:/bea1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:file:/C:/bea1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:file:/C:/bea1032/wlserver_10.3/server/lib/xqrl.jar:}
 |
weblogic.utils.classloaders.GenericClassLoader@5b78cf finder: weblogic.utils.classloaders.CodeGenClassFinder@241f4e annotation:  
 |
weblogic.utils.classloaders.FilteringClassLoader@38bbd7 finder: weblogic.utils.classloaders.CodeGenClassFinder@b44131 annotation:  
 |
weblogic.utils.classloaders.GenericClassLoader@48268a finder: weblogic.utils.classloaders.CodeGenClassFinder@10e0edb annotation: myApp@ 
____________________END_______________________

Friday, January 20, 2012

Analysis of A Piece of Linux Bash Script That Uses Regular Expression

I often forgot the syntax of regular expression and had trouble understanding it. The following is some code that is simple but contains quite some techinical stuff. It will be helpful to understand how it works. So I did a little bit digging to find out the answer.

pathmunge () {
        if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then  
              PATH=$1:$PATH 
        fi
}

pathmunge /sbin


Basically the function pathmunge() is used to add some string to the $PATH variable if the string is not already in the $PATH. In the code above, the line "pathmunge /sbin" is an actual call of the function.

There are several technical tips here for understanding the code.
The most compact syntax of the "if" command is
if TEST-COMMAND; then CONSEQUENT-COMMANDS; fi
  1. For the "if" statement, if the test command has the return status 0, then the "then" part is executed. Note this is different from some other programming languages where 0 means false.
  2. It is common to see the "if" statement like this "if [ ... ]". But here the test command is different. The test command might be any UNIX command that returns an exit status, and that "if" again returns an exit status of zero. In our case, the test command is
    ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" 
    
    This command first does the echo. Then does the egrep. And then apply the "!" operator. So if egrep is successful ( i.e, the string is found ), then "!" changes this to non-zero, and the "then" part will not be executed.
  3. The regular expression is "(^|:)$1($|:)". In this expression is the character "$" in "$1" a character for matching or is "$1" a symbol for the first parameter passed to the function pathmunge()? Answer: $1 is the first parameter. This is called "shell expansion".
  4. In the regular expression, the "^" character means to match the beginning. The second "$" means to match the end. The parentheses "()" is for a group. The character "|" is like an OR operator. So for the call in the code, the pattern will match the following. Here I use * to denote 0 or more characters:
    • /sbin
    • /sbin:*
    • *:/sbin
    • *:/sbin:*
  5. In the "then" part, you can have more than one command. For example, you can use
    if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
                    echo "\$1 is " $1             
                    PATH=$1:$PATH            
            fi
    

Tuesday, January 3, 2012

Install Plugins for Different Programming Languages in Eclipse

Eclipse is usually used for java development. But it can also be used for other programming lanugages. To install the plugin for using other programming languages, use the following procedure.
  1. Go to the menu item Help --> Install New Software...
  2. In the "Work with:" input box, select the following:
    Galileo - http://download.eclipse.org/releases/galileo
    Note that this is for the Galileo version of eclipse. For other versions of eclipse, use the corresponding link.
  3. You'll see a list of softwares. One of them is "Programming Languages". From there, you can select the language you want ( for example, C/C++, PHP, etc) and install it.

Tuesday, December 6, 2011

Special Characters in Google Search

Unfortunately you usually can not search phrases with special characters. The following is the quote from the Google support link:
http://www.google.com/support/websearch/bin/answer.py?answer=134479

Generally, punctuation is ignored, including @#$%^&*()=+[]\ and other special characters.
By the way, that article has this useful tip:
Search is always case insensitive. A search for [ new york times ] is the same as a search for [ New York Times ].