1 2 3 4 Previous Next 53 Replies Latest reply on May 22, 2008 8:16 AM by dimitris Go to original post
      • 15. Re: migrating TransactionManager and Invokers to POJO
        jhalliday

        > See the JIRA issue.

        Would that be JBAS-5144, which is marked as done? You saying it needs reopening?

        • 16. Re: migrating TransactionManager and Invokers to POJO

           

          "jhalliday" wrote:
          > See the JIRA issue.

          Would that be JBAS-5144, which is marked as done? You saying it needs reopening?



          Yes. And the same goes for the war deployers dependency on the
          JaasSecurityManager.

          • 17. Re: migrating TransactionManager and Invokers to POJO
            jhalliday

            Yeah with that change the server will at least start cleanly. Thanks. Once that update is in trunk it should be possible for Dimitris or one of the other AS people to move the invokers and transaction manager into deploy. Then I can POJOize the transaction manger :-)

            • 18. Re: migrating TransactionManager and Invokers to POJO

              I've done this.
              There is now a remoting-service.xml and transaction-service.xml in deploy

              I've raised this issue
              http://jira.jboss.com/jira/browse/JBAS-5349
              since out testsuite coverage on bootstrap dependencies of apps is weak.

              • 19. Re: migrating TransactionManager and Invokers to POJO
                brian.stansberry

                Argh, looks like the testsuite broke again because of this; I once again forgot to update the various src/resources/test-configs. This is one of those mistakes that seems doomed to be repeated over and over and over.

                Fixing it now.

                • 20. Re: migrating TransactionManager and Invokers to POJO
                  shelly.mcgowan

                  if you're referring to tomcat-webctx config not starting, i already fixed it

                  • 21. Re: migrating TransactionManager and Invokers to POJO
                    brian.stansberry

                    Thanks. :) Looking through test-configs I see others that are broken in various ways, e.g. several with a server.xml still in deployers/jbossweb.deployers. I'll do a bit of a cleanup.

                    • 22. Re: migrating TransactionManager and Invokers to POJO

                      Can't we do this in a cleverer way?

                      It's stupid that somebody has to "guess" where 5 or 6 copies of a config file exists.
                      Embedded has the same problem with continually out-of-date config.

                      I'd also like to see the web deployer beans split up. Why do we repeat things in
                      the default/all config just to change the cluster defaults? The clustering defaults
                      should be in a different file.

                      • 23. Re: migrating TransactionManager and Invokers to POJO
                        brian.stansberry

                        We don't need a separate file due to the cluster defaults deployer; having two different files in the tomcat module is a bit of legacy cruft. A file with the clustering deployers in it should work just fine in default.

                        That said, I'd like the clustering deployer out of the file too. IIRC it mostly isn't because I somewhat wanted the deployer in jbossweb.deployer/META-INF folder and if I put a second -beans.xml there it wouldn't get deployed.

                        Re: the various test-config stuff, yes, there has to be a cleverer way. The biggest case of using a test-config to override instead of add is to change server.xml. A couple do that to inject sso valves; that can probably be done with a separate mbean instead. Not particularly "clever", but will work. Don't know if that kind of thing can be done with some of the others, which try to override stuff like connectors and the security realm, which may not be changeable after the web server starts.

                        • 24. Re: migrating TransactionManager and Invokers to POJO
                          brian.stansberry

                          Back to the main topic of this thread... :)

                          Moving jboss.remoting:service=Connector,transport=socket into deploy has broken the tests-profileservice test, which deploys a deployers/profileservice-beans.xml that has beans that depend on the remoting connector.

                          I'm going to experiment with moving jboss.remoting:service=Connector,transport=socket back into conf/jboss-service.xml. It doesn't declare a dependency on the transaction manager and shouldn't have one.

                          If that works and is the direction we want to go, then the remoting-service.xml file should probably be renamed to something like detached-invokers-service.xml.

                          • 25. Re: migrating TransactionManager and Invokers to POJO
                            brian.stansberry

                            That doesn't work, at least not trivially, as the remoting connector as configured actually needs the unified invoker since it's specified as a handler:

                            2008-03-29 17:16:16,815 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.remoting:service=Connector,transport=socket state=Create mode=Manual requiredState=Installed
                            java.lang.reflect.UndeclaredThrowableException
                             at $Proxy45.setMBeanServer(Unknown Source)
                             at org.jboss.remoting.transport.Connector.addInvocationHandler(Connector.java:1192)
                             at org.jboss.remoting.transport.Connector.configureHandlersFromXML(Connector.java:848)
                             at org.jboss.remoting.transport.Connector.start(Connector.java:317)
                            ....
                            Caused by: javax.management.InstanceNotFoundException: jboss:service=invoker,type=unified is not registered.
                             at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:529)
                             at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:608)
                             at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:193)
                             ... 54 more
                            


                            I recall in some unit test or other I actually injected another handler after the fact, although IIRC getting it to work was a hack. Perhaps it wasn't; I'll see if I can find it.

                            • 26. Re: migrating TransactionManager and Invokers to POJO
                              brian.stansberry

                              No hack required; just a simple re-configuration.

                              The remoting connector is back in conf/jboss-service.xml. I re-opened http://jira.jboss.com/jira/browse/JBAS-5348 for this and left it open for a bit in case anyone has any input after the weekend.

                              • 27. Re: migrating TransactionManager and Invokers to POJO

                                 

                                "bstansberry@jboss.com" wrote:
                                No hack required; just a simple re-configuration.

                                The remoting connector is back in conf/jboss-service.xml. I re-opened http://jira.jboss.com/jira/browse/JBAS-5348 for this and left it open for a bit in case anyone has any input after the weekend.


                                Thats the wrong solution. The real solution is move whatever in the profile service
                                is allowing remote access into deploy.

                                Eventually conf/jboss-service.xml should just die with bootstrap things
                                going bootstrap-beans.xml and everything else in deploy.

                                • 28. Re: migrating TransactionManager and Invokers to POJO
                                  jhalliday

                                  Another week, another exciting chapter in the migration saga...

                                  I remove the transaction manager mbean from transaction-service.xml and put a bean in transaction-bean.xml instead:

                                  <?xml version="1.0" encoding="UTF-8"?>
                                  <deployment xmlns="urn:jboss:bean-deployer:2.0">
                                   <bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService">
                                   <property name="transactionTimeout">300</property>
                                   <property name="objectStoreDir">${jboss.server.data.dir}/tx-object-store</property>
                                   </bean>
                                  </deployment>
                                  


                                  That works ok, the bean is instantiated and create is called on it. Woohoo.

                                  Then lots of things break, because they depend on "jboss:service=TransactionManager", so I try to persuade my shiny new POJO to cross-dress as a JMX mbean:

                                  <?xml version="1.0" encoding="UTF-8"?>
                                  <deployment xmlns="urn:jboss:bean-deployer:2.0">
                                  
                                   <bean name="MBeanExporter" class="org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback">
                                   <property name="serviceController"><inject bean="JMXKernel" property="serviceController"/></property>
                                   </bean>
                                   <bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService">
                                   <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=TransactionManager", exposedInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class, registerDirectly=true)</annotation>
                                  
                                   <property name="transactionTimeout">300</property>
                                   <property name="objectStoreDir">${jboss.server.data.dir}/tx-object-store</property>
                                  
                                   <install bean="MBeanExporter" method="install">
                                   <parameter><inject fromContext="context"/></parameter>
                                   </install>
                                   <uninstall bean="MBeanExporter" method="uninstall">
                                   <parameter><inject fromContext="context"/></parameter>
                                   </uninstall>
                                   </bean>
                                  
                                  </deployment>
                                  


                                  So now I get two copies of the transaction manager bean instantiated. Huh? I want one instance, not two. Where the heck did the other one come from? I guess perhaps I've not expressed the desired config properly? I want one object behaving as both a bean and an mbean, not two separeate objects. Is there some other way of achieving that?

                                  I also have problems because some things are not happening in the right order. Before either create or start is called on the transaction manager bean I see something that depends on it being started. Huh? This does not follow my understanding of the lifecycle, which is that dependent objects should not move into a state until everything they depend on has achieved at least an equivalently advanced state. Does the required state need to be specified explicitly on the CachedConnectionManager? Or perhaps this behaviour is something to do with the CCM being an mbean whilst the TM is a bean?

                                  14:22:54,750 ERROR [AbstractKernelController] Error installing to Start: name=jboss.jca:service=CachedConnectionManager state=Create mode=Manual requiredState=Installed
                                  java.lang.ExceptionInInitializerError
                                   at org.jboss.resource.connectionmanager.CachedConnectionManager.startService(CachedConnectionManager.java:191)
                                  ...
                                  Caused by: java.lang.RuntimeException: Unable to locate the transaction manager
                                   at org.jboss.tm.TransactionManagerLocator.locate(TransactionManagerLocator.java:105)
                                  ...
                                  


                                  • 29. Re: migrating TransactionManager and Invokers to POJO

                                     

                                    "jhalliday" wrote:

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <deployment xmlns="urn:jboss:bean-deployer:2.0">
                                    
                                     <bean name="MBeanExporter" class="org.jboss.system.microcontainer.jmx.ServiceControllerLifecycleCallback">
                                     <property name="serviceController"><inject bean="JMXKernel" property="serviceController"/></property>
                                     </bean>
                                     <bean name="TransactionManager" class="com.arjuna.ats.jbossatx.jta.TransactionManagerService">
                                     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=TransactionManager", exposedInterface=com.arjuna.ats.jbossatx.jta.TransactionManagerServiceMBean.class, registerDirectly=true)</annotation>
                                    
                                     <property name="transactionTimeout">300</property>
                                     <property name="objectStoreDir">${jboss.server.data.dir}/tx-object-store</property>
                                    
                                     <install bean="MBeanExporter" method="install">
                                     <parameter><inject fromContext="context"/></parameter>
                                     </install>
                                     <uninstall bean="MBeanExporter" method="uninstall">
                                     <parameter><inject fromContext="context"/></parameter>
                                     </uninstall>
                                     </bean>
                                    
                                    </deployment>
                                    


                                    So now I get two copies of the transaction manager bean instantiated. Huh? I want one instance, not two. Where the heck did the other one come from? I guess perhaps I've not expressed the desired config properly? I want one object behaving as both a bean and an mbean, not two separeate objects. Is there some other way of achieving that?


                                    Either use the @JMX annotation or the MBeanExporter, don't do both.
                                    You don't have two objects, you have two attempts at MBeanRegistration.