Eclipse tutorial


JSP and servlet


  • direct output to axis service:

  • using wtp

  • integration WTP with maven in eclipse

  • maven

issues and solutions

local Tomcat server in eclipse

issue: Tomcat can be added as a local server in Eclipse , Eclipse's console says that everything has started all right and the server is started, but the server can't be opened from http://localhost:8080/

solution: because the eclipse by default use "workspace metadata" path as the server location , you can switch it to "Tomcat Installation" as illustrated in the following chart by Double clicking the Tomcat server entry in the Servers view :


more issue: cannot enable the option "Use Tomcat installation" cause it is grayed out
you need to remove all applications that are published to the current server as it is mentioned in the panel:"To change the option, the server should have no modules deployed and it should be published".

Pretty clear enough. Stop the server, remove all deployed projects and republish the server.

java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet

the above exception is thrown when Axis2 was run as webapp within Tomcat and started as local server.
the root cause is people are using axis2 1.5 . Axis2 1.5 doesn't work, you need to use and config axis2 1.4.1

you can check C:\tomcat\wtpwebapps\HelloWorldPrj\WEB-INF\lib, if it is axis2-kernel-1.5.jar, not right. it should be axis2-kernel-1.4.1.jar

  1. download axis 2 1.4.1 binary and extract to C:\axis2-1.4.1
  2. config windows->preferences -> Web services-> Axis2 Preferences. point to C:\axis2-1.4.1

Axis2_Codegen_Wizard_1.3.0 exception.

1) Shutdown eclipse

2) Copying the "backport-util-concurrent-3.1.jar" and ""geronimo-stax-api_1.0_spec-1.0.1.jar" from "$AXIS2_HOME/lib/" to "$ECLIPSE_HOME/plugins/Axis2_Codegen_Wizard_1.3.0/lib/"

3) Adding the following into the "runtime" element "$ECLIPSE_HOME/plugins/Axis2_Codegen_Wizard_1.3.0/plugin.xml" :

      <library name="lib/geronimo-stax-api_1.0_spec-1.0.1.jar">
         <export name="*"/>
      <library name="lib/backport-util-concurrent-3.1.jar">
         <export name="*"/>

4) In "$ECLIPSE_HOME/plugins/Axis2_Codegen_Wizard_1.3.0/plugin.xml" changing the version attribute of the "plugin" element from "1.3.0" to "1.4.0". This results still in the same exception. But leave it.

5) Now changing the version also in the plugin's folder name from "Axis2_Codegen_Wizard_1.3.0" to "Axis2_Codegen_Wizard_1.4.0".

6) Start eclipse and try the plugin

working for eclipse gilleo/europe, axis2 1.5

Unable to engage module : addressing

ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:\\tools\\repository", null);

ManualServiceStub stub = new ManualServiceStub(ctx,"http://localhost:1234/axis2/services/ManualService");

I have the following hierarchy of c:\tools\repository that contains mar for client usage. mars are copied from C:\axis2-1.4.1\repository\modules

repository --
               |-- modules ---
                                  | ---- addressing-1.41.mar
                                  | ---- modules.list

you can manually edit modules.list.

more information about repository:

The endpoint reference (EPR) for the Operation not found


where is the WTP deployment int location server?

for eclipse 3.5 and beyond: C:\tomcat\wtpwebapps
it is because the definition C:\Workspaces\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\publish.txt

#Tomcat publish data
#Tue Aug 11 16:00:11 PDT 2009

If you ever woundered there Eclipse WTP does deployment your web application during development (if you use the local server option in Eclipse) you find the result of your deployment under:Workspace-> .metadata -> .plugins\org.eclipse.wst.server.core\ and then tmp[number]\wtpwebapps\project name

default username and password

axis2: admin/axis2

tomcat manager

edit conf\tomcat-users.xml file as

  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user password="tomcat" roles="tomcat" username="tomcat"/>
  <user password="tomcat" roles="tomcat,role1" username="both"/>
  <user password="tomcat" roles="role1" username="role1"/>
  <user password="password" roles="standard,manager,admin" username="admin"/>

maven and WTP conversion

First of all you need to make sure that you have the WTP integration feature installed.
Please check the WTP howto at

maven project -> wtp web project : works fine

If you start from the proper Maven war project (i.e. it can be build with "mvn package" command), then should work out of the box (i.e. either 1) create war project from Maven archetype as described in WTP howto above, or 2) when importing war project from local disk or version control).

wtp web project -> maven web project: manual edit

However if you start from the project created using WTP wizards (e.g. "New dynamic web project"), then you'll need to manually create a pom.xml and make sure that Maven build would produce a correct war for your project. Usually it will require to set the packaging to "war" and the maven-war-plugin with an appropriate configuration to the project's pom.xml. Once that is done, you can use Maven / Enable Dependency management and Maven / Update Project configuration to enable Maven support on that project.

a good example:

note: Maven launch configuration had been moved to main menu ->Run -> Run Configurations..

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License