13 Replies Latest reply on Jul 7, 2008 8:38 AM by alesj

    Abstractions again - MDR - sigh!

      Why on earth is the jboss metadata repository depending on JBoss Cache?
      Besides being a totally broken idea (integration with non-trivial projects
      should be done in seperate projects),
      not least because it introduces many circular dependencies

      jboss as -> jboss-mdr -> jboss cache -> jbossas

      Even if jboss cache is fixed to use a proper integration api for jbossas
      you still have

      jboss cache -> micrcocontainer -> jboss-mdr -> jboss cache

      Also, the microcotainer build is broken because the jboss-mdr is snapshot
      is out of date in the repository.

      I'm fixing this.

        • 1. Re: Abstractions again - MDR - sigh!

          I'm going to delete jboss cache from the jboss-mdr project.

          If you want to create a seperate project to implement CacheFactory
          on top of JBossCache then go ahead.

          It's a good job I was awake while trying to rebuild jboss-mdr:

          [INFO] ------------------------------------------------------------------------
          [INFO] Building JBoss MetaData Repository
          [INFO] task-segment: [clean, install]
          [INFO] ------------------------------------------------------------------------
          [INFO] [clean:clean]
          [INFO] Deleting directory /home/ejort/jboss-mdr/target
          [INFO] [resources:resources]
          [INFO] Using default encoding to copy filtered resources.
          [INFO] snapshot org.jboss.cache:jbosscache-common-parent:1.3-SNAPSHOT: checking for updates from repository.jboss.org
          [INFO] snapshot org.jboss.cache:jbosscache-common-parent:1.3-SNAPSHOT: checking for updates from snapshots.jboss.org
          [INFO] snapshot org.jboss.cache:jbosscache-support:1.3-SNAPSHOT: checking for updates from repository.jboss.org
          [INFO] snapshot org.jboss.cache:jbosscache-support:1.3-SNAPSHOT: checking for updates from snapshots.jboss.org
          Downloading: http://repository.jboss.org/maven2/org/jboss/jboss-common-core/2.2.3.GA/jboss-common-core-2.2.3.GA.pom
          3K downloaded
          Downloading: http://repository.jboss.org/maven2/org/jboss/javaee/jboss-javaee/5.0.0.Beta3/jboss-javaee-5.0.0.Beta3.jar
          270K downloaded
          
          [INFO] ------------------------------------------------------------------------
          [INFO] Building JBoss MetaData Repository
          [INFO] task-segment: [dependency:list]
          [INFO] ------------------------------------------------------------------------
          [INFO] [dependency:list]
          [INFO]
          [INFO] The following files have been resolved:
          [INFO] commons-logging:commons-logging:jar:1.0.4:compile
          [INFO] jgroups:jgroups:jar:2.6.2:compile (WRONG!!!!!!!!!)
          [INFO] junit:junit:jar:4.4:test
          [INFO] org.jboss:javassist:jar:3.7.1.GA:compile
          [INFO] org.jboss:jboss-common-core:jar:2.2.5.GA:compile
          [INFO] org.jboss:jboss-reflect:jar:2.0.0.Beta12:compile
          [INFO] org.jboss:jboss-test:jar:1.0.5.GA:test
          [INFO] org.jboss.cache:jbosscache-core:jar:2.1.1.GA:compile (WRONG!!!!!!!!!)
          [INFO] org.jboss.javaee:jboss-javaee:jar:5.0.0.Beta3:compile (WRONG!!!!!!)
          [INFO] org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:compile
          


          I'm also going to deploy the updated snapshot into the repository
          so the MC project builds.

          • 2. Re: Abstractions again - MDR - sigh!
            alesj

             

            "adrian@jboss.org" wrote:
            Why on earth is the jboss metadata repository depending on JBoss Cache?
            Besides being a totally broken idea (integration with non-trivial projects
            should be done in seperate projects),
            not least because it introduces many circular dependencies

            A new project for 3 classes? OK. :-)
            Where should I put it?

            "adrian@jboss.org" wrote:

            Also, the microcotainer build is broken because the jboss-mdr is snapshot
            is out of date in the repository.

            Who deployed over my snapshot w/o updating his trunk?

            • 3. Re: Abstractions again - MDR - sigh!

              In future, always think carefully before introducing additional
              (non-trivial or non-optional) thirdparty dependencies
              to a project. This should be as big a decision as changing the spi.

              • 4. Re: Abstractions again - MDR - sigh!
                alesj

                 

                "adrian@jboss.org" wrote:

                If you want to create a seperate project to implement CacheFactory
                on top of JBossCache then go ahead.

                OK, I'll create a new project: jboss-mdr-cache
                Can I pull this piece in just for MDR tests?

                "adrian@jboss.org" wrote:

                It's a good job I was awake while trying to rebuild jboss-mdr:

                Yup, looks like you had enough sleep over the weekend. :-)


                • 5. Re: Abstractions again - MDR - sigh!
                  alesj

                   

                  "adrian@jboss.org" wrote:
                  In future, always think carefully before introducing additional
                  (non-trivial or non-optional) thirdparty dependencies
                  to a project. This should be as big a decision as changing the spi.

                  Noted.

                  But the main problem here is, like you already pointed, is that JBossCache doesn't have proper split - Cache(Factory) being in spi, the impl details in some other part, which we wouldn't pull in, except for tests.


                  • 6. Re: Abstractions again - MDR - sigh!

                     

                    "alesj" wrote:
                    "adrian@jboss.org" wrote:
                    In future, always think carefully before introducing additional
                    (non-trivial or non-optional) thirdparty dependencies
                    to a project. This should be as big a decision as changing the spi.

                    Noted.

                    But the main problem here is, like you already pointed, is that JBossCache doesn't have proper split - Cache(Factory) being in spi, the impl details in some other part, which we wouldn't pull in, except for tests.


                    SPI/Impl split has nothing to do with the problem.

                    You'd still get the circular dependency because you've got to pull in the implementation
                    jar at some point, all you've done is fix the compile time problem for the spi.

                    Also in JBossAS it would require JBoss Cache (+ related jars)
                    to be in the bootstrap classloader otherwise it couldn't load the classes.

                    Bootstrap ClassLoader: jboss-mdr.jar
                    ^
                    | Delegation is this way
                    |
                    server/.../lib classloader: jboss-cache.jar, jgroups.jar, etc.

                    new JBossCacheCacheFactory() => NCDFE JBossCache

                    • 7. Re: Abstractions again - MDR - sigh!
                      alesj

                       

                      "adrian@jboss.org" wrote:

                      Also in JBossAS it would require JBoss Cache (+ related jars)
                      to be in the bootstrap classloader otherwise it couldn't load the classes.

                      Bootstrap ClassLoader: jboss-mdr.jar
                      ^
                      | Delegation is this way
                      |
                      server/.../lib classloader: jboss-cache.jar, jgroups.jar, etc.

                      new JBossCacheCacheFactory() => NCDFE JBossCache

                      You mean this:
                      "alesj" wrote:

                      OK, I know JBossCache has LRU eviction policy, but this would mean dragging whole JBC into bootstrap.

                      from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=138470.
                      ;-)

                      • 8. Re: Abstractions again - MDR - sigh!

                         

                        "alesj" wrote:

                        A new project for 3 classes? OK. :-)


                        It's only 3 classes now, but in future there could be much more.
                        e.g. creating a MetaDataLoader that goes in a "Cluster' scope
                        that can load metadata from across the cluster using jboss cache/jgroups.

                        i.e. a sort of farming of default metadata changes

                        • 9. Re: Abstractions again - MDR - sigh!
                          alesj

                           

                          "adrian@jboss.org" wrote:
                          "alesj" wrote:

                          A new project for 3 classes? OK. :-)

                          btw: how do I pull in MDR's tests?
                          What all do I need to declare, in original MDR and my new MDR-cache?

                          • 10. Re: Abstractions again - MDR - sigh!
                            manik

                            Sorry I only just saw this.

                            JBC no longer depends on jboss-javaee. It just needed JTA interfaces from jboss-javaee and now depends on the jta artifact in the javax.transaction group (since 2.2.0.CR1).

                            I believe Brian is updating AS 5 clustering code to depend on 2.2.0.CR6, the target JBC release for AS 5 being 2.2.0.GA.

                            I know circular dependency isn't the only issue detailed above, but as an FYI, that part of it is taken care of if you use a 2.2.0 CR.

                            Cheers
                            Manik

                            • 11. Re: Abstractions again - MDR - sigh!
                              alesj

                               

                              "alesj" wrote:
                              "adrian@jboss.org" wrote:
                              "alesj" wrote:

                              A new project for 3 classes? OK. :-)

                              btw: how do I pull in MDR's tests?

                              I've added this:
                               <dependency>
                               <groupId>org.jboss</groupId>
                               <artifactId>jboss-mdr</artifactId>
                               <version>${version.org.jboss.mdr}</version>
                               <type>test-jar</type>
                               <scope>test</scope>
                               </dependency>
                              

                              but now I don't know how to enable this test artifact push on the MDR side.
                              Caused by: Missing:
                              ----------
                              1) org.jboss:jboss-mdr:test-jar:tests:2.0.0-SNAPSHOT


                              • 12. Re: Abstractions again - MDR - sigh!
                                alesj

                                 

                                "alesj" wrote:

                                but now I don't know how to enable this test artifact push on the MDR side.
                                Caused by: Missing:
                                ----------
                                1) org.jboss:jboss-mdr:test-jar:tests:2.0.0-SNAPSHOT

                                Probably this is what I'm looking for:
                                 <plugin>
                                 <groupId>org.apache.maven.plugins</groupId>
                                 <artifactId>maven-jar-plugin</artifactId>
                                 <executions>
                                 <execution>
                                 <goals>
                                 <goal>test-jar</goal>
                                 </goals>
                                 </execution>
                                 </executions>
                                 </plugin>
                                

                                ;-)

                                • 13. Re: Abstractions again - MDR - sigh!
                                  alesj

                                  Done. :-)
                                  - http://anonsvn.jboss.org/repos/jbossas/projects/jboss-mdr-cache/trunk
                                  And it uses the tests from MDR. ;-)