quote

mercoledì, dicembre 07, 2011

svn ignore list commands


  • % set SVN_EDITOR=notepad
  • % svn propedit svn:ignore .
  • % svn propget svn:ignore .

Decrease the double click speed for Java Applications on Ubuntu Linux

I couldn't properly use double click on idea so I found a great solution in this post.
To resume:
In your home directory create a file called .Xresources and add the following line

*multiClickTime: 400

Then from the commandline execute

xrdb ~/.Xresources


It's amazing that intellij doesn't take in account this issue.

venerdì, luglio 22, 2011

Serving jboss logs as static content

This configuration has been tested using red hat linux and jboss 5.1.x

  1. Edit the
    <jboss_home>/server/default/deployers/jbossweb.deployer/web.xml
    and change the servlet attribute listings from false to true.
  2. Edit the
    <jboss_home>/server/default/deploy/jbossweb.sar/servlet.xml
    and add the attribute allowLinking="true" to the Context element.
  3. Create a log folder in the path
    <jboss_home>/server/default/deploy/ROOT.war
  4. In the log folder create a symbolic link to the log folder of jboss
    $ ln -s ../../../log listAll
  5. Restart the jboss instance
  6. The logs will be available at this url http://myHost:8080/log/listAll

Links
Enable symlinks
Enable directory browsing

venerdì, maggio 27, 2011

The thin red line - quotes

quotes

We'll meet again some day.
People who have been as close as we've been
always meet again.

sabato, maggio 14, 2011

martedì, febbraio 22, 2011

Jboss - Port already in use: 1098

I got this exception after started jboss 5.1 on windows XP.


ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main)
Error installing to Start: name=jboss:service=Naming
state=Create mode=Manual requiredState=Installed
java.rmi.server.ExportException: Port already in use: 1098;
nested exception is:
java.net.BindException: Address already in use: JVM_Bind


I tried to understand which process was using that port by running this command:

$> netstat -a -o -n

But the result didn't show any port associated to 1098.
Finally I edited the file at <jboss_51_home>\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml
and changed the value of the port 1098 to 10980 and the error has disappeared.
Windows and Jboss ...such a nightmare.
Here the link where I found the solution.

Nice java client to execute remote ssh

http://www.journaldev.com/246/java-program-to-run-shell-commands-on-ssh-enabled-system
Just add this dependency at your pom.xml

<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.42</version>
</dependency>

lunedì, febbraio 21, 2011

Stop jboss in the case it's running

If you need to stop jboss inside a shell script this block of code could be useful.

if ps -ef | grep "<jboss_home>/bin/run.jar" | grep -v grep
then
echo [deploy] Stopping Jboss...
<jboss_home>/bin/shutdown.sh -S --server=localhost:1199
sleep 12s
else
echo [deploy] Jboss was already stopped
sleep 2s
fi

venerdì, febbraio 18, 2011

java.net.MalformedURLException: no protocol: and

I was trying to configure maven cargo plugin when I came across this exception:

Caused by: java.net.MalformedURLException: no protocol: and

I spent several hours trying to find the meaning of this error message when finally I found this link:


http://jackrabbit.510166.n4.nabble.com/jcr-rmi-problems-td534137.html


The author says:

The "and"
comes from the folder where your classes are which is probably something
beneath "C:\Documents and Settings"

So found the root of the problem, the maven local repository in windows is located at the path:
C:\Documents and Settings\<user>\.m2

So I have overridden the local maven repository folder adding this entry in the settings.xml maven configuration file:

<localRepository>c:/mavenrepository</localRepository>


After this change the error has disappeared.

giovedì, febbraio 10, 2011

Accesing to windows file system from cygwin


$ cd /cygdrive/c

That's pretty easy, but I always forget it...

martedì, febbraio 08, 2011

Spring - Referring to a String as a bean


<bean id="myString" class="java.lang.String">
<constructor-arg type="java.lang.String" value="Lucio"/>
</bean>

<bean id="myUser" class="com.benfante.User">
<property name="firstName" ref="myString"/>

</bean>

Thanks to Lucio for the example

lunedì, febbraio 07, 2011

svn client issue

After connecting to svn server using different users I got this message:

svn: Server sent unexpected return value (501 Method Not Implemented) in response to MKCOL request for

I have sorted out it deleting this folder on windows:

C:\Documents and Settings\myUser\Application Data\Subversion\auth

giovedì, gennaio 27, 2011

Enable access to local resources from remote desktop connection

How to enable access to local resources from the remote desktop connection in order to move back and forward files.

  1. Remote Desktop Connection
  2. Options
  3. Local Resources
  4. More
  5. Check Drives
  6. Mark Enrico$ on 'hostX'
  7. OK