Websphere Archive

WebSphere Application Server Interview Q’s(FAQ)

Hi All,

Below are the few interview Question in WebSphere:

1. How to choose websphere over other application servers?

2. What is the difference between web server and application server?

3. How to check a particular port is working or not in unix?

4. What are the issues commonly seen while installling the WebSphere Application Server

5. What is generic server cluster and how do you allow to configure standalone servers??

6. What is the difference between Dmgr and AppServer profile

7. Compared to custom and AppServer profile which is the best profile and why??

8. How to change a port no. using wsadmin?

9. What do you mean by Gloabl Security and how to enable it??

10. What are the different types of log files?

11. How do you take back ups in WAS

12. What is meant by SSL certificate and how do we renew them?? What is the defualt key store location for WAS

13. What are the different kinds of sync operations and How do you disable auto sync

14. Explain JNDI in WAS

15. How do you make WAS run as a service and why

16. How do you disable security for Deployment manager without logging into the console

17. What are the steps you will follow while installing a fix pack? How do you trouble shoot fixpack installation falied?

18. How do you recover the admin console password is lost?

19. what is class loader? how many types of class loaders are there?

20. when you are logged into dmgr admin console, if you click any option, it is showing 500 internal error, what could be the problem and how do you trouble shoot ?

21. What are the two basic steps that admin have to do after deploying the application & before running the application?

22. If the app server crashes in the middle of application deployment, wht could be the reason and wht steps we have to follow?

23. Compare the WAS process server & WAS portal server and WAS application server?

24. What Development Environment(s) are available to develop applications for WebSphere?

25. With Java2Security enabled on WebSphere Application Server, and you are performing an Enterprise Application deployment, what security file is open during deployment?

Common classloader (ClassNotFoundException) issues in WebSphere Application Server

JNDI lookup for a WebSphere application server resource could be tricky due to lots of client jar being required.

Below are few common exceptions you might run into during JNDI lookup from an external java client.

 

1. Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory

Remedy:  Make sure you place “Naming.jar” in the classpath

Location:   WEBSPHERE_HOME\deploytool\itp\plugins\com.ibm.websphere.v7_7.0.0.v20080817\wasJars

 

2. Caused by: java.lang.ClassNotFoundException: com.ibm.ejs.ras.Tr

Remedy:  Make sure you place “Ras.jar” in the classpath

Location : WEBSPHERE_HOME\deploytool\itp\plugins\com.ibm.websphere.webservice.rt.v5.1.1_6.1.1.v200808141532\lib

 

3. Caused by: java.lang.ClassNotFoundException: com.ibm.ws.exception.WsException

Remedy:  Make sure you place “wsexception.jar” in the classpath

Location: WEBSPHERE_HOME\deploytool\itp\plugins\com.ibm.websphere.webservice.rt.v5.1.1_6.1.1.v200808141532\lib

 

4. Caused by: java.lang.ClassNotFoundException: com.ibm.ws.bootstrap.RASWsLoggerFacTory

Remedy:  Make sure you place “Bootstrap.jar” in the classpath

Location:  WEBSPHERE_HOME \lib

 

5. Caused by: java.lang.ClassNotFoundException: org.eclipse.hyades.logging.events.cbe.impl.EventFactoryContext

Remedy:  Make sure you place “com.ibm.jaxws.thinclient_7.0.0.jar” in the classpath

Location:  WEBSPHERE_HOME \runtimes

 

6. Exception in thread “main” javax.naming.ConfigurationException: The property com.ibm.ws.naming.wsn.factory.initial is not set or is not a string.  The most likely cause is that the jar which contains the file com/ibm/websphere/naming/jndiprovider.properties cannot be found by  the class loader.

at com.ibm.websphere.naming.WsnInitialContextFactory.initClass(WsnInitialContextFactory.java:145)

Remedy :  Make sure you place “namingclient.jar” in the classpath

Location: WEBSPHERE_HOME\deploytool\itp\plugins\com.ibm.websphere.v7_7.0.0.v20080817\wasJars

 

7. Caused by: java.lang.ClassNotFoundException: com.ibm.CORBA.iiop.ORB

Remedy :  Make sure you place “Ibmorb.jar” in the classpath

Location:  WEBSPHERE_HOME\java\jre\lib

 

For further troubleshooting classloader issues, please refer the below post:

 

Cheers,

Wonders Team 🙂

 

Websphere Application Server configuration with LDAP Server

 Security is a critical aspect of any distributed application model. Most of the firms have a centralized repository of the users in LDAP servers like Active Directory, Novell LDAP.

This post illustrates how you can configure authentication to the WebSphere Application server using an Open DS LDAP  commonly reffered as WebSphere LDAP configuration.

Open DS is a freeware and can be downloaded from the below site.

http://opends.java.net/

Steps to configure:

1.       Setting up the global security.

Global security configuration applies to the security policy for all administrative functions and is used as a default security policy for user applications. Security domains can be defined to override and customize the security policies for user applications.

Login to WebSphere 7 admin console, navigate to Security –> Global Security.

 

Global security settings

Global security settings

2.       Enable administrative security option.

3.       Configure user account repository.

Select “Standalone LDAP Registry” from the drop down of “User Account Repositoryà configure

4.       Define the LDAP configuration details in the next page.

Specify the below properties.

Primary administrative user name:  Specifies the name of a user with administrative privileges that is defined in your custom user registry

Type of LDAP Server: Since we are using Open DS for the illustration, select ‘Custom’ from the drop down.

 

 

Click on “Test Connection” button to check the ldap configuration settings. Save the changes

5.       Modify the Advanced LDAP User Registry Settings.

