12 Replies Latest reply on Aug 25, 2006 9:59 PM by bill.burke

    injection code rewrite

    bill.burke

      I removed the injection code under org.jboss.ejb3.injection and rewrote in the same module under org.jboss.injection.

      The changes are there so that there is an abstraction so that all the injection code can be reused within Tomcat.

      The next step is to incorporate this code into Tomcat. I had already done some preliminary work in this area with a small prototype, so it should be pretty easy enough.

      There is one problem with the work though. EJB3 team has created a parallel competing metamodel that competes with org.jboss.metadata package. We will probably convert to the old metadata package as many projects use it and it would be easier to just refactor ejb3 code to do this.

        • 1. Re: injection code rewrite
          anil.saldhana

          Bill,
          the following definition in web.xml for JEE1.4 was valid:

           <message-destination-ref>
           <description>produces using a link</description>
           <message-destination-ref-name>mdr/ProducesLink</message-destination-ref-na
          me>
           <message-destination-type>javax.jms.Topic</message-destination-type>
           <message-destination-usage>Produces</message-destination-usage>
           <message-destination-link>TestTopic</message-destination-link>
           </message-destination-ref>
          


          The latest injection code chokes with:
          2006-08-20 23:31:10,609 ERROR [org.apache.tomcat.util.modeler.BaseModelMBean] Exception invoking method addChild
          java.lang.RuntimeException: mapped-name is required for mdr/ProducesLink of deployment jbosstest-web.war at org.jboss.injection.ResourceHandler.loadXmlMessageDestinationRefs(Res
          ourceHandler.java:116)
          at org.jboss.injection.ResourceHandler.loadXml(ResourceHandler.java:126)
           at org.jboss.web.tomcat.tc6.TomcatInjectionContainer.processMetadata(Tom
          catInjectionContainer.java:332)
           at org.jboss.web.tomcat.tc6.WebAppLoader.start(WebAppLoader.java:75)^M
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
          204)
           at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
          


          Any changes in JEE5?

          • 2. Re: injection code rewrite
            starksm64

            The ResourceHandler class also need to be pulled out of the ejb3 deployer as tomcat should not require the ejb3 deployer to due injection of a jms topic. This should be a generic capability coming in from the aop/mc container integration project or similar.

            • 3. Re: injection code rewrite
              starksm64

              Issue for the ResourceHandler parse failure:
              http://jira.jboss.com/jira/browse/EJBTHREE-693

              • 4. Re: injection code rewrite
                starksm64

                I fxed the current jbossetest-web.ear deployment failures. I expect there are several other as the metadata parsing of the jboss-web.xml descriptor is far from complete.

                • 5. Re: injection code rewrite
                  bill.burke

                  injection code can be pulled out if needed. no dependency on EJB3, just convient to put it there for now.

                  • 6. Re: injection code rewrite
                    bill.burke

                    i can work on this now...unless you are wokring on it

                    • 7. Re: injection code rewrite
                      starksm64

                      I'm working on the vdf stuff now so if you want to pull it out go ahead. We will need to fit it into the new vdf stack so I don't know what additional changes will be needed to allow this used by any deployer needing injection support.

                      • 8. Re: injection code rewrite
                        bill.burke

                        it would be cool if this code could work in JBoss 4 too. Its already set up that way pretty much. I don't know what you mean by fit it into the VDF stack. It already has a kernel abstraction and also needs component specific registries.

                        • 9. Re: injection code rewrite
                          starksm64

                          In the vdf stack, I would envision an injection deployer/aspect working off of the component information populated by the ejb/war/bean deployers. Why should ever deployer have to replicate the logic for binding an injection.

                          • 10. Re: injection code rewrite
                            bill.burke

                             

                            "scott.stark@jboss.org" wrote:
                            Issue for the ResourceHandler parse failure:
                            http://jira.jboss.com/jira/browse/EJBTHREE-693


                            I do need to test the XML, but other than service-ref, what else? Can the JBoss WS team even support service-ref yet?

                            • 11. Re: injection code rewrite
                              starksm64

                              I don't see any of these jboss-web_5_0.dtd elements being picked up:

                              loader-repository
                              context-root
                              virtual-host
                              use-session-cookies
                              replication-config
                              webservice-description

                              Also, we should be driving the model from a schema markedup with jbossxb annotation so that there is something to validate the jboss-web.xml against. I also see a bunch of elements handled that do not have a mapping in the jboss-web_5_0.dtd.

                              • 12. Re: injection code rewrite
                                bill.burke

                                right now it is two metamodels. The old one. For the old one, the ENC stuff is ignored. For the new one, the metamodel is only used for ENC/injectin purposes.

                                We talked about this before. Eventually, we will rewrite the ENC/injection stuff to use the old metamodel to avoid disrupting projects like WS. But for now, web.xml/jbossweb.xml is being parsed twice for two different metamodels.