ClassNotFound : A Close look at Class Loader in WebSphere Application Server


Class Not Found Exception and Class Loader

A class loader is an object that is responsible for loading classes. The class ClassLoader is an abstract class. Given the name of a class, a class loader should attempt to locate or generate data that constitutes a definition for the class. A typical strategy is to transform the name into a file name and then read a class file of that name from a file system.

When a class loading request is presented to a class loader, it first asks its parent class loader to fulfill the request. The parent class loader, in turn, asks its parent for the class until the request reaches the top of the hierarchy. If the class loader at the top of the hierarchy cannot fulfill the request to load a class, then the child class loader that called it is responsible for loading the class. If the child is also unable to load the class, the request continues back down the hierarchy until a class loader fulfils it or aClassNotFoundException is produced by the last class loader.

image

Continue reading

Installing WebSphere Application Server v7, Part1 : Graphical and Silent installation


Graphical Mode

1. Login as root

2. Then run the launchpad.sh or WAS_binaries/WAS/install
Note: if you have trouble with JAVA while installling…, Force the installation to use the correct JRE
./install -is:javahome WAS_Binaries/JDK/jre.pak/repository/package.java.jre/java/jre

3. You will get an welcome page, click on next to proceed

4. Accept the license agreement and then click next

5. This screen will check for system requirements. Once it was succeeded, proceed to next step

6. If you have any previous versions of WAS, it will detect. Otherwise go forward by selecting Install a new copy of the product to another directory

7. The optional features panel is displayed. you can choose to install sample applications, non English language packs for admin console and runtime environment,

8. The screen is for the installation directory. Choose the target directory and click next. The installer program will check for the space requirements and then proceeds

9. Select an initial server environment on the WebSphere Application Server environments panel. (you can choose not to create any profile at this time, so that later we can create using profile management tool)
Profile Options: Cell, Management (deployment manager, administrative agent, job manager), Application server, Custom, Secure proxy, None

10. After selecting the profile, it will ask you, whether to enable administrative security or not

11. The next screen will show the option for the centralized installation manager (CIM). Select the Install Centralized Installation Manager Repository check box to install the repository now and specify or browse to a target location.

12. The next screen is the summery of the options, you have chosen. Review them and click next

13. Once the installation is completed, you’ll have an option to start the first steps console.

14. Also, if you’ve chosen none for the profile, it presents an option to start the profile management tool.

Silent installation

1. Login as root

2. Locate the responsefile.nd.txt file. Take a copy of that and save as /tmp/MyWAS7Installation.txt

3. Edit the MyWAS7Installation.txt file as required

4. WAS_Binaries/WAS/install -options /tmp/MyWAS7Installation.txt -silent

Tips for Editing responsefile

1. Accept the license
-OPT silentInstallLicenseAcceptance="true"

2. Disable OS Prerequisite checking
-OPT disableOSPrereqChecking="true"

3. File permission checking
-OPT checkFilePermissions="true"

4. Installation type
-OPT installType="install_type"

Options: 
installNew - Installs a new copy of the product.
addFeature - Adds features to an existing installation. 
upgrade - Upgrades a trial edition to a licensed edition, or upgrades Express edition to Base edition.

5. Profile type
-OPT profileType="profile_type"

Options: 
CELL - Creates a cell with two profiles: a deployment manager and an application server node that is already federated into the deployment manager cell. This is useful for development environments.
MANAGEMENT - Creates a management profile that provides the servers and services necessary to manage your WebSphere environment.
You must also specify the type of management profile in the profiles section with the -OPT PROF_serverType option:
    * DEPLOYMENT_MANAGER (default)
    * JOB_MANAGER
    * ADMIN_AGENT
STANDALONE - Creates a standalone application server profile.
CUSTOM - Creates a custom profile which belongs to a deployment manager cell, to make applications available to the Internet or to an intranet under the management of the deployment manager. You must federate this node to use it.
SECURE PROXY - Creates a DMZ Secure Proxy Server for IBM WebSphere Application Server which accepts requests from the internet and forwards them to application servers. The server resides in the DMZ.
NONE - Does not create a profile during installation. However, if you specify none, then you must create a profile after installation to have an operational product.

