The Source for Java Technology Collaboration
User: Password:



Andreas Schaefer's Blog

October 2005 Archives


Sun let's you Scratch the Itch in the JDK 1.6

Posted by schaefa on October 28, 2005 at 02:09 PM | Permalink | Comments (0)

After complaining about shortcomings in the Java JDK for some time I took the opportunity to actually try to fix one of the problems is encountered and send a patch to Sun. Looking back I have to give kudos to Sun how relatively easy it is to become a contributor and that they really want to keep the developers in the loop not like in the "good old" days where submitting a bug report meant that I just disappeared in a black hole and if you were lucky it reappeared later.

What I would like to see is that there would be a way to access particular classes from the web rather than downloading 65M archive especially when I also need to download a 85M archive containing the binaries. Normally I only need a few classes to work with in order to fix a problem.

So far I am only interested in fixing problems within the Java classes of the JDK and so I do not need to rebuild the entire JDK. In order to run a program with my patches I just prepend the build directory of my patches to the boot classpath like it did to run the JUnit tests within my Ant build script:

<junit printsummary="yes" fork="yes" forkmode="once"
haltonfailure="no" showoutput="true"
failureproperty="test.failures">

<formatter type="xml" usefile="true"/>

<classpath>
<path refid="build.test.path"/>
</classpath>

<jvmarg value="-Xbootclasspath/p:${my.boot.class.path}"/>
<jvmarg value="-Xms128m"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-Xnoclassgc"/>

<batchtest todir="${test.report.dir}" >
<fileset dir="${test.src.dir}" includes="**/*" excludes=""/>
</batchtest>
</junit>

This is enables me to run the tests without my patch (just by running JDK 1.6 on its won) so make sure that it keeps failing.

Strange how things are changing over time. Back when I was contributing to JBoss there were tensions with Sun about licensing and now I am contributing to the JDK and I have tensions with JBoss about licensing and trademarks.

Have fun - Andy



Drools Performance Limits

Posted by schaefa on October 13, 2005 at 03:40 PM | Permalink | Comments (8)

I had the chance to test the Rules Engine Drools and even tough I like it I concluded that Drools did not perform as we had expected. The main reason to drop Drools where that the number of elements participating in the rules where not confined to a small number. My tests showed that Drools is fine when either the number of elements in the test is small or when the many of the possible combinations can be removed because of failing conditions. Again I did not conclude that Drools is not a good tool but rather that I tried to find the limitations of the tool.

Here I want to show a very, very simplistic test of drools performance just to show my point. I have three classes which does return the same object: a string called "Test".:

package com.madplanet.drools.test;
public class A {
    public Object getObject() {
        return "TEST";
    }
}

Then I created a Drools Rule Script which just tests each Class' getObject() value against one of the other type:

<?xml version="1.0"?>

<rule-set name="zip.code.rule"
    xmlns="http://drools.org/rules"
    xmlns:java="http://drools.org/semantics/java"
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
    xs:schemaLocation="http://drools.org/rules rules.xsd
                       http://drools.org/semantics/java java.xsd">

    <import>com.madplanet.drools.test.A</import>
    <import>com.madplanet.drools.test.B</import>
    <import>com.madplanet.drools.test.C</import>

    <rule name="Test Transitiveness" salience="10">
        <parameter identifier="a">
            <class>com.madplanet.drools.test.A</class>
        </parameter>
        <parameter identifier="b">
            <class>com.madplanet.drools.test.B</class>
        </parameter>
        <parameter identifier="c">
            <class>com.madplanet.drools.test.C</class>
        </parameter>
        <java:condition>
            a.getObject().equals( b.getObject() )
        </java:condition>
        <java:condition>
            b.getObject().equals( c.getObject() )
        </java:condition>
        <java:condition>
            c.getObject().equals( a.getObject() )
        </java:condition>
        <java:consequence>
        </java:consequence>
    </rule>
