eclipse: cannot open git-upload-pack

 eclipse, Sin categoría  Comments Off on eclipse: cannot open git-upload-pack
Jun 112015
 

Suddenly, pulling a git project in eclipse from bitbucket I got the error:

cannot open git-upload-pack

I do not understand why this error occurs, but the solution is to configure the following parameter:

http.sslVerify false

In Eclipse we have to configure this parameter via Preferences > Team > Git > Configuration and clicking Add Entry…

Timer versus ScheduledThreadExecutor

 Sin categoría  Comments Off on Timer versus ScheduledThreadExecutor
May 132015
 

According to Java Concurrency in Practice and other sources of information main differences between Timer and ScheduledThreadExecutor are:

  • Timer can be sensitive to changes in the system clock, ScheduledThreadPoolExecutor isn’t
  • Timer has only one execution thread, so long-running task can delay other tasks. ScheduledThreadPoolExecutor can be configured with any number of threads. Furthermore, you have full control over created threads, if you want (by providing ThreadFactory)
  • Runtime exceptions thrown in TimerTask kill that one thread, thus making Timer dead 🙁 … i.e. scheduled tasks will not run anymore. ScheduledThreadExecutor not only catches runtime exceptions, but it lets you handle them if you want (by overriding afterExecute method from ThreadPoolExecutor). Task which threw exception will be canceled, but other tasks will continue to run.

Calling

ScheduledExecutorService ex= Executors.newSingleThreadScheduledExecutor();

will give you a ScheduledExecutorService with similar functionality to Timer (i.e. it will be single-threaded) but whose access may be slightly more scalable (under the hood, it uses concurrent structures rather than complete synchronization as with the Timer class). Using a ScheduledExecutorService also gives you advantages such as:

  • You can customize it if need be (see the newScheduledThreadPoolExecutor() or the ScheduledThreadPoolExecutor class)
  • The ‘one off’ executions can return results
  • You can reschedule the same task inside run method using a ScheduledExecutorService, but not using  a Timer. With Timer you get java.lang.IllegalStateException: Task already scheduled or cancelled

Sending emails from 1and1 with PHPMailer

 PHP, Sin categoría  Comments Off on Sending emails from 1and1 with PHPMailer
Mar 152015
 

In this post we are going to explain how to send emails using PHPMailer from a 1and1 server.

On the one hand, we have a config.php file where we configure the main parameters.

On the other hand, here you have a sample of a php class using PHPMailer for sending emails.

PHP internationalization with gettext

 PHP, Sin categoría  Comments Off on PHP internationalization with gettext
Feb 162015
 

When you are developing a PHP Web Application, many times you need it to be dynamically available in several languages. One solution for this is to enable the Gettext PHP extension into PHP itself. If you are using a WAMP, XAMP or MAMP distribution the only thing you have to do is removing the semicolon of the gettext.so or gettext.dll extension that you can find in php.ini.
Continue reading »

Arranque rápido de Liferay 6.2 en JBoss AS 7

 Sin categoría  Comments Off on Arranque rápido de Liferay 6.2 en JBoss AS 7
Nov 152013
 

Para realizar una instalación y arranque rápidos de Liferay en JBoss AS 7 basta con descargarnos el bundle que encontraremos en la página

http://www.liferay.com/es/downloads/liferay-portal/available-releases

y seguir las instrucciones que se indican en la siguiente url, que aunque sean de la versión 6.1, valen igualmente para la 6.2:

http://www.liferay.com/es/documentation/liferay-portal/6.1/user-guide/-/ai/lp-6-1-ugen11-installing-liferay-on-jboss-7-0
Continue reading »

IWAB0503E Unable to update Java build path. Please check your system environment

 Sin categoría  Comments Off on IWAB0503E Unable to update Java build path. Please check your system environment
Oct 142013
 

Al intentar añadir un nuevo Web Service Client utilizando Eclipse, o más concretamente STS, Spring Tool Suite, versión 3.4.0 o anteriores, con la opción de menú

File > New > Other > Web Services > Web Service Client

se puede producir el error

Este error se debe a que en la instalación por defecto del STS hay dos plugins, de distintas versiones, de javax.xml.soap. Podemos comprobarlo en el directorio .plugins de nuestro Eclipse o STS. Para solucionar el problema debe borrarse el plugin correspondiente a la versión 1.3, esto es, la más nueva, en nuestro caso javax.xml.soap_1.3.0.v201105210645.

Clientes SVN en Mac

 Sin categoría  Comments Off on Clientes SVN en Mac
Jun 262011
 

Hay unos cuantos clientes en Mac para SVN, aunque todos, o la mayoría son de pago, como por ejemplo, versions, zennware, etc. La verdad que se echa de menos un cliente TortoiseSVN, como existe en Windows.

Existe un cliente gratuito para Mac, que todavía está en versión 0.x, pero que funciona de forma aceptable: scplugin.

Lo podemos bajar de

http://scplugin.tigris.org/servlets/ProjectDocumentList

Tras bajar el dmg, al pulsar sobre él se abrirá una ventana con los archivos que contiene. Para proceder a la instalación debemos ejecutar el archivo SCPlugin.0.x.x-SVN.x.x.x.mpkg y seguir las instrucciones de la ventana que aparece.

Al final, entre otros archivos instalados, tendremos en nuestra carpeta Aplicaciones el archivo SCToolbarButtom.app, que lo deberemos arrastrar a la barra de iconos del Finder. De esta forma, de manera cómoda podremos realizar los comandos clientes svn sobre la carpeta en la que estemos.

Se debe tener en cuenta que cuando entremos por primera en un servidor SVN que esté bajo una dirección https, es muy probable que se nos presente un error del estilo

Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted

Para resolver este problema, debemos abrir una consola terminal y ejecutar cualquier comando svn sobre el servidor svn que nos da problemas. Un ejemplo, sería

svn ls https://server/repository/application

Al ejecutar este comando, nos aparecerá un mensaje en el que nos solicita si queremos guardar el certificado de forma temporal, permanente o si lo queremos rechazar. La respuesta correcta, en principio, sería p, permanente. De esta forma, cuando volvamos a ejecutar las operaciones svn clientes desde el botón que acabamos de instalar en nuestro Finder, funcionarán correctamente.

Una explicación más detallada a este problema lo podemos encontrar en

http://scplugin.tigris.org/ds/viewMessage.do?dsForumId=1525&dsMessageId=2405274