Showing posts from October, 2010

Run two/more Apache tomcat servers in your machine at the same time

If you have currently configured a single tomcat server and you need to add more tomcat servers, first remove the CATALINA_HOST environmental variable.
The configure more tomcat servers in new ports. (How to change the Tomcat running port)
Now go to Command Line.
Go to the first tomcat server directory through command line and go to bin directory.
Type "startup" and execute Tomcat.
Then your tomcat server will start.
Now go to the next Tomcat server dirctory through cmd and as same as the first one execute it through command line.

Here as we haven't created CATALINA_HOME variable , we can not execute Tomcat straghtly double clicking startup.bat file. So when we execute Tomcat from cmd, it creates required environmental variables at that time and starts tomcat.

How to change Apache Tomcat running port

Go to conf folder of your apache tomcat installation.
Open server.xml file.

Method 1
Search for (Ctl+F) "Connector port" key word there. In the first matching occurence change the port value to the value which you wish.
For better accuracy make sure the current port value in the first matching occurence is equal to the port which the tomcat currently running.
restart tomcat.

Method 2
Find the port which tomcat currently running.
Search for (Ctl+F) the current port in server.xml file and change it to the value you want.
restart tomcat.

AXIS2 Web Service in eclipse through Top Down Approach-java.lang.RuntimeException: Element QName is null

Based on this tutorial, But used my own WSDL file.
I used Top Down approach where to create java codes from the WSDL file. But at “Axis 2 Web Service Skeleton Java Bean Configuration” wizard window I clicked next and there occurred an exception as follows saying Element QName is null.


Add the following XML element within
tags and inside
tag which has a wsdl:fault (Particular operation should throw an exception). So I had to add,
It appears as follows,

Here the getBalance operation throws an exception, so for the wsdl:binding description the given element need to be added. Otherwise it gives an exception at Top Down Approach with eclipse.

Axis 2 web services in eclipse: Exception java.lang.NoClassDefFoundError: org/apache/http/HttpResponseFactory thrown when Services link clicked

I created the web service using axis2 and deploy through tomcat in eclipse following a Tutorial. Then axis2 homepage get displayed OK. But when the Services link clicked an exception page will get displayed as follows.

type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.
javax.servlet.ServletException: Servlet.init() for servlet AxisServlet threw exception
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process($ Source)
root cause
java.lang.NoClassDefFoundError: org/apache/http/HttpResponseFactory

AXIS2 web service in eclipse: Web Service created, but when executed HTTP Status 404 page get displayed

Web Service project name= SimpleATMService

http://localhost:8080/ATMService/ : HTTP Status 404 page

Try This URL: http://localhost:8080/ATMService/axis2-web/