See Servlet Spec 2.3, section 9.7.2

validateJarFile(C:\jboss\server\default\.\tmp\deploy\tmp49777abc-exp.war\WEB-INF\lib\servlet.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

How can a tester select good inputs for test cases?

Good Inputs can be selected from Domain Knowledge, Equivalence Partitioning and Boundary Value Analysis.

What is Validation and Verification?

Validation is a process to identify whether a system has been developed for its intended purpose. Verification is a process to identify whether a system has been developed in compliance with its specifications.

Debugging vicious java.net.BindException (Windows)

java.net.BindException is thrown when JVM fails binding a socket to a local address and port.. Most common reason is that port is already used by some other application/service. Message like “Port already in use: 1098;” further confirms this.

This is how you can debug this exception:

  1. Check which service is binding the port by command “netstat –b”

This will list down all port and the application which binds the port like:

Proto Local Address Foreign Address State PID

TCP hddlntd100000:1090 test.test.cim:1026 ESTABLISHED 2248 [OUTLOOK.EXE]

  1. Now check for the port which is shown as already in use. Like if the message resulted by BindException is “Port already in use: 1098”, then 1098 is in use by other application.
  2. Identify the application running on the given port. Like Outlook is acquiring port 1090.
  3. Either close the application which is acquiring the port directly by exiting the application like in case of Outlook or go to task manager and do end task for the given application/service. If application/service closes successfully you are done, now retry whatever had caused BindException earlier.

Forcing www in url using Apache

To enforce www to every url, we can use mod_rewrite module in apache.
The idea is to make only one entry point to your site e.g.
1. www.techpitcher.com
2. http://techpitcher.com
3. http://techpitcher.com/index.html
4. www.techpitcher.com/index.html
As listed above there are at least 4 ways to access the home page of the site. To make one access url like http://www.techpitcher.com, we need to configure apache’s configuration file.
To use this method, you must have write access to your apache’s configuration file.

1. Open httpd.conf file. In case of Apache2, this can be a blank file.
2. Verify that mod_rewrite.so moule is loaded, Then load mod_rewrite.so module.
LoadModule rewrite_module /mod_rewrite.so
3. Below is piece of code which will force www in every url

<VirtualHost www.techpitcher.com:80>
	DocumentRoot /home/techpitcher/public_html
	ServerName www.techpitcher.com
	ServerAlias techpitcher.com
	RewriteEngine On
	RewriteCond %{HTTP_HOST} ^www\.techpitcher\.com
	RewriteRule ^/index\.html$ http://www.techpitcher.com/ [R=301,L]
	RewriteCond %{HTTP_HOST} ^techpitcher\.com
	RewriteRule ^/(.*) http://www.techpitcher.com/$1 [R=301,L]
</VirtualHost>

R[=code] Redirect to new URL, with optional code. Usually you also want to stop and do the redirection immediately. To stop the rewriting you also have to provide the ‘L’ flag.

ifconfig command : Manage network configuration in linux

The most frequent use of ifconfig command is setting an interface’s IP address and netmask, and disabling or enabling a interface.
To see IP address of the machine, open terminal and type ifconfig
It’ll list all the interfaces connected to the device e.g.

root@ubuntu:~$ ifconfig
eth0    Link encap:Ethernet  HWaddr 00:1c:23:a4:ed:b0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:160524 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:40668433 (40.6 MB)  TX bytes:14468340 (14.4 MB)
          Interrupt:17 

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:21240 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3990382 (3.9 MB)  TX bytes:3990382 (3.9 MB)

To view a particular interface, provide interface name after ifconfig command.

root@ubuntu:~$ ifconfig eth0
eth0    Link encap:Ethernet  HWaddr 00:1c:23:a4:ed:b0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:160524 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:40668433 (40.6 MB)  TX bytes:14468340 (14.4 MB)
          Interrupt:17

here are few more frequent usages of ifconfig
ifconfig eth0 down
This flag causes eth0 interface to be shut down.
ifconfig eth0 up
If interface eth0 is in the down state then by setting this flag will make eth0 interface active.

ifconfig eth0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.20
Assign eth0 with the above values for IP, netmask and broadcast address.

What is a Test Plan?

A Test Plan document describes the scope, approach, resources and schedule testing activity.

How to know which java version is installed in linux?

Go to shell and type java -version. It will show the installed version information of java

root@ubuntu:/# java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)

.

java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException

I am getting following exception while using httpclient.

</p>
<p>java.lang.NoClassDefFoundError:org/apache/commons/codec/DecoderException<br>
at org.apache.commons.httpclient.HttpMethodBase.&amp;lt;init(HttpMethodBase.java:216)<br>
at org.apache.commons.httpclient.methods.GetMethod.&amp;lt;init(GetMethod.java:88)</p>
<p>

Please tell me why am I getting this exception?

Technology