Recherche dans le site/ Search this Blog:

Login



Problem updating to MyEclipse 7.5 on Slackware Linux - Look at ulimit -n - Too many open files - struts-config.xml changes to run under java 6 Imprimer

 

 

We have updated from MyEclipse 5.1 to 7.5. Here a list of the problems we encountered. Click below to read more...

 

 

The first problem we have encountered is that nothing seemed to work properly ;-))

We found out that the main cause of our problems was related to the tremendous amount of files MyEclipse 7.5 opens compared to 5.1.

You can obtain a ball park figure by typing the following command, say your user name is "developer":

With MyEclipse 7.5 running:

developer@host:~$ lsof -u developer | grep -c ""
3849
developer@host:~$ lsof | grep -c ""
4169

With MyEclipse 7.5  NOT running:

developer@host:~$ lsof -u developer | grep -c ""
1680
developer@host:~$ lsof | grep -c ""
2000

On most Linux distributions, the default number of files a user can open within its shell is usually limited to 1024 while MyEclipse 7.1 opens a larger number of files than 1024 so MyEclipse 7.5 cannot access all the files it needs and this causes all sort of hard to pinpoint problems.

e.g.:

developer@host:~$ ulimit -n
1024

Here is MyEclipse recommendation to fix this issue on most distributions:

http://www.myeclipseide.com/PNphpBB2-viewtopic-t-23179.html

And here is the way to fix this under the Slackware distribution:

cd /sbin

cp -p  initscript.sample initscript

edit initscript so it contains the following, we have chosen to raise the number of files from 1024 to16184, adjust the number at your convenience:

  PATH=/bin:/sbin:/usr/bin:/usr/sbin
  export PATH

  ulimit -Hn 16184
  ulimit -Sn 16184

  # Execute the program.
  eval exec "$4"

Now ulimit -n retruns 16184 and everything works fine:

developer@host:~$ ulimit -n
16184

NOTE: As far as we know, You need to reboot the machine for the ulimit change to take effect.

 

We then experienced a problem with Struts DynaActionForm deploying to servers running java 6. Everything worked fine with servers running on java 5 or lower.

We found out that the problem was in  struts-config.xml, we had form properties declared as:

<form-bean name="rechercheForm"
            type="org.apache.struts.validator.DynaValidatorActionForm">
            <form-property name="searchTypes" type="[Ljava.lang.String;" />

</form-bean>

 We had to replace those declarations with the following in order to run on all servers, including the ones using java 6:

<form-bean name="rechercheForm"
            type="org.apache.struts.validator.DynaValidatorActionForm">
            <form-property name="searchTypes" type="java.lang.String[]" />

</form-bean>

Everything runs fine now, we can deploy to servers running java 1.4, java 5 and java 6 by setting the appropriate compiler compatibility level by right clicking on the project->Properties->Java Compiler ! ;-))

 

Ajouter votre commentaire / Add your comment

Votre nom / Your name:
Sujet / Subject:
Commentaire:
SPAM: Ne pas inclure de lien ou utiliser le stratagème suivant: "yahoo.com slash mapage.html"     Nous utilisons un filtre qui bloque les commentaires suspects avec une erreur 403. De même, du code de programmation ou sql peut provoquer des erreurs 403. Veuillez utiliser un lien vers votre code tel que: "pastebin.com slash jVNqLieD"    Merci!
Comment:
SPAM: Do not include any links in your post or use the following construct: "yahoo.com slash mypage.html"    We are using a filter that denies suspicious posts with a 403 error. Programming language or SQL code may also cause a 403 error. Please provide a link to your code instead like: "pastebin.com slash jVNqLieD"    Thank you! :
  Lettres de vérification; lettres minuscules seulement, pas d
Retaper les lettres affichées / Word verification:
Mis à jour / Last updated ( lundi, 30 novembre 2009 06:58 )
 



Consultez TOUS nos fils d'actualité ici. / View ALL our newsfeed here.