Eclipse

Eclipse tutorial

general

http://www.vogella.de/eclipse.html

JSP and servlet

http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/

webservice

  • direct output to axis service:

http://wso2.org/library/1719

  • using wtp

http://www.vogella.de/articles/Webservice/article.html

  • integration WTP with maven in eclipse

http://docs.codehaus.org/display/M2ECLIPSE/Integration+with+WTP
http://www.devx.com/Java/Article/36785/0/page/1

  • maven

http://www.theserverside.com/tt/articles/article.tss?track=NL-461&ad=647742HOUSE&l=Introductiontom2eclipse&asrc=EM_NLN_4036411&uid=5812009

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 :

eclipse.jpg

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.

http://www.coderanch.com/t/106807/IDEs-Version-Control-other-tools/Eclipse-Tomcat-startup
http://www.coderanch.com/t/419431/IDEs-Version-Control-other-tools/Tomcat-server-not-starting-eclipse

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" :

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

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
https://issues.apache.org/jira/browse/AXIS2-3792

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

http://www.keith-chapman.org/2009/02/axis2-endpoint-reference-epr-for.html

FAQ

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
contains:

#Tomcat publish data
#Tue Aug 11 16:00:11 PDT 2009
org.eclipse.jst.j2ee.server\:webapp=C\:\\tomcat\\wtpwebapps\\webapp

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

<tomcat-users>
 
  <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"/>
 
</tomcat-users>

maven and WTP conversion

http://www.nabble.com/How-to-convert-or-use-a-Maven-project-as-a-dynamic-web-project--td23430177.html

First of all you need to make sure that you have the WTP integration feature installed.
Please check the WTP howto at http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto

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: http://www.devx.com/Java/Article/36785/0/page/2

note: Maven launch configuration had been moved to main menu ->Run -> Run Configurations..
https://issues.sonatype.org/browse/MNGECLIPSE-678%3Bjsessionid=hreyg5fpjq49?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

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