WebSphere Class Loaders and Shared Library, Part 1 (Intention)

Intention

This is always the problem where to put common used class files in application server, so that they can be accessed by applications or web modules without duplicating them in every module. Class loader and shared library are going to solve this problem where class loader tells you where to find and load class files, while shared library tells you how to specify files to applications. If these settings are not well configured in WAS, the ClassCastExcpetion or ClassNotFound Exception will occur.

Notice, this article is not going to present how to configure the class loaders and shared library which are discussed very well in WAS6 InfoCenter, this article is going to give you a concise overview of class loaders and shared library both in WebSphere Application Server and Portal Server environment.

Case Scenarios

These are two typical scenarios that you will consider to use class loaders and shared library.

Sample Description

The simple sample used here is the cooperative portlets which transfer complex data type between source and target. When the link is clicked in source, vaule1 and value2 will be set to target. The complex data type CoComplex is defined in CoJava.

To the scenario 2, target resides in a second enterprise application which talks to source from the first application.

 

Scenario 1

CoPortletEar has two web modules: SourcePortlet.war and TargetPortlet.war. These two modules are both using class from CoJava.

Question: where should I place CoJava.jar that both web modules could find it and cause no runtime problem?

Scenario2

 Two enterprise applications, CoPortletEar and TargetEAR. Both of them access classes from CoJava.

Question: where should I put the CoJava.jar so that both applications can access it and cause no runtime problem?

 

You will find answers after you finish this article.

To be continued...

Resources:

Shared Libraries: WAS6 InfoCenter (Setting up the application serving environment->Administrating application servers-> Managing shared libraries)

Class Loaders: WAS6 InfoCenter (Developing and deploying applications->Class loading)

Classloading in WebSphere Portal: WebSphere Portal InfoCenter (Developing portlets->Portlet development basics->Creating a simple portlet)

Best Practice for Using Common Application Files

Learning more about the Classloader

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值