TechnoBuzz

A Techno Blog, mainly about Java

JDK 5.0 atomic

atomic variable classes in java.util.concurrent

Advertisements

November 29, 2004 Posted by | J2EE | Leave a comment

Managing J2EE Projects

J2EE Application Development Series
Ant or Maven?

Maven for Portal Projects.

November 28, 2004 Posted by | SW Tools | Leave a comment

setting websphere studio 5 runtime path

websphere+studio+5+runtime+path

RTPWUG presentation on topic

Visibility defines which classes are "reachable" Normally, visibility extends "up" but not "down"

J2EE Java Classloader  (classpath environment variable)
^
Websphere Extension Classloader (ws.ext.dir for use by any application)
^
EAR Classloader
^
WAR Classloader (module classloader)
Delegation defines the "preference" order of classloaders
Parent First - "down"
Parent Last - "up" 

WebSphere uses several classloaders to load the application code from the modules deployed to the server. The number and function of these classloaders depends on the classloader isolation mode.

Do use the new J2EE application visibility provided in WebSphere 4.03, as it conforms to the J2EE 1.3 specification, and is therefore the least likely to change in the future.

com.ibm.ws.classloader.J2EEApplicationMode = true

New J2EE Application visibility – PARENT_FIRST : the .war module classloaders delegate to the parent classloader before attempting to load classes. You can change this behavior by setting the JVM system property:

com.ibm.ws.classloader.warDelegationMode

New J2EE Application visibility – a separate classloader for each Web module. Classes in one Web module cannot reference classes in other Web modules .Web modules can reference classes in any utility JAR files and EJB modules.

New J2EE Application visibilitya single shared classloader for dependencies (manifest classpath entries),  utility  JAR files and EJB modules. EJB modules can reference classes in all utility JAR files, but cannot reference classes in Web modules.

The main difference between Application visibility and new J2EE Application visibility is that Application visibility lets classes in EJB modules reference classes in Web modules, and classes in   one Web module reference classes in another Web module. If you need to do this,   you will need to use Application visibility.

Applications classloader policy: how applications share classloadersor not – Single (shared) or multiple.

WAR classloader policy: how war files are loaded per application – Application (dictated by application classloader plicy), or Module.

Sample classloading issue with WAS5

November 23, 2004 Posted by | SW Tools | Leave a comment

Object Country AOP

Object Country: [talk] [code]

November 21, 2004 Posted by | Uncategorized | Leave a comment

New Java Gig

I start a new job with the Administration of the Courts in the Technology division on 18th. It says on this web site that their web site is pretty good. Here is a report from Gartner on the Project. [old site]

November 17, 2004 Posted by | Current Affairs | Leave a comment

Open Source for Win2k

AbiWord is an award winning small, fast, featureful and crossplatform word processor.

Vim is an advanced text editor that seeks to provide the power of the de-facto Unix editor ‘Vi’, with a more complete feature set.

Fabforce’s DBDesigner is a visual database design system that integrates database design, modeling, creation and maintenance into a single, seamless environment.

OpenOffice

November 16, 2004 Posted by | Open Source | Leave a comment

WAS 5 connection manager

In Websphere version 5, its supports a new connection manager connector. It is implemented as JCA style connector.

http://localhost:9090/admin

Resources -> JDBC Providers : On this screen you can create a new JDBC provider or click on an existing provider (i.e DB2Universal JDBC Driver).

By clicking on the Provider name brings up a new screen (General Properties):

classpath: location of db2cc.jar

implementation classname: com.ibm.db2.jcc.DB2ConnectionPoolDataSource

On this same screen, there is a title of additional properties which should have data sources, click on that link which brings up a new screen.

This page has a title of Configuration. Here is where you configure the data source name and JNDI name.

name: test

jndi name:jdbc/test

Also, on this page is a button to test the connection.

Now, you are all set to go in java with your pooled connection.

ctx = new InitialContext();
ds = (DataSource)ctx.lookup("jdbc/test");

try {
Connection con = ds.getConnection("","");
}
catch (Exception ex){}
finally
{if (con!=null) con.close();}

November 16, 2004 Posted by | SW Tools | Leave a comment

Thread safe issues in Servlets

After browsing thru the book Head First Servlets and JSP , I have to say the book is quite good. Even though I have no interest in the Sun Certified Web Component Developer Exam, the way it presents the material is quite different than what I am used to.
The JavaCamp site has some things to be aware of while developing servlets. Things like sessions and global class instance files not being thread safe. This site had some information on the topic as well. Agaiin, its notes for the SCWCD exam.
The Online version of the book Java Servlet programming is a good reference. Lastly, as this article states : "thread safety is an issue you must contend with regardless of your application type or project size"

In the servlet model (multithreaded) , container maintains a thread pool (threads waiting to execute some code).  The way it work is that there is a dispatcher thread that manages these threads in the pool (worker threads).

When container receives a request for a servlet, the dispatcher thread picks picks up a worker thread from the pool, and the worker thread then executes the service() method of the servlet.

If the container receives a new request while the thread is still working, it will pick up the new thread from the pool. It does not matter if the new thread is for the same servlet, the container just does its job of executing multiple threads.