</rule-set>

Finally I created a jUnit Test Case that creates the same number of A, B and C instances, assign it to the working memory of Drools and finally fires the rule:

    public void testZipCodeExcludeWithinInclude()
            throws Exception {
        for( int i = 50; i < 150; i += 5 ) {
            WorkingMemory lWorkingMemory = mRuleBase.newWorkingMemory();
            long lStartTime = System.currentTimeMillis();
            System.out.println( "--- Start: " + i + ". Loop ---" );
            for( int j = 0; j < i; j++ ) {
                lWorkingMemory.assertObject( new A() );
            }
            printLog( "   ", "Added all As", i, lStartTime );
            for( int j = 0; j < i; j++ ) {
                lWorkingMemory.assertObject( new B() );
            }
            printLog( "   ", "Added all Bs", i, lStartTime );
            for( int j = 0; j < i; j++ ) {
                lWorkingMemory.assertObject( new C() );
            }
            printLog( "   ", "Added all Cs", i, lStartTime );
            lWorkingMemory.fireAllRules();
            printLog( "", "Finished (fired rules)", i, lStartTime );
        }
    }

Below is the output of the test above and as you can see the cross product of all the possible combinations defines the duration of the execution. Please keep in mind that in that test all conditions succeed and so it is the worst case scenario. If all condition would fail the test would go through in a blink of the eye but this is the other extreme. Also this test is so simple that it does not represent any actual business case.

--- Start: 50. Loop ---
   Added all As, loop: 50, duration: 0s
   Added all Bs, loop: 50, duration: 0s
   Added all Cs, loop: 50, duration: 0s
Finished (fired rules), loop: 50, duration: 1s
--- Start: 55. Loop ---
   Added all As, loop: 55, duration: 0s
   Added all Bs, loop: 55, duration: 0s
   Added all Cs, loop: 55, duration: 0s
Finished (fired rules), loop: 55, duration: 1s
--- Start: 60. Loop ---
   Added all As, loop: 60, duration: 0s
   Added all Bs, loop: 60, duration: 0s
   Added all Cs, loop: 60, duration: 1s
Finished (fired rules), loop: 60, duration: 2s
--- Start: 65. Loop ---
   Added all As, loop: 65, duration: 0s
   Added all Bs, loop: 65, duration: 0s
   Added all Cs, loop: 65, duration: 1s
Finished (fired rules), loop: 65, duration: 2s
--- Start: 70. Loop ---
   Added all As, loop: 70, duration: 0s
   Added all Bs, loop: 70, duration: 0s
   Added all Cs, loop: 70, duration: 1s
Finished (fired rules), loop: 70, duration: 3s
--- Start: 75. Loop ---
   Added all As, loop: 75, duration: 0s
   Added all Bs, loop: 75, duration: 0s
   Added all Cs, loop: 75, duration: 2s
Finished (fired rules), loop: 75, duration: 4s
--- Start: 80. Loop ---
   Added all As, loop: 80, duration: 0s
   Added all Bs, loop: 80, duration: 0s
   Added all Cs, loop: 80, duration: 2s
Finished (fired rules), loop: 80, duration: 5s
--- Start: 85. Loop ---
   Added all As, loop: 85, duration: 0s
   Added all Bs, loop: 85, duration: 0s
   Added all Cs, loop: 85, duration: 3s
Finished (fired rules), loop: 85, duration: 7s
--- Start: 90. Loop ---
   Added all As, loop: 90, duration: 0s
   Added all Bs, loop: 90, duration: 0s
   Added all Cs, loop: 90, duration: 4s
Finished (fired rules), loop: 90, duration: 8s
--- Start: 95. Loop ---
   Added all As, loop: 95, duration: 0s
   Added all Bs, loop: 95, duration: 0s
   Added all Cs, loop: 95, duration: 4s
