one more day is over @ ceylan's office

Coding, not a profession but a joy…

Archive for the ‘bugs’ Category

Logging with Log4J When Using maven-tomcat-plugin

with one comment

As you are reading this post, probably

  • You do web application development
  • You use maven as your your build system
  • You like to debug your application right from eclipse (preferably  also using Maven Eclipse Integration )

But,

  • you HATE the standard java logging and anything else – commons-logging, log4j, slf4j – will do it for you.

Here’s what you should do…

<build>
...
<plugins>
...
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.0-beta-1-hc</version>
    <configuration>
      <systemProperties>
        <java.util.logging.manager>org.apache.juli.ClassLoaderLogManager</java.util.logging.manager>
        <log4j.configuration>file://${basedir}/src/main/webapp/WEB-INF/log4j.xml</log4j.configuration>
      </systemProperties>
    </configuration>
    <dependencies>
      <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>juli</artifactId>
        <classifier>log4j</classifier>
        <version>6.0.26</version>
      </dependency>
      <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>juli-adapters</artifactId>
        <version>6.0.26</version>
      </dependency>
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.13</version>
      </dependency>
     </dependencies>
   </plugin>
...
  </plugins>
...
</build>

Now, there needs to be done couple of things

  • juli-6.0.26-log4j is not published by tomcat project. you need to obtain tomcat juli log4j and install / deploy it to your local / company repository.
  • maven-tomcat-plugin has a bug that it sets the systemproperties just too late. you should either build and deploy an interim version of the plugin or check it out from the trunk and stick to the SNAPSHOT version until the plugin releases a new version.

For the second issue I emailed the author of the plugin, Olivier Lamy and asked about a planned release date, as I get an answer, I will publish the date here.

As a separate thing, the plugin has another bug that exposes itself if the application must run as ROOT application in tomcat and either the application or the framework(s) it is based on (struts, urlrewriter, etc) uses server side redirects (internal dispatching). TYhe bug is discussed  here and also the fix for that got main stream.
Enjoy…

Popularity: 84%

Written by Hasan Ceylan

May 3rd, 2010 at 8:47 am

Posted in bugs, eclipse, maven, solved

Tagged with , , , , ,

Bug fix day, ProgressView Bug, SWT Link to blame

without comments

I guess fixing bugs in a project out of reach is one of the most entertaining thing for a husband who doesn’t want to go to bed on Friday night.

So here it goes, I was obsessed with the progress view showing hugely high items. I submitted a bug to Platform/UI team. Then I was deceived with not seeing for a while.

But it turned out to that this is still happening and based on some state – if a job has been started and it never called beginTask. I don’t have so much clue but this boils down to calling computeSize with ‘0′ width hint. Then a bug in the way SWT Link (the sub progress info label of the job info item that displays sub task information and optionally can link to other UI elements ie: console) comes to expose the bug.

SWT Label computes the size with 1px width if the width hint is given as 0. Which wraps all the text in the link down and makes its height huge. But this happens only during the layouting, so the user doesn’t see the word-at-a-line presentation of the link.

In the end, “Changing the 1px hint to Integer.MAX_VALUE fixes the issue” like charm.

“One more bug is fixed” as “one more day is over @ ceylan’s office”

Popularity: 49%

Written by Hasan Ceylan

February 13th, 2010 at 1:27 am

Posted in bugs, eclipse, solved

Tagged with , , ,

Resizing Partitions While Installing Linux

without comments

Hello Everyone,

If you are one of those In-Love-With-Linux like me, and visit your friends with a linux installation CD always on you, I recommend you read this.

I have recently installed Fedora 12 to a colleague’s  laptop. As expected, his drive had one big partition spanned to the whole disk. Fedora, for some time has the resize disk option available in its installers – be it anaconda, or live cd installers. As you can guess we have resized the drive installed Fedora, booted into Fedora everything was fine – up until he tried to boot into the his old crap to check his email.

The NTFS partition was unusable!

The reason for that is, according to GParted Developers, “Something with either kernel, or parted or gparted is broken and not resizing partitions properly and it is beiing investigated.”

So if you do not want to disappoint your potential to-be Linux Lovers, I recommend using the gparted live cd till this problem is solved.

You can find the details and the link to download the gparted live cd here, http://gparted.sourceforge.net/download.php

Happy 2010…

Popularity: 2%

Written by Hasan Ceylan

January 6th, 2010 at 10:17 pm

Fedora Post-Installation

without comments

Here’s an excellent yet so simple post install customization that simply works…

Fedora Post-Installation

Popularity: 1%

Written by Hasan Ceylan

November 30th, 2009 at 2:36 pm

Posted in bugs, linux, open source

Tagged with , ,

Why my edit part cannot be resized down

without comments

I started to play around with Eclipse GMF and annoyed by the fact that I could not resize down my first rectangle figure. I could enlarge the figure but not shrink it!

The reason for that was, there was no layout manager within the rectangle. Adding a layout manager to the figure solved the issue. I think this might be considerable as a bug.

Here’s the link to track back the bug report

Eclipse Bugzilla 242470

Popularity: 1%

Written by Hasan Ceylan

July 29th, 2008 at 11:58 pm

Posted in bugs, eclipse, gmf, solved

Tagged with , , ,