Ruben Laguna’s blog

Compiling and Building JMeter With Eclipse 3.2.x

The developer notes on how to compile and debug Jmeter with Eclipse 1 and 2 are very difficult to follow and outdated. If you are interested in modifying Jmeter using Eclipse 3.2 Callisto you can follow the following procedure:

  1. Install Subclipse Callisto release (update site: http://subclipse.tigris.org/update_1.2.x)
  2. Download optional libraries. Although they’re optional is better if you download them.
    1. mail.jar
    2. activation.jar
    3. beanshell
    4. bsf
    5. jexl
  3. Use SVN Repository Exploring and add the following repository http://svn.apache.org/repos/asf/jakarta/jmeter
    SVN Repository Exploring
  4. Navigate to tags/v2_2. Right-click on it and select Checkout. Use then New Project Wizard.
  5. Rename the the eclipse.classpath to .classpath. Delete the eclipse generated .classpath first.
  6. Change the Build Classpath. Select the project in the Package Explorer. Right-click it and select Properties→Java Build Path → Source. Then uncheck Allow output folders for source folders and set the Default output folder to the <Project name>/lib/ext.
  7. Remove the exclusion patterns for images/*, etc. in the Build Path→Source
  8. Look with the Navigator (not the Package Explorer) in the lib/ext folder and see if eclipse is compiling ok. If not check the Problems view to see if the project was not built since its build path is incomplete. Probably your are missing some library. Commons-logging has to be change from commons-logging-1.1 to commons-logging. If it complains about javax.mail.MessagingException then you have to add mail.jar to the build path

At startup JMeter search for classes deriving from JMeterGUIComponent or TestBean. Now the context menus are populated with items.

Re: using PreparedStatement in JDBC tests?

New Views Don’t Show Up When Using Eclipse RCP setSaveAndRestore

If you add a new view to an Eclipse RCP and when launch it the new view is not there you probably hit the problem described in this CT Arrington’s Weblog post.

The IWorkbenchConfigurer.setSaveAndRestore(true) called from your WorkbenchAdvisor can be the source of the problem. The Eclipse RCP platform is trying to restore the perspective from the serialized version stored on disk so it fails to load you new changes. You have several solutions [from the CT Arrington’s Weblog post].

  1. Delete the target platform workspace data. tipically in ...runtime-EclipseApplication\.metadata\.plugins\org.eclipse.ui.workbench\workbench.xml
  2. Set the Clear workspace data before launching in the run configuration. Run → Run… → Eclipse Application → Main → Workspace Data → Clear workspace data before launching

Scrolling Fast With the Mousewheel Triggers History Back and Forth

Get Firefox

I’m observing an strange firefox behavior when I scroll the page using the mouse wheel. It goes back and forth through search history. So I googled a little bit and found that the KVM switch that I’m using it’s producing bogus key press event that firefox misinterprets. If you are running Linux the solution is simple as you can modify the X server configuration to ignore those events. But I cannot find a suitable solution for Windows.

Disabling history scroll in firefox (Usually triggered with Shift-) in about:config seems to have no effect in stopping this weird mouse wheel behavior.

Theorically changing the value of all mousewheel.horizscroll.with*.action and mousewheel.with*.action entries to 0 disables moving back/forward in history using the mouse wheel. Check this to know more about the meaning and purpose of mousewheel.* entries. But as I said It seems that doesn’t make any difference.

If you know the solution for this problem post it in the bug report.

Firefox and File:// Windows UNC Paths

The correct way to write a link to a Windows UNC path in HTML is to use this syntax: file://///servername/share/file.txt. But if you try this using Firefox you will quickly find that this type of link only works when using a local html file. If you put the html file in a web server an click on the link there, firefox will silently refuse to load the link. If you open the JavaScript Console (Tools→Error Console) you will find an entry like Security Error: Content at http://... may not load or link to file://...

errorconsole.png

As stated here and here, firefox will silently refuse to load file:// links from html pages (loaded via http://) as it is considered a security flaw to do so. Currently, firefox users must right-click the link and select Copy Link Location and then paste it to the Location Bar.

(Tomcat 5.5.x) java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionListener

Or java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener for that matter. NoClassDefFoundError on HttpSessionListener , ServletListener , ServletContextListener, etc. can be caused by a custom classloader like Sysdeo DevLoader (I use it with Eclipse) in you Context definition in the Tomcat’s server.xml file.

<Loader classname="org.apache.catalina.loader.DevLoader"
        reloadable="true" debug="1" />

the solution: add

useSystemClassLoaderAsParent=“false”

to the Loader

<Loader classname="org.apache.catalina.loader.DevLoader" 
        reloadable="true"
        debug="1" useSystemClassLoaderAsParent="false"/>

This should do the trick. More information here and here

Cvs [Xxxxx]: Received Broken Pipe Signal

Today I received this error message when issuing a cvs import to the cvs repository

cvs [import failed]: received broken pipe signal

after googling a little bit I found this mail thread that led me to the following entry in the cvs manual about loginfo:

Note that the filter program must read all of the log information or CVS may fail with a broken pipe signal.

so I took a look to the CVSROOT/loginfo and the line there was

ALL /usr/local/viewvc-1.0.0/bin/loginfo-handler %{sVv}

so I figured out that loginfo-handler from viewvc must be causing the problem. I went to the viewvc repository and find out the following comment on Revision 1518 of loginfo-handler:

* bin/loginfo-handler
Add some more debugging, and consume stdin so CVS’s pipe doesn’t
back up (which causes an abort()).

I downloaded the latest version of loginfo-handler and tried to use it instead of the old one but I doesn’t work. You must upgrade to latest version of viewvc. So I tried another solution I modified a little bit the 1.0.0 loginfo-handler

1
2
3
4
5
6
7
8
9
10
11
12
13

1
2
3
4
5
6
7
8
9
10
11
12
13
<span class='line'>*** loginfo-handler     2007-03-29 18:26:18.000000000 +0200
</span><span class='line'>--- loginfo-handler-patched     2007-03-29 18:25:49.000000000 +0200
</span><span class='line'>***************
</span><span class='line'>*** 266,271 ****
</span><span class='line'>--- 266,274 ----
</span><span class='line'>      if len(sys.argv) > 3:
</span><span class='line'>          error('Bad arguments')
</span><span class='line'>
</span><span class='line'>+     debug('Discarded from stdin:')
</span><span class='line'>+     debug(map(lambda x: '   ' + x, sys.stdin.readlines())) # consume stdin
</span><span class='line'>+
</span><span class='line'>      repository = cvsdb.CleanRepository(repository)
</span><span class='line'>      directory, files = fun(arg, repository)</span>

and now it seems to work.

UPDATE:: There is another way (easier) to solve this problem without editing loginfo-handler just change the line

ALL /usr/local/viewvc-1.0.0/bin/loginfo-handler %{sVv}

in your /CVSROOT/loginfo file with

ALL (/usr/local/viewvc-1.0.0/bin/loginfo-handler %{sVv};cat) >/dev/null

this also consumes all stdin data upon completion avoiding the received broken pipe signal.

Useful WordPress Plugin - Redirector

Very useful WordPress plugin to redirect with a “301 moved permanently” from one of your post to any url. I created a Wordpress page out of a post and I wanted to redirect everybody from the post to the the page. My first solution was to include a link to the page in the post but doing an automatic redirect is better as it allows to move the google pagerank from the post’s URL to the page URL

Netbeans 6.0 Ruby Output Not Working Properly ($stdout Is Not Flushed on Program Termination)

After struggling with Netbeans 6.0 Ruby a little bit I finally found why my puts statement are not working properly. It’s due to the following reported bug.(Vote for this bug!!) Also noted in the RubyTodo page from Netbeans wiki.

This problem appears when using native ruby with netbeans instead of jruby.

My workaround is using log4r instead for print statements.

UPDATE: It has been fixed in the latest version of the ruby module. I had to download the prebuilt ruby cluster from http://deadlock.nbextras.org/hudson/job/ruby/ and install it using the following instructions because the ruby module version found in the update center was not fresh enough but today I checked again and version 0.39 is available from the Update Center as well.

Copyright © 2015 - Ruben Laguna - Powered by Octopress