The single thread model is used for tasks such as things that must be excuted sequentially and not simultaneously.  Basically, the specification says that it will not exceute the service() routine in more than one thread at the same time. However, the container can create multiple instances of a servlet if the servlet implements the single thread model. The single thread model should be avoided if possible.

Thread safety tips:

  • local variables: each thread gets its own copy of the local variables.
  • instance variables: not thread safe. There is only one copy of the instance variable per instance of the servlet. Use instance vriables for variables that can be initialized at servlet startup and can be used througout life of the servlet (i.e connection variable).
  • class variables: not thread safe also. Use static on variables where value remains constant.
  • context scope (getServletContext()): not thread safe
  • session: not thread safe also. try synchronized (session){}
  • request:  thread safe. Paased as a a parm of the service() method.

November 15, 2004 Posted by | Servlets & JSP | 79 Comments

Computer Hardware

I am checking out my options on hardware for computers. There are resellers where you can get good deals.
For example,  on the site pricewatch, look for lets say Notebooks without Operating Systems installed, then lets say the Asus Centrino.

To get ratings on any of the resellers, check out the site resellerratings.com.

Ram and other deals:

dealram.com  or Crucial

Specials:


dealcoupon.com

other good sites:

discountlaptops.com

powernotebooks.com

November 13, 2004 Posted by | Web/Tech | Leave a comment

Mastering J2EE Application Development Series

J2EE Application Development Series

Ted Neward: Slicing and Dicing J2EE

November 13, 2004 Posted by | J2EE | Leave a comment

AOP

Introduction to AOP

November 12, 2004 Posted by | IoC | Leave a comment

JDO 2 Queries – Part 2

TheServerSide: "JDO 2 has overhauled the query support. "

November 12, 2004 Posted by | JDO | Leave a comment

Inside Scoop on J2EE

Link to article by Monson-Haefel on future of J2EE.

November 10, 2004 Posted by | J2EE | Leave a comment

Struts wiki articles

Wiki on struts

November 10, 2004 Posted by | Struts | Leave a comment

Request object in Struts when validation fails

I ran into a problem within struts where my validation fails on the form data that is submitted
from my jsp, and when control is returned back to the jsp as specified in the struts config file,
i lose my request data. In my case it was a string value that is populated in a
servlet using the request object prior to forwarding to the jsp the first time.  Seems this is a common
thing with struts as the issue is also described here
[link]
[link].

The way i got around it was to set the string value in a session object prior to submitting the data. Then, if the jsp form validation fails, and
the jsp is reinvoked where the request object is null, I can get the string value from the session object.

November 10, 2004 Posted by | Struts | Leave a comment

Spring Framework

Spring Framework  [forums]

Jetspeed to use Spring.  JPOX uses Spring as well.  [article
[article]

November 10, 2004 Posted by | IoC | Leave a comment

Fool Money Ball Collection

Tom Gardner found the lessons from Lewis’ book quite applicable to
general stock investing and very relevant in his search for
undiscovered, unloved, and undervalued small-cap Hidden Gems.
[part1] [part2] [part3] [part4] [part5]

November 9, 2004 Posted by | Current Affairs | Leave a comment

Scrolling News

FastBuzz: "A free web based aggregator to search and viewthe latest additions to your favorite online publications"

Or Just read WSJ Sunday

November 9, 2004 Posted by | Blogging | Leave a comment

e-learning

From learning how to read financial statements, to quizes, its at the e-learning centre

November 9, 2004 Posted by | Web/Tech | Leave a comment

Inversion of Control

In a previous link blast, I leaned about IOC. Here is another article on the topic viaPyrasun 2.0 – The Spille Blog

November 8, 2004 Posted by | IoC | Leave a comment

OLAP JSP

JPIVOT – JPivot is a JSP custom tag library that renders an OLAP table and let users perform typical OLAP navigations

November 8, 2004 Posted by | Servlets & JSP | Leave a comment

start Portal from linux

From the /opt/WebSphere/AppServer/bin directory:

root@ibm-orpheus bin]# ./startServer.sh WebSphere_Portal

Then in a browser:

http://localhost:9081/wps/portal/

Admin console is here:

http://localhost:9090/admin/

November 8, 2004 Posted by | Portals | Leave a comment

IBM and some Oracle

zSeries – Mainframe Servers

iSeries – Midrange Servers

pSeries – UNIX Servers
xSeries – Intel Processor-based
Servers

IBM Infocenter

IBM Tech Briefings

DB2

Html Cross
Reference

Html Colors Map

Portlets

Programmer Resource

Oracle Blogger

November 5, 2004 Posted by | J2EE | Leave a comment

Election Info

Election links


electoral-vote

November 3, 2004 Posted by | Current Affairs | Leave a comment

Kerry Watch

Here is an assortment of the polls. Go Kerry!

November 1, 2004 Posted by | Current Affairs | Leave a comment

KerryEdwards

The Democratic Convention has a blog.

Or check out MSNBC’s The HardBlogger, or try the electablog.

Andrew Sullivan , a Kerry Supporter.

Un-official Kerry Blog

Clinton blog real, ?

Atrios

From the roots blog

Stakeholder

Election watch

Oliver Willis

Cagle on MSN

Cagle.com

Slashdot picks

Kerry Edwards Blog

National Debate

November 1, 2004 Posted by | Current Affairs | Leave a comment