Translate

domingo, 9 de noviembre de 2014

Webservice Example with axis2 part1: Setting environtment

This is the first post to show how to create a web service with a simple operation and a complex operation based on Axis2.

In this series of posts we are going to show this points:

The first thing to do is set up the necesary environtment to create the web service. Download the next sofware and configure the environment variables:

•    Java SDK version 1.6.0_45 or later.
•    Windows environment variable JAVA_HOME pointing to Java location (C:\Program Files\Java\jdk1.6.0_45)
•    Eclipse IDE version 4.3 Kepler or later.
•    Apache Maven version 3.1.1 (Embedded in IDE or installed in local machine to use it in command line console).
•    Add the apache Maven bin directory path to the Windows environment variable Path
•    Apache Ant version 1.9.4, installed in your local machine.
•    Add the apache Ant bin directory path to the Windows environment variable Path
•    Apache axis2 version 1.6.0  (binary distribution). Libraries XMLBeans version 2.3.0 and axiom version 1.2.11 are included in axis2.
•    Windows environment variable AXIS2_HOME pointing to Axis2 location (C:\axis2-1.6.0)
•    WSO2 application server version 4.0.1 to deploy Web services.  (you have to download the version 5.0.0 in the download page)

The next step is check if all the elements are properly installed.

JAVA
Open a dos command window and execute java -version





ECLIPSE
Execute the eclipse.exe in your eclipse installation



APACHE MAVEN

Open a dos command window and execute mvn -version





ANT
Open a dos command window and execute ant -version



AXIS2
Open a dos command and execute echo %AXIS2_HOME% and check that path y correct.



WSO2 - Application Server
Open a dos windows and run the server using this command.
[WSO2-Installation-folder]/bin/wso2server.bat



Open browser and copy the url that appears in the last line of the output

Enter user admin and password admin





If you are here everything has going ok.



    lunes, 20 de octubre de 2014

    Jenkins: Pool SCM always detect changes

    Jenkins: Consultar repositorio (SCM) siempre detecta cambios.

    Today a quick issue that has happened to me, i was configuring a new Jenkins project as always but the Pool SMC to SVN repository was always detecting changes and triggering a new build.

    This was my normal Jenkins configuration:

    1 - SVN repository URL to my company interal SVN
    2 - Always Check a fresh copy
    3 - Pool SCM each 5 minutes.



    The configuration was ok, but Jenkins was triggering a build each 5 minutes because it was always deteting changes in the SVN repository.

    After "googleling" a while, made some test, and copy the SVN repository URL in a browser i realised that my SVN URL was not the original one. The server was redirecting to another URL i dont know why, maybe due to the https connection.

    The original URL was:

    https://xxxx.yyy.es:443/svn/myproject/trunk

    and the server redirected to

    http://xxxx.yyy.es:8008/svn/myproject/trunk 

    After changing the SVN URL to the final redirect it started to work properly again and it only triggers a build after changes has been uploaded to the reposository.




    Be careful with servers redirects


    references:

    jenkins-scm-triggering-constant-builds-despite-no-change




    martes, 1 de julio de 2014

    Remote Debug in tomcat 6 and 7

    Título: Debug remoto sobre servidor de aplicaciones Tomcat 6 y 7.

    What happends when we can´t install and application in a local tomcat in order to debug some issue o bug?

    The answer is easy, remote debug y the key. It allows you to debug the code in the same way like if your web application was installed in your machine.

    Note: You have to have installed in your local machine the same code that is in the remote machine to do properly remote debug.

    Configuration:

    1 - Remote server´s configuration: The remote server have to be setted with params to determine a port (8000 for example) where the server will listen to a remote debug connection.

    When you run tomcat you have to pass to virtual machine this params:

    -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

    The easy way to do it is to edit the file [tomcat_installation]\bin\setenv.bat and add this lines

    set DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
    set JAVA_OPTS=%JAVA_OPTS% %DEBUG%              

    2 - Local configuration (eclipse):

    You have to create a Remote Java Application in Debug Configurations:



    With the next options, setting a socket with the remote server host and port 8000 .



    don´t forget to select the Project where the source code is located.

    Happy Debug!!!