Bookmark and Share

Support wikipedia as I did

Wikipedia Affiliate Button

venerdì, gennaio 27, 2012

Remotely debug tomcat on linux

Create this simple shell script: debugtomcat.sh

#leave this command for future reference
#export currentdir=`pwd`
export JAVA_OPTS='-Xmx1024m -XX:MaxPermSize=512m
-Xdebug -Xrunjdwp:transport=dt_socket,
address=8000,server=y,suspend=n'
echo JAVA_OPTS: $JAVA_OPTS
/$HOME/MyPrograms/apache-tomcat-6.0.35/bin/catalina.sh run


resource

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