6. Features
-OPT feature="feature_name"

options: 
nofeatures - Does not install any additional features. If you are not installing any features, then you must specify this value or the installation will fail.
samplesSelected - Installs the samples applications for learning and demonstration environments. The samples are not recommended for installation on production environments.
languagepack.console.all - Installs all the non-English language files for using the administrative console from machines with non-English locales. If you do not select this option then only the English language pack is installed.
languagepack.server.all - Installs all the non-English language files that support the application server runtime environment such as the wsadmin tool and logging. If you do not select this option then only the English language pack is installed.

7. Administrative security
  -OPT PROF_enableAdminSecurity="true"
  -OPT PROF_adminUserName=
  -OPT PROF_adminPassword=
  -OPT PROF_samplesPassword=

Further customizations are based on the profile you choose to create.

WebSphere Application Deployment with JDBC connectivity


Steps involved in this are:

  • Create a JDBC source
  • Create a J2C alias
  • Create a Data source
  • Deploy Application
Creating a JDBC Provider

The JDBC provider object provides the actual JDBC driver implementation class for access to a specific database type, that is, Oracle, SQL Server, DB/2 etc. We associate a data source with a JDBC provider and data source provides the connection to the database.

  • In the administration console

            Resources -> JDBC -> JDBC Provider

  • Here we need to select the scope, at which the jdbc provider will be available like CELL/NODE etc. Scope specifies the level at which the resource definition is visible
  • Then click new

WebSphere Application Deployment


To deploy applications to websphere application server, go to Applications -> New applications in the administration console. Here you have option to install Enterprise application or business level application or assets

  • Enterprise application: An EAR file on a server configured to hold installable Web Applications, WAR, Java archives, library files, and other resource files.
  • Business Level application: A business-level application is an administration model similar to a server or cluster. However, it lends itself to the configuration of applications as a single grouping of modules.
  • Asset: An asset represents one or more application binary files that are stored in an asset repository, such as Java archives, library files, and other resource files. Assets can be shared between applications.

Select new enterprise application. Under this selection, you can deploy packaged j2ee applications like EAR, WAR, JAR or SAR modules.

On the next screen you have options to select the path to the application binary file location, from where it should be installed.

  •     From loacal filesystem
  •     Remote file system

After choosing the path to the application binary…click next
Next page is ‘Preparing for the application installation’, here you can choose install option

  • Fast Path: The deployment wizard will skip advanced settings and only prompt for the absolute minimum settings required for the deployment.
  • Detailed: The wizard will allow, at each stage of the installation, for the user to override any of the J2EE properties and configurations available to an EAR file

Next screen will present some more deployment options

  • Precompile JavaServer Pages files: Specify whether to precompile JavaServer Pages (JSP) files as a part of installation. The default is not to precompile JSP files.
  • Directory to install application: Specifies the directory to which the Enterprise Application Resource (EAR) file will be installed. You can change this if you want the application to be physically located outside of the WebSphere file structure.
  • Distribute application: The default is to enable application distribution. You can override this and choose to not distribute the application across multiple nodes.
  • Use Binary Configuration: Specifies whether the application server uses the binding, extensions, and deployment descriptors located within the application deployment document, the deployment.xml file (default), or those located in the EAR file.
  • Deploy enterprise beans: The tool generates the code needed to run enterprise bean (EJB) files. You must enable this setting when the EAR file is assembled and theEJBDeploy is not run during packaging. Its default value is false.
  • Application name: A logical name for the application. The default name is the same as the EAR file. An application name must be unique within a cell.
  • Create MBeans for resources: Specifies whether to create MBeans for resources, such as servlets or JSP files, within an application when the application starts. The default is to create MBeans.
  •  Override class reloading settings for Web and EJB modules: Specifies whether the WebSphere Application Server runtime detects changes to application classes when the application is running. If this setting is enabled and if application classes are changed, then the application is stopped and restarted to reload updated classes. The default is not to enable class reloading.
  • Reload interval in seconds: Specifies the number of seconds to scan the application’s file system for updated files.
  • Process embedded configuration: Specifies whether the embedded configuration should be processed. An embedded configuration consists of files such as resource. xml and variables.xml. When selected or true, the embedded configuration is loaded to the application scope from the .ear file.
  • File Permission: Allows all files to be read but not written to
        • Allows executables to execute
