Blog Objective

This is a blog that attempts to make life easier by noting down the author's accrued knowledge and experiences.
The author has dealt with several IT projects (in Java EE and .NET) and is a specialist in system development.

26 May 2011

Structure & Concepts in CA SiteMinder

The following UML Class Diagram documents the main structural concepts in SiteMinder.

image

Electronic Records Management

Some points I made while considering whether TIFF or PDF format is more appropriate for the above.

  • Need to differentiate the processing for:
    1. Records “born” electronic – use acrobat distiller to convert to PDF
    2. Scanned records – use acrobat capture to convert to PDF, use OCR to convert to text
    3. Paper-based records
  • Archival workflow
    1. Document creation
    2. Document editing and annotation
    3. Tagging and metadata capturing
    4. Store and retrieve
    5. Print and distribute
  • PDF/A is based on PDF Reference 1.4 (Acrobat 5) and has the following constraints
    1. Self-contained: All fonts used have to be embedded & external content references are disallowed
    2. Device-independent: Colour must be device-independent and transparency is disallowed
    3. Self-describing: XMP (eXtensible Metadata Platform) is required
    4. Unfettered: Encryption and LZW compression are disallowed
    5. Multimedia, forms, embedded files and JavaScript are disallowed
  • PDF over TIFF
    1. More compact. I.e. smaller file size
    2. Metadata can be stored in PDF
    3. More device-independent

To Enable HTTP Compression in IIS

 

Need to enable it in Web.Config as follows:

<system.webServer>
  <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
    <dynamicTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </dynamicTypes>
    <staticTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </staticTypes>
  </httpCompression>
  <urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>

23 May 2011

Oracle WebLogic Class Loader Hierarchy

The detailed order for WebLogic class loading in top-down hierarchy follows:
  1. System Classloader
    1. WebLogic implementation classes
    2. Classes in the system classpath
    3. PRE_CLASSPATH and EXT_PRE_CLASSPATH
  2. Domain Classloader
    1. classes in the domain directory's lib folder
  3. Application Classloader
    1. Java EE shared libraries referenced in weblogic-application.xml
    2. Modules defined in the application
    3. Libraries from Java EE library
    4. Libraries from /APP-INF/lib
  4. Web Classloader
    1. Java EE shared libraries referenced in weblogic.xml
    2. Classes in WEB-INF/classes
    3. Libraries in WEB-INF/lib
WebLogic 10.3.3 allows for the Application to intercept the the System classloader. This is required for loading alternative versions of application libraries such as the Xerces and Ant. Doing so allows for the lower-level classloader (e.g. Web) to load classes/ libraries before the ones typically loaded by the System classloader.
In order to do this, the FilteringClassLoader mechanism a classloader that sits between Domain and Application  has to be used. this needs to be specified by the prefer-application-packages or prefer-web-inf XML tags.
If it interests you, the class-loading hierarchy for JBoss can be found here.

16 May 2011

Developers' Fears

As developers, we prefer disconnected communication with business analysts, clients, and users. Our comfort zone tends to be one where we can carefully craft our thoughts before responding.

Some common tools that aggravate such disconnect are:
  • email
  • IM
  • defect-tracking system
However, those more successful in their careers, are those who are capable of giving off-the-cuff responses and appearing confident in those responses.

Developers need to change for the betterment of their career.

06 May 2011

Apache Web Server Troubleshooting

How to troubleshoot Apache Web Server?

A few standard commands to know by hard:
  1. To confirm the modules that are or will be loaded in Apache: apachectl –M [-f <conf filename>]
  2. To check the virtual host load pattern: apachectl –S [-f <conf filename>]
  3. To test a httpd.conf file: apachectl –t [-f <conf filename>]
  4. To maintain the http server: apachectl start|stop|restart
  5. To start with a specified configuration file: apachectl –f <conf filename>
Create a minimalist httpd.conf. Something like:
Listen 80
ServerName myserver.com:80
ServerAdmin admin@myserver.com
#ServerRoot "." 
ServerRoot "/usr/local/apache2"
User nobody
Group nobody
#DocumentRoot "..\wwwroot" 
DocumentRoot "/home/data/html"
ErrorLog "logs/basic_apache.log"
LogLevel debug
#LoadModule log_config_module modules/mod_log_config.dll
LoadModule log_config_module modules/mod_log_config.so
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Host}i\" \"%{Referer}i\" %a %A" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/basic_access.log combined
</IfModule>
Turn on log filter to debug

How to troubleshoot virtual directories?

