Wednesday, September 28, 2011

ජීවිතයට පුංචි දෙයක්....










Tuesday, September 27, 2011

How to wrap the maven script with ant ?

Most of the time people need to do the other way around.
That mean to wrap ant scripts with maven scripts. But ,
in some rare situations there are people who want to wrap
maven scripts with ant scripts.

It is very easy to do this. You need to have maven
installed and set the MVN_HOME for this.


<project default="buildProject">
  <property name="source.dir" value="."/>
<target name="buildProject" description="Wrapper for the maven script">
<exec dir="${source.dir}" executable="mvn">
<arg line="clean install" />
</exec>
</target>
</project>


place this code segment in your build.xml file. Place
that build.xml file in the folder which you have the
maven script (pom.xml). Go to the folder with command
prompt. Execute "ant" command. Thats all...!

Thursday, September 22, 2011

error=24, Too many open files

Many users have experience in getting this error when building with maven.

The way to over come this problem is to increase the file limit of the OS.

First, in order to set this options automatically you have to edit the etc/security/limits.conf file.

$sudo gedit /etc/security/limits.conf

with the above command you can open the "limits.conf" file with gedit.
We need to set the nofile option meaning maximum number of open files.If you want to change the number of files of user, you should add this line in the limits.conf file.

Lets say our user name is "foo"

Then the entry should be

foo soft nofile 9000

foo hard nofile 65000




If you want to set the nofile only for superuser you just write root instead of user.


root soft nofile 9000

root hard nofile 65000



Now after rebooting you can see in the terminal with ulimit -a the change.

Wednesday, September 21, 2011

How to disable the web administration console? http://localhost:8080/axis2/axis2-admin/

How to disable the web administration console? http://localhost:8080/axis2/axis2-admin/

Environment:
Axis2-1.6.0

This is a common problem that many users asks and most of them thinks
that this can be done by changing a property in axis2.xml file.

There are more than one way to carry out this task. First we need to
say that axis2.xml has no control on disabling this admin console.
Because of that, changing the properties of axis2.xml file will not
effect on this requirement.

Here i ll specify two different ways to fulfill your requirement.
Both of them will prevent accessing the JSP file which is required to
load the Web Admin Console.

01: Changing the web.xml file

You can find this file at : webapps/axis2/WEB-INF folder.
In this file , you will find the following entry

<servlet-mapping>
<servlet-name>AxisAdminServlet</servlet-name>
<url-pattern>/axis2-admin/*</url-pattern>
</servlet-mapping>

You can comment this entry like

<!--servlet-mapping>
<servlet-name>AxisAdminServlet</servlet-name>
<url-pattern>/axis2-admin/*</url-pattern>
</servlet-mapping-->


This will prevent the page redirection and it will solve your problem.

02: Renaming or Deleting the Login.jsp file

You can find this file at : webapps/axis2/axis2-web folder.
you can delete or rename this file to any other name.
This will prevent access to Login page and it will solve your problem.