• Allows HTML and image files to be read by everyone
  • Application Build ID: A string that identifies the build version of the application. Once set, it cannot be edited.
  •  Allow dispatching includes to remote resources: Web modules included in this application are enabled as remote request dispatcher clients that can dispatch remote includes. Default = true.
  •  Allow servicing includes from remote resources: Web modules included in this application are enabled as remote request dispatcher servers that are resolved to service remote includes from another application. Default = true.
  •  Business level application name: Specifies whether the product creates a new business-level application with the enterprise application that you are installing or makes the enterprise application a composition unit of an existing business-level application.
  •  Asynchronous Request Dispatch Type: Specifies whether web modules can dispatch requests concurrently on separate threads.
  •   Allow EJB reference targets to resolve automatically: Specifies whether the product assigns default JNDI values for or automatically resolves incomplete EJB reference targets.
 Here choose the appropriate options depending on your application and click next

on next screen you can Map modules to server. The list of modules available in the applications will be displayed.

 

Next screen will show you the summery of the all the options you’ve choosen for this application deployment.

  • Verify the summery and click finish for the application to be deployed to websphere.

Once the deployment is done, the application will be stored (runtime version) in installedApps directory which will be under profile_root/installedApps/

Now that your application deployment has been completed, check it under the Applications -> Enterprise applications. You can see the list of applications deployed under this selection.

on this screen, you’ll have the following options:

  • Start: When an application is stopped, you will see a icon. To start, select one or more applications and click on the Start button.
  • Stop: When an application is started, you will see a icon. To stop, select one or more applications and click the Stop button.
  • Install: As a part of deploying an application, you install application files on a server. Depending on EAR/WAR complexity, the deployment wizard will dynamically produce a guide of steps which requires user input.
  • Uninstall: Select applications you wish to uninstall. It is recommended you stop applications first.
  • Update: Used to apply delta updates. Only the application code elements that have been changed in the application since last deployment are updated while the application remains running.
  • Rollout Update: If an application is deployed across multiple nodes, you can use the Rollout Update option which replaces the application one node at a time. Using this method reduces the amount of time that any single node member is unavailable for service during application deployment.
  • Remove File: Deletes a file of the deployed application or module. Remove File deletes a file from the configuration repository and from the file system of all the nodes where the file is installed.
  • Export: Allows the application to be exported as an EAR file. Can be used to back up an application version.
  • Export DDL: By using the Export DDL option, you can export DDL (Data Definition) files located within database-aware EJB modules.
  • Export File: Allows the exporting of a specific file from an enterprise application or module.
  • Select your application and then click start, to start the newly installed application. Test it in the browser accordingly.

Note: it is assumed that there is no web server in the setup. If you have web server, enable automatic node synchronization and generate-propagate plugin before initiating the deployed application

WebSphere Application Server Troubleshooting, Part-0: IBM Support Assistant


This is a new series on the blog which deals with troubleshooting tools and techniques in WebSphere Application Server [WAS] administration. During this series of the articles, i’ll guide you through different tools available for troubleshooting issues like heap issues, hung threads, memory analysis, performance analysis etc..

The first and important tool is “IBM Support Assistant Workbench”.

What is IBM support assistant?

From IBM site – a complimentary software offering which provides you with a workbench to help you with problem determination. With a focus on quickly finding key information, automating repetitive steps and arming you with a variety of serviceability tools, you’ll be prepared for self-analysis and diagnosis of problems and faster time to resolution.

There is good amount of information available on this tool ,so i’m not going to write it again. Below are some of the good and best references to learn more about IBM support assistant.

1. IBM Support Assistant [ISA] quick start guide [mp3 from IBM support portal]

2. Downloading IBM Support assistant workbench [Video from sgwebsphere/youtube]

3. Installing and Running IBM Support assistant workbench

Download ISA from here: http://www-01.ibm.com/software/support/isa