Create a minimalist httpd.conf. Something like:
Listen 80
ServerName myserver.com:80
ServerAdmin admin@myserver.com
#ServerRoot "." 
ServerRoot "/usr/local/apache2"
User nobody
Group nobody
#DocumentRoot "..\wwwroot" 
DocumentRoot "/home/data/html"
ErrorLog "logs/basic_apache.log"
LogLevel debug
#LoadModule log_config_module modules/mod_log_config.dll
LoadModule log_config_module modules/mod_log_config.so
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Host}i\" \"%{Referer}i\" %a %A" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/basic_access.log combined
</IfModule>
NameVirtualHost *:80
<VirtualHost *:80>
ServerName vhost1.com
#DocumentRoot "..\wwwroot" 
DocumentRoot "/home/data/html"
</VirtualHost>
<VirtualHost *:80>
ServerName vhost2.com
#DocumentRoot "..\wwwroot\vhost1" 
DocumentRoot "/home/data/html/vhost1"
</VirtualHost>
<VirtualHost *:80>
ServerName vhost2.com
#DocumentRoot "..\wwwroot\vhost2" 
DocumentRoot "/home/data/html/vhost2"
</VirtualHost>
<VirtualHost *:80>
ServerName vhost3.com
#DocumentRoot "..\wwwroot\vhost3" 
DocumentRoot "/home/data/html/vhost3"
</VirtualHost>
Create the necessary DocumentRoot for each virtual host with files therein for basic troubleshooting

How to troubleshoot WebLogic plug-in module?

  1. Turn the proxy parameters to debug mode:
    1. debug on
    2. ShowConfigInfo yes
  2. The debug file by default can be found in /tmp/wl_proxy.log

The HTTP error code thrown by the plug-in depends on the situation. Plug-in will return the HTTP error code 500 in the following conditions:
  • Neither WebLogicCluster nor WebLogicPort was specified in the httpd.conf file.
  • Unable to resolve the WebLogicHost parameter specified in the httpd.conf file.
  • Port number specified by WebLogicPort, in the httpd.conf file, exceeds 65535.
  • Unsuccessful in parsing the request while applying the PathTrim property.
  • The request header is of type Unknown Transfer-Encoding.
  • Failed to read the chunked request.
  • Encountered an error reading POST data from client.
  • Failed to open a temporary(temp) file.
  • Failed to write POST data to the temp file.
  • Encounetered an error reading POST data from the temp file.
  • POST timed out.
  • SSL was specified without the parameter trustedCAFile.

On the other hand, the HTTP error code 503 is returned when:

  • The maximum number of retries is exceeded. This value is computed by dividing ConnectTimeoutSecs by ConnectRetrySecs.
  • Idempotent is OFF.

Personal Experience


I had the privilege of troubleshoot Apache with WL proxy. Strangely, the proxy works with the non-clustered setting (by specifying the WebLogicHost <hostname>) but does not work with the clustered setting (WebLogicCluster <address>)

As far as I’m aware, there is nothing in WebLogic administration parameter setting required for a web server proxy to WLS cluster.

After playing with a couple of parameters (e.g. request timeout, retries, IO timeout) and giving up as nothing works, I finally looked in the wl_proxy.log and discovered the issue! We had used IP address to route traffic to from Apache but the WLS cluster was configured with the hostname. Apparently, the proxy was not able to route traffic in the cluster.

03 May 2011

Oracle JDBC Driver Connection Strings

Need to keep these handy.

At the same time, this site is lovely (http://www.connectionstrings.com/) for accessing Databases (like Oracle) from .NET.

For OCI (or Type 2) drivers:
  • jdbc:oracle:oci:@TNS_ALIAS
  • jdbc:oracle:oci:@<HOST>:1521:<SID>
  • jdbc:oracle:oci@//host:1521/service_name
  • jdbc:oracle:oci:@(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)
    (HOST=cluster_alias) (PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=service_name)))
  • jdbc:oracle:oci:@(DESCRIPTION= (LOAD_BALANCE=on)
    (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=service_name)))

For Thin (or Type 4) drivers:
  • jdbc:oracle:thin:username/password@//host:1521/service_name
  • jdbc:oracle:thin@//host:1521/service_name
  • jdbc:oracle:thin@//cluster-alias:port/service_name
  • jdbc:oracle:thin:@<HOST>:1521:<SID>
  • jdbc:oracle:thin:@(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)
    (HOST=cluster_alias) (PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=service_name)))
  • jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(port=1521)(host=host1)))
    (connect_data=(INSTANCE_NAME=ORCL)))";
  • jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
    (ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=service)))
Note the following:
  1. For Oracle 8, we will need to use the instance name (SID); for 8i or 9i onwards, we should use the SERVICE_NAME parameter instead.
  2. If there is a list of addresses to load balance or failover to, use the ADDRESS_LIST to state the list. ADDRESS should be used otherwise.
  3. If Oracle RAC is in used, the last ones above (indicated with LOAD_BALANCE=on) should be used.

 

In order to set-up the data-source for Oracle RAC within WebLogic, use the following:

  • For WLS multi-pool setting:

<url>jdbc:oracle:thin:@//host:1521/service_name</url>
<driver-name>oracle.jdbc.xa.client.OracleXADataSource</driver-name>

  • For WLS connection pool setting:

DriverName=oracle.jdbc.OracleDriver
URL=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service)))