9 Replies Latest reply on Jun 26, 2006 12:28 PM by marklittle

    Installing JTS into default configuration

    paul.robinson

      I am trying to install JBossTS-JTS into the default configuration of JBoss.

      My understanding is that the ?all? configuration is used for clustering and ?default? is used for stand alone instances. As I am using a standalone instance, I believe that I should run JTS in the default configuration.

      Has anyone done this already? If so what steps do I need to take?

      I have tried to do this install myself. I believe the main difference between 'all' and 'default' (as far as JBossTS is concerned) is that 'all' has the CORBA stuff.

      So, before I went through the JBossTS-JTS install instructions, I did the following:

      copied:

      ?server/all/conf/jacorb.properties? to ?server/default/conf/jacorb.properties?

      ?server/all/deploy/iiop-service.xml? to ?server/default/deploy/iiop-service.xml?

      ?server/all/lib/avalon-framework.jar? to ?server/default/lib/avalon-framework.jar?

      I am unsure if this is all I need to do. However, under this configuration I have tested that recovery works (using a tool similar to the XA recovery examples on the WIKI). This was just using a single JBoss instance.

      However, I do get the following exception when I try to look up a session bean within a call to another session bean that is associated with a transaction. I get the same error using both transaction attributes REQUIRED and REQUIRESNEW on the new session bean.




      12:15:49,218 INFO [STDOUT] java.lang.reflect.UndeclaredThrowableException
      12:15:49,218 INFO [STDOUT] at $Proxy61.create(Unknown Source)
      12:15:49,218 INFO [STDOUT] at com.arjuna.xa.logger.LogWrapper.lookup(LogWrapper.java:56)
      12:15:49,218 INFO [STDOUT] at com.arjuna.xa.logger.LogWrapper.log(LogWrapper.java:23)
      12:15:49,218 INFO [STDOUT] at com.arjuna.xa.resources.FaultyXAResource.crash(FaultyXAResource.java:48)
      12:15:49,218 INFO [STDOUT] at com.arjuna.xa.resources.FaultyXAResource.commit(FaultyXAResource.java:65)
      12:15:49,218 INFO [STDOUT] at com.arjuna.ats.internal.jta.resources.jts.orbspecific.XAResourceRecord.commit(XAResou
      rceRecord.java:466)
      12:15:49,218 INFO [STDOUT] at com.arjuna.ArjunaOTS.OTSAbstractRecordPOA._invoke(OTSAbstractRecordPOA.java:184)
      12:15:49,218 INFO [STDOUT] at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:299)
      12:15:49,218 INFO [STDOUT] at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:593)
      12:15:49,218 INFO [STDOUT] at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:735)
      12:15:49,218 INFO [STDOUT] Caused by: javax.transaction.SystemException
      12:15:49,218 INFO [STDOUT] at com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.getTransaction(Tr
      ansactionManagerImple.java:82)
      12:15:49,234 INFO [STDOUT] at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.getTransaction(BaseTransaction
      ManagerDelegate.java:106)
      12:15:49,234 INFO [STDOUT] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:43)
      12:15:49,234 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      12:15:49,234 INFO [STDOUT] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
      12:15:49,234 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      12:15:49,234 INFO [STDOUT] ... 10 more



      Any assistance would be greatly appreciated,

      Thanks.

      Paul.


        • 1. Re: Installing JTS into default configuration
          marklittle

          The JTS component of JBossTS needs an ORB, which is only provided in the all configuration. We won't support JTS into default.

          • 2. Re: Installing JTS into default configuration
            paul.robinson

            Yes, I understand that JTS requires an ORB. Due to JBoss' modular nature, it should be possible to load all the ORB services into the default configuration. In which I would hope JTS would be happy.

            I need to use JTS, but I don't want the overhead of having to run a clustered environment. I can imagine that this would be quite a common requirement.

            Paul.

            • 3. Re: Installing JTS into default configuration
              marklittle

              Then remove clustering from the all configuration. Putting JTS into default is not something we are going to support.

              • 4. Re: Installing JTS into default configuration
                paul.robinson

                ok, that is an option. However, what you propose is not a trivial task. The clustered environment is not simply achieved by a cluster service that can be easily removed. It actually comprises of clustered versions of *ALL* the services that are clusterable. What you propose involves replacing all the clustered versions of the services with non-clustered versions and also doing the same for the corresponding configuration of each service. I agree that this can be achieved, but will prove to be error prone to many users.

                However, I do accept that this is something that JBoss will not support. I just want to point out that I don't believe your solution is as trivial as it seems.

                Thanks,

                Paul.

                • 5. Re: Installing JTS into default configuration
                  marcreis

                  As far as I know and have checked, for my 4.0.4GA (by src) the default's lib's still have the clustered classes, e.g. the "StatefulClusteredProxyFactory" of ejb3. Also the configs files are the same, except that some are not in every version, those that are are identical.

                  The differences are (this should be correct, but no garantie):

                  Only found the default install:
                  in default\deploy\jms


                  hsqldb-jdbc-state-service.xml,
                  hsqldb-jdbc2-service.xml
                  jbossmq-destinations-service.xml
                  jbossmq-service.xml
                  jms-ds.xml
                  jvm-il-service.xml
                  uil2-service.xml

                  and Folders

                  http.invoker.sar (in deploy)
                  jbossmq-httpil.sar (in deploy\jms )


                  These are only found in the all installation:
                  in "all\lib"

                  avalon-framework.jar
                  jacorb.jar
                  jboss-cache.jar
                  jboss-iiop.jar
                  jbossha.jar
                  jgroups.jar

                  in "all\conf"

                  jacorb.properties

                  in all\deploy\jms_

                  hajndi-jms-ds.xml

                  in "all\deploy":

                  cluster-service.xml
                  deploy-hasingleton-service.xml
                  ejb3-clustered-sfsbcache-service.xml
                  ejb3-entity-cache-service.xml
                  iiop-service.xml

                  and Folders in all\deploy

                  deploy.last (has the farming-service.xml, in all\deploy)
                  httpha-invoker.sar
                  juddi-service.sar
                  snmp-adaptor.sar
                  tc5-cluster.sar

                  and under all\

                  deploy-hasingelton (contains jms folder with jms stuff)
                  farm (empty)


                  Hope that helps.
                  Sincerly

                  • 6. Re: Installing JTS into default configuration
                    kconner

                     

                    The clustered environment is not simply achieved by a cluster service that can be easily removed.
                    Clustered services are not new services, they are the same services with additional configuration to enable clustering. Most of these configurations are separate to the base service configurations.

                    It is relatively straight forward to remove the clustering configs, took me a couple of minutes, but I don't know whether that configuration will be a supported platform.

                    An alternative is to try the AS installer and configure the services you require, but this is definitely not a supported configuration of TS. It may work or you may find problems.

                    What you are after should be easier to achieve once we have integrated the TS products into the AS installer.

                    Kev


                    • 7. Re: Installing JTS into default configuration
                      paul.robinson

                      Thanks for the responses.

                      I have done some investigation and have an update to my previous posts.

                      Firstly, the exception I posted in the 1st message is nothing to do with me trying to install JTS in the "default" configuration. I have recently seen this error in the "all" configuration too.

                      What is happening is that I am trying to call a session bean from the "commit" method of an XA resource. I think the problem is that the current transaction is part of a running 2pc protocol and the exception is being thrown by the transaction interceptor on the session bean. This exception is still thrown even if I set the transaction attribute on the session bean to "NotSupported". I guess the problem is that the transaction interceptor always wants to do something with the current transaction. Be it suspend it or enlist resources with it. As the transaction is in the process of being terminated, an exception is thrown.

                      Is my theory correct, and if so am I experiencing correct behaviour?

                      Secondly, I have been running JTS in the default mode by just copying the three files that I mentioned in my first posting. It seems to be working fine and I have had recovery working too. However, I know that this configuration is not supported and there may be bits that I haven?t tested that do not work!

                      Thanks,

                      Paul.

                      • 8. Re: Installing JTS into default configuration
                        marklittle

                         

                        "n9086822" wrote:
                        Thanks for the responses.

                        I have done some investigation and have an update to my previous posts.

                        Firstly, the exception I posted in the 1st message is nothing to do with me trying to install JTS in the "default" configuration. I have recently seen this error in the "all" configuration too.

                        What is happening is that I am trying to call a session bean from the "commit" method of an XA resource.


                        Woa! You're trying to do some potentially transactional work in the scope of the two-phase commit of the same transaction? That's a) potentially dangerous, b) potentially infinitely recursive and c) not supported by many specs and/or implementations. If you need to do something like call a session bean and you don't need the transaction, then suspend it from the thread in the commit call.


                        I think the problem is that the current transaction is part of a running 2pc protocol and the exception is being thrown by the transaction interceptor on the session bean. This exception is still thrown even if I set the transaction attribute on the session bean to "NotSupported". I guess the problem is that the transaction interceptor always wants to do something with the current transaction.


                        Possibly. In general, what you do in 2PC should be sufficient to close down the transaction as far as that resource is concerned. You shouldn't be trying to do more work, particicularly in the second phase!


                        Be it suspend it or enlist resources with it. As the transaction is in the process of being terminated, an exception is thrown.

                        Is my theory correct, and if so am I experiencing correct behaviour?


                        The exception is correct. You should change your code.


                        • 9. Re: Installing JTS into default configuration
                          marklittle

                          OK, that didn't work ;-) Formatting is skew-wif! If you need help deciphering it let me know. Should be easy enough though.