Define the User Filter to use (objectclass=inetOrgPerson), since it resonates to the LDAP user registry objectclass settings.

6.       Set the LDAP registry as Current realm definition.

6

7.       Restart the WebSphere Application server.

8.       Login into the admin console using the operator from the LDAP Server.

 

For further reading:

http://pic.dhe.ibm.com/infocenter/iisinfsv/v8r1/index.jsp?topic=/com.ibm.swg.im.iis.found.admin.common.doc/topics/wsisadmin_config_was_ldap.html

 

Cheers,

Wonders Team

Installation of WAS Fix pack

Steps to install the Fixpack:-
Following is the step-by-step approach for installing the fixpacks for WebSphere Application Server environment:-

(1) Take the back-up of the existing configuration. You run the below command to take the backup of the existing
configuration from the individual profiles-
(a) ./backupConfig.sh name_config.zip (unix)
(b) backupConfig.bat name_config.zip  (windows)

(2) Download the update installer (for WAS6.1 use http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg24012718)

Note: While downloading the update installer make sure that the version of update installer is more than your websphere application server installation. Check the WAS version  by running the below commands from appserver profiles bin folder) :

(a) ./versionInfo.sh (unix)

(b) versionInfo.bat (windows)

(3) Now, we can start the installation of fix pack to the existing WAS installation by using the following two different ways-
(a) Silent Mode — Generally, this mode is used for windows or UNIX based OS
(b) Graphical Mode — This mode is generally used for windows based OS

Graphical User Interface: Following are the steps for installation of fix packs using the GUI mode:-

(1) Download the required fix pack from the official IBM support Web site (http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg27004980#ver61) in to temporary directory updi_root /maintenance directory.

(2) Make the current working directory: updi_root.

(3) Ensure that you stop all running processes. (we can use ps -ef|grep java and kill -9)

(4) Launch the Update Installer. For example:
(a) Windows – update.bat
(b) Windows Vista – update.exe
(c) AIX,HP-UX,Linux,Solaris – ./update.sh

(5) The Welcome panel will display. Click Next.

(6) The system will prompt for the location of the product that you want updated. Click Next.

(7) The system will present the choices of Install or Uninstall maintenance. The install option is the default. Click Next.

(8) The system will prompt for the maintenance location where packages can be found. Enter the directory name containing the packages, or browse for the required directory. Click Next.

(9) The following options exist for installing a fix pack:
(a) For installing the fix pack without the feature pack, select the desired fix pack. Click Next.
(b) For installing the fix pack with the feature pack, select the desired fix pack. Another panel is displayed that prompts you to install the enabling interim fix. Click Next.

(10) Before the installation, the Confirmation panel will confirm which packages will be installed.

(11) After the installation, the Summary panel will list which packages have been installed.

(12) After you install the fix pack, check the installation log to verify that the install was successful. The log can be found at app_server_root /logs/update/maintenance_package.install.

Note: (1) By any one of the following messages in the log file we can confirm the status of fix pack installation.
(a) INSTCONFSUCCESS – The operation was a success.
(b) INSTCONFPARTIALSUCCESS – The operation was partially successful, refer to the log for more details.
(c) INSTCONFFAILED – The operation failed, refer to the log for more details

(2)*** The update installer and WAS installation should be installed by using the same user id belonging to the group id.

regards,

weblogic-wonders team

BASIC Authentication in Websphere Application Server

1 ) Secure the application resources using the descriptor (web.xml)

<!DOCTYPE web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN” “http://java.sun.com/dtd/web-app_2_3.dtd”>
<web-app id=”WebApp”>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<security-constraint>
<display-name>Constraint-0</display-name>

<web-resource-collection>
<web-resource-name>Constraint-0</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>

<auth-constraint>
<role-name>pegaadmin</role-name>
</auth-constraint>

<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>

</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
</login-config>

<security-role>
<role-name>pegaadmin</role-name>
</security-role>

</web-app>

 

2) Deploy the application on Websphere Application Server.

3)  Go to

Enterprise Applications > Test_Basic_war > Security role to user/group mapping


You will see the application role configured in the web.xml. Map the users to this role from WAS Console.

Step 4) Go to

Security> Secure administration, applications, and infrastructure  and Check Enable application security.

Restart your Server.

Step 5) Access your application, you will be prompted for authentication.

 

Let us know if you face any issues.

 

Cheers!

Wonders Team

Analyzing WebSphere Thread Dump

We can take thread dump on WAS using wsadmin tool in the following way.

D:\IBM\WebSphere\AppServer\profiles\ProcessCommander\bin>wsadmin.bat
WASX7209I: Connected to process “server1” on node WKHANFXPNode02 using SOAP conn
ector; The type of process is: UnManagedProcess
WASX7029I: For help, enter: “$Help help”
wsadmin>set jvm [$AdminControl completeObjectName type=JVM,process=server1,*]
WebSphere:name=JVM,process=server1,platform=proxy,node=WKHANFXPNode02,j2eeType=J
VM,J2EEServer=server1,version=6.1.0.0,type=JVM,mbeanIdentifier=JVM,cell=WKHANFXP
Node01Cell,spec=1.0
wsadmin>$AdminControl invoke $jvm dumpThreads

This will create a java core file in the following directory

D:\IBM\WebSphere\AppServer\profiles\ProcessCommander

javacore.20110511.174141.9628.txt

We need to download IBM Thread Dump Analyzer from here

Start the tool using the following command

E:\tools\jca412>java -Xmx515m -jar jca412.jar

Open the thread dump from

File > Open Thread Dumps

Then click on Analysis > Thread Details.

This will give you details of all the threads.