Finished (fired rules), loop: 95, duration: 9s
--- Start: 100. Loop ---
   Added all As, loop: 100, duration: 0s
   Added all Bs, loop: 100, duration: 0s
   Added all Cs, loop: 100, duration: 6s
Finished (fired rules), loop: 100, duration: 11s
--- Start: 105. Loop ---
   Added all As, loop: 105, duration: 0s
   Added all Bs, loop: 105, duration: 0s
   Added all Cs, loop: 105, duration: 7s
Finished (fired rules), loop: 105, duration: 14s
--- Start: 110. Loop ---
   Added all As, loop: 110, duration: 0s
   Added all Bs, loop: 110, duration: 0s
   Added all Cs, loop: 110, duration: 7s
Finished (fired rules), loop: 110, duration: 15s
--- Start: 115. Loop ---
   Added all As, loop: 115, duration: 0s
   Added all Bs, loop: 115, duration: 0s
   Added all Cs, loop: 115, duration: 8s
Finished (fired rules), loop: 115, duration: 17s
--- Start: 120. Loop ---
   Added all As, loop: 120, duration: 0s
   Added all Bs, loop: 120, duration: 0s
   Added all Cs, loop: 120, duration: 11s
Finished (fired rules), loop: 120, duration: 21s
--- Start: 125. Loop ---
   Added all As, loop: 125, duration: 0s
   Added all Bs, loop: 125, duration: 0s
   Added all Cs, loop: 125, duration: 13s
Finished (fired rules), loop: 125, duration: 26s
--- Start: 130. Loop ---
   Added all As, loop: 130, duration: 0s
   Added all Bs, loop: 130, duration: 0s
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 180.885 sec
    [junit] [ERROR] TEST com.madplanet.drools.test.ObjectEqualsTest FAILED

The loop in the output means how many instances of A, B and C are created. The 'Added' line is printed out when all of the respective object were added to the Drools working memory. Finally he test case fails because the test runs out of memory (I used the Ant's default settings) and can be easily fixed by increasing the heap size.

My conclusion is that Drools works fine when the number of participating elements is small but Drools may run into a performance problem when the cross product of the participating objects is huge. In my test it was getting slow when the cross product run over half a million.



Open-Source vs. Big Bucks: II

Posted by schaefa on October 12, 2005 at 11:32 AM | Permalink | Comments (4)

I respectfully disagree with Jacob's view to the JBoss licensing issue. When I and even more true for Rickard started to contribute JBoss had a GPL license. Then Marc asked us if we agree to change it to LGPL but did not mention that he was going to register JBoss as a trademark. Therefore we were not aware of the issues that did arise now. The JBoss Inc. already used legal threads to stop competition with the Apache Geronimo project and so I think that is not a isolated incident.

I do no dispute the use of a trademark in a business but here an open-source project, a commercial entity and a trademark are combined in a such a way that the JBoss Inc. can profit from the open-source project without any competition. Matthias, from the JBoss Issue Blog, pointed out that Bea registered its name as trademark for the product and services but Weblogic is only a registered trademark for the product. This way I can advertise training for the Weblogic application server as long as I do not use the Bea trademark with it.

Even thought this issue that came up with JBoss it is a much bigger issue than that. It has implication on how open-source project conduct their business and that contributors have the right to know upfront on what their are getting into. This is also a question about ethics, control and protection of an open-source project. I always thought that the trademark of Linux and JBoss are there to protect the project from a sleazy opportunist that uses the trademark to exploit a successful open-source project. Now it seems that this one comes within its own ranks and that the idea of the protection was just a nice cover.

JBoss Inc. can make as much money of the project as they like and I am perfectly happy with that. On the other hand I know more about JBoss than most of the people with a JBoss certification or partnership with the JBoss Inc. so why shouldn't I be allowed to give training about JBoss?

Have fun - Andy



Open-Source vs. Big Bucks

Posted by schaefa on October 11, 2005 at 12:10 PM | Permalink | Comments (3)

What a disappointment! After feeling betrayed by the JBoss Inc. with the trademark lawsuits now also Linus Torwald seems to do the same thing with Linux. Yesterday I was attending a presentation about Java 6 (Mustang) and some of the discussions turned around Sun and open-source. Finally, I guess, I have to admit that maybe Sun is more trustworthy company with respect to open-source than some of the bigger open-source projects. I really feel that Sun is paying more attention to the open-source community lately than projects that started as open-source projects and then became a business.

I am especially disgusted by the comments of Sacha Labourey stating that Rickard is not a co-founder of JBoss. Today there would be no JBoss if Rickard Oeberg did not revamp early version of Marc's monolithic application server. He was the one that came up with the use of JMX as an IOC framework, the use of Interceptors to easily wrap J2EE services around an EJB call and the use of Dynamic Proxies to avoid the generation and distribution of stubs. Without Rickard JBoss would have ended up the same way Jonas did. Of course Rickard is not a co-founder of the JBoss Group (today called JBoss Inc.) but they were created way after JBoss became a serious J2EE-based application server.

Maybe there is a need to separate the open-source code from any trademark to prevent individual from taking advantage of code contributed by the community. I do not contemn anyone from making money of an open-source project but it is not acceptable in my opinion that this only applies to a few. I always thought that the JBoss trademark is there to avoid a big company from screwing the open-source project but now it seems that it backfired for the community and the JBoss Inc. can just cash in.

Have fun - Andy



JBoss: Big Bucks vs. Open-Source

Posted by schaefa on October 07, 2005 at 01:11 PM | Permalink | Comments (1)

Rickard Oeberg's (co-founder of JBoss) blog points to the JBoss Issue Blog where he and Matthias Bohnen discusses issues related to JBoss. So far Marc Fleury and the rest of the JBoss Inc. could hide their business agenda behind the JBoss open-source project but finally they feel that they can afford to let the business take over because they are now so successful. On the other hand it finally vindicated the critics of the JBoss enterprise warning that in such a tight integration of open-source and business one day the idea of open-source in JBoss goes down the drain. Therefore I decided to join their open letter to JBoss and Marc not to abuse the JBoss trademark because many of use helped them to accomplish the current state. Without Rickard Marc Fleury would be still a pre-sales engineer at Sun because JBoss would not exist. If you think that JBoss should remain a healthy open-source project please join me by sign up to this open letter.

That said I still think that competition will eventually force JBoss to be more forthcoming and so I decide to start a thread evaluating Geronimo to see how Geronimo compares to JBoss. I would like to figure under what conditions Geronimo could replace JBoss and to point out their respective advantages over the other server.

Have a nice weekend - Andy



JBoss: Big Buck vs. Open-Source

Posted by schaefa on October 07, 2005 at 01:08 PM | Permalink | Comments (0)

Rickard Oeberg's (co-founder of JBoss) blog points to the JBoss Issue Blog where he and Matthias Bohnen discusses issues related to JBoss. So far Marc Fleury and the rest of the JBoss Inc. could hide their business agenda behind the JBoss open-source project but finally they feel that they can afford to let the business take over because they are now so successful. On the other hand it finally vindicated the critics of the JBoss enterprise warning that in such a tight integration of open-source and business one day the idea of open-source in JBoss goes down the drain. Therefore I decided to join their open letter to JBoss and Marc not to abuse the JBoss trademark because many of use helped them to accomplish the current state. Without Rickard Marc Fleury would be still a pre-sales engineer at Sun because JBoss would not exist. If you think that JBoss should remain a healthy open-source project please join me by sign up to this open letter.

That said I still think that competition will eventually force JBoss to be more forthcoming and so I decide to start a thread evaluating Geronimo to see how Geronimo compares to JBoss. I would like to figure under what conditions Geronimo could replace JBoss and to point out their respective advantages over the other server.

Have a nice weekend - Andy





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds