1 2 Previous Next 16 Replies Latest reply on Dec 22, 2003 1:12 PM by Adrian Brock

    FAQ - Read this second

    Adrian Brock Master

      DO NOT POST QUESTIONS HERE - they will be deleted.

      The FAQ has moved to here: http://www.jboss.org/wiki/Wiki.jsp?page=FAQJBossMQ

        • 1. Re: Volunteers for TreeCacheView
          Adrian Brock Master

          > > Check /lib/, in my build jboss-cache ends up
          > > there during build.
          > I did an install on a virginmachine, getting JBoss
          > from the CVS. Everything was okay, the
          > jboss-cache.jar file was in output/lib and
          > treecache-service.xml in output/etc. This is as it
          > should be.

          Sorry, I meant JBossBuild /lib, together with /bin etc.

          > Copy jboss-cache.jar and treecache-service.xml to
          > server//deploy. Once this is stable, I'll add it
          > to (probably) the 'add' configuration.
          > > I can redeploy it in
          > > /server/default/deploy, but that isn't logical.
          > Do it for now.

          There's the confusion! Come to think of it: previous mentioned /lib isn't part of the UCL is it?

          > > Eitherway putting in the files from
          > > /cache/output/etc/ gives an error when put in
          > > /server/default/deploy
          > Yes sir, you'll need to add javagroups-all.jar to the
          > deploy (or lib) directory. I was using the latest
          > JavaGroups from CVS, I didn't try the one shipped
          > with JBoss.
          > Bela

          That's the magic word! With the javagroups-2.0 in the JBoss dist tree-service.xml deploys, cache-service not.

          I'll get the latest and greatest javagroups.



          • 2. Re: JMS Resource Adapter - JTA Transaction
            Adrian Brock Master


            I am sending/publishing to a queue/topic in an EJB but it does not commit/rollback
            when the EJB/JTA Transaction commit/rollsback.


            Use the JMS resource adapter connection factory bound at java:/JmsXA

            • 3. Re: MDB Configuration
              Adrian Brock Master


              How do I configure XXX for an MDB


              You will find details of configuration options in
              docs/dtd/jboss_3_2.dtd (or whatever version you are using)

              The default configuration is in
              You can override the invoker-proxy-bindings and container-configurations in
              your own META-INF/jboss.xml

              NOTE: invoker-proxy-bindings apply only to 3.2.x+. In 3.0.x this configuration
              was in the container-invoker-conf

              Here are some examples from the testsuite:

              • 4. Re: FAQ - Read this second
                Adrian Brock Master


                How do I get a singleton MDB


                From 3.2.4 you would use the following in jboss.xml

                <configuration-name>Singleton Message Driven Bean</configuration-name>

                Before 3.2.4 you will have to add this configuration yourself:

                • 5. FAQ - Read this second
                  Adrian Brock Master


                  I get the following message when using JMS and jdbc together
                  what is wrong?

                  18:56:47,578 WARN [TxConnectionManager] Prepare called on a local tx. Use of local
                  transactions on a jta transaction with more than one branch may result in inconsistent
                  data in some cases of failure.


                  Your jdbc datasource does not support two phase commit,
                  it does not support XA.

                  The following could occur during the commit:

                  JMS: prepare (vote ok)
                  JDBC: prepare (there is no prepare since it is not XA)
                  JMS: commit (guaranteed to work since it was prepared ok)
                  JDBC: commit (might fail)

                  This is bad, the JMS branch of the commit worked but the database commit failed.

                  NOTE: jboss-4.0.0DR3 has an implementation of the Last Resource Gambit
                  this reorders the local resource to make it compatible with XA
                  JMS: prepare (vote ok)
                  JDBC: commit
                  -> fails, rollback JMS
                  -> suceeds, commit JMS

                  This works with any number of XA resources, but only one local resource is allowed.

                  Help me test it and it will be backported to jboss-3.2.x


                  • 6. Re: FAQ - Read this second
                    Adrian Brock Master


                    How do I configure an MDB to talk to remote queue.


                    You need to configure a remote provider (this is similar to local one in jms-ds.xml)
                    1) The name changes with "Whatever" to avoid conflicts with default
                    2) The ProviderUrl used for jndi
                    3) Use external Queue/Topic ConnectionFactory

                     <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=RemoteMQProvider,server=Whatever">
                     <attribute name="ProviderName">WhateverJMSProvider</attribute>
                     <attribute name="ProviderUrl">jnp://whatever:1099</attribute>
                     <attribute name="ProviderAdapterClass">
                     <attribute name="QueueFactoryRef">UIL2XAConnectionFactory</attribute>
                     <attribute name="TopicFactoryRef">UIL2XAConnectionFactory</attribute>

                    Then provide your own invoker binding that uses this provider to deliver
                    messages to the mdb this is either in jboss.xml or standardjboss.xml:


                    Finally use the invoker proxy binder for your mdb in jboss.xml:

                     <configuration-name>My Message Driven Bean</configuration-name>


                    • 7. Re: FAQ - Read this second
                      Adrian Brock Master


                      How do I access a remote jboss connection factory using a managed connection pool.


                      First deploy the provider for the remote machine:

                       <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=RemoteMQProvider,server=Whatever">
                       <attribute name="ProviderName">WhateverJMSProvider</attribute>
                       <attribute name="ProviderUrl">jnp://whatever:1099</attribute>
                       <attribute name="ProviderAdapterClass">
                       <attribute name="QueueFactoryRef">UIL2XAConnectionFactory</attribute>
                       <attribute name="TopicFactoryRef">UIL2XAConnectionFactory</attribute>

                      Second deploy the managed connection factory using this provider:

                      NOTE: The JMSProviderAdapterJNDI

                       <adapter-display-name>JMS Adapter</adapter-display-name>
                       <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
                       <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/WhateverJMSProvider</config-property>

                      Finally configure the user/password in conf/login-config.xml
                      NOTE: The name in the managed connection factory reference is the jndi name.

                       <application-policy name = "WhateverJmsXARealm">
                       <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
                       flag = "required">
                       <module-option name = "principal">guest</module-option>
                       <module-option name = "userName">guest</module-option>
                       <module-option name = "password">guest</module-option>
                       <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=WhateverJmsXA</module-option>


                      • 8. Re: FAQ - Read this second
                        Adrian Brock Master


                        What is the correct way to make a durable subscription.

                        You must set the client id and the subscription name

                        Programmatically, you can do it like this:

                        topicSession.createDurableSubscriber(topic, "MySubscriptionName");

                        Or you can configure it in conf/jbossmq-state.xml


                        • 9. 3855947
                          Adrian Brock Master


                          What vendor specifc properties does JBoss provide?


                          As of 3.2.2 JBoss provides properties for scheduled delivery and redelivery control.
                          See the following link for more information.

                          • 10. Re: FAQ - Read this second
                            Adrian Brock Master


                            Is there is a stand-alone distribution of jbossmq


                            No, but from 3.2.4 there is a script that creates a minimal jbossmq using
                            hypersonic for persistence.

                            To build this configuration (unix users changes as approriate)
                            cd %JBOSS_DIST%\docs\examples\jms\standalone
                            cd %JBOSS_DIST%\bin
                            run.bat -c jbossmq

                            NOTE: hypersonic is NOT recommend for production
                            see docs/examples/jms for alternate db configurations

                            Since jboss-3.2.4 is not release yet, here are the two files that should be placed
                            in docs/examples/jms/standalone (it should also work with 3.2.3)


                            <?xml version="1.0" encoding="UTF-8"?>
                            <!-- This is an Ant build script that creates a minimal jbossmq
                            configuration based on the default configuration
                            <project name="Mininal JBossMQ configuration script" default="config">
                             <!-- Override if the script is not run from within the
                             dist/docs/examples/jms/standalone directory.
                             <property name="jboss.dist" value="../../../.."/>
                             <target name="config">
                             <!-- We are mainly based on the minimal configuration -->
                             <copy todir="${jboss.dist}/server/jbossmq">
                             <fileset dir="${jboss.dist}/server/minimal">
                             <exclude name="conf/jboss-service.xml"/>
                             <exclude name="lib/jboss-minimal.jar"/>
                             <!-- We need the following from the default configuration -->
                             <copy todir="${jboss.dist}/server/jbossmq">
                             <fileset dir="${jboss.dist}/server/default">
                             <!-- configuration -->
                             <include name="conf/jbossmq-state.xml"/>
                             <include name="conf/login-config.xml"/>
                             <include name="conf/xmdesc/*"/>
                             <!-- the main jboss jar -->
                             <include name="lib/jboss.jar"/>
                             <!-- jaas -->
                             <include name="lib/jboss-jaas.jar"/>
                             <include name="lib/jbosssx.jar"/>
                             <!-- transactions -->
                             <include name="lib/jboss-transaction.jar"/>
                             <include name="deploy/transaction-service.xml"/>
                             <!-- jms interfaces -->
                             <include name="lib/jboss-j2ee.jar"/>
                             <!-- local db support -->
                             <include name="lib/jboss-common-jdbc-wrapper.jar"/>
                             <include name="lib/xalan.jar"/>
                             <include name="deploy/jboss-jca.sar"/>
                             <include name="deploy/jboss-local-jdbc.rar"/>
                             <!-- hypersonic -->
                             <include name="lib/hsqldb*"/>
                             <include name="deploy/hsqldb-ds.xml"/>
                             <include name="deploy/jms/hsqldb-jdbc2-service.xml"/>
                             <!-- jbossmq -->
                             <include name="lib/jbossmq.jar"/>
                             <include name="deploy/jms/jbossmq-service.xml"/>
                             <include name="deploy/jms/jbossmq-destinations-service.xml"/>
                             <include name="deploy/jms/uil2-service.xml"/>
                             <!-- This is our main configuration -->
                             <copy todir="${jboss.dist}/server/jbossmq/conf/">
                             <fileset dir="${jboss.dist}/docs/examples/jms/standalone">
                             <include name="jboss-service.xml"/>

                            <?xml version="1.0" encoding="UTF-8"?>
                            <!-- $Id: jboss-minimal.xml,v 2003/10/13 03:28:38 starksm Exp $ -->
                            <!-- ===================================================================== -->
                            <!-- -->
                            <!-- A minimal JBoss Server Configuration -->
                            <!-- -->
                            <!-- ===================================================================== -->
                             <!-- Load all jars from the JBOSS_DIST/server/<config>/lib directory. This
                             can be restricted to specific jars by specifying them in the archives
                             <classpath codebase="lib" archives="*"/>
                             <!-- ==================================================================== -->
                             <!-- Log4j Initialization -->
                             <!-- ==================================================================== -->
                             <mbean code="org.jboss.logging.Log4jService"
                             <attribute name="ConfigurationURL">resource:log4j.xml</attribute>
                             <!-- ==================================================================== -->
                             <!-- JNDI -->
                             <!-- ==================================================================== -->
                             <mbean code="org.jboss.naming.NamingService"
                             <!-- The listening port for the bootstrap JNP service. Set this to -1
                             to run the NamingService without the JNP invoker listening port.
                             <attribute name="Port">1099</attribute>
                             <!-- ==================================================================== -->
                             <!-- Security -->
                             <!-- ==================================================================== -->
                             <mbean code="org.jboss.security.plugins.SecurityConfig"
                             <attribute name="LoginConfig">jboss.security:service=XMLLoginConfig</attribute>
                             <mbean code="org.jboss.security.auth.login.XMLLoginConfig"
                             <attribute name="ConfigResource">login-config.xml</attribute>
                             <!-- JAAS security manager and realm mapping -->
                             <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
                             <attribute name="SecurityManagerClassName">
                             <!-- ==================================================================== -->
                             <!-- Transactions -->
                             <!-- ==================================================================== -->
                             <!-- The configurable Xid factory. For use with Oracle, set pad to true -->
                             <mbean code="org.jboss.tm.XidFactory"
                             <!--attribute name="Pad">true</attribute-->
                             | The fast in-memory transaction manager.
                             <mbean code="org.jboss.tm.TransactionManagerService"
                             <attribute name="TransactionTimeout">300</attribute>
                             <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
                             <!-- ==================================================================== -->
                             <!-- Deployment Scanning -->
                             <!-- ==================================================================== -->
                             <!-- An mbean for hot deployment/undeployment of archives.
                             <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
                             <depends optional-attribute-name="Deployer">jboss.system:service=MainDeployer</depends>
                             <!-- The URLComparator can be used to specify a deployment ordering
                             for deployments found in a scanned directory. The class specified
                             must be an implementation of java.util.Comparator, it must be able
                             to compare two URL objects, and it must have a no-arg constructor.
                             Two deployment comparators are shipped with JBoss:
                             - org.jboss.deployment.DeploymentSorter
                             Sorts by file extension, as follows:
                             "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip",
                             - org.jboss.deployment.scanner.PrefixDeploymentSorter
                             If the name portion of the url begins with 1 or more digits, those
                             digits are converted to an int (ignoring leading zeroes), and
                             files are deployed in that order. Files that do not start with
                             any digits will be deployed last, and they will be sorted by
                             extension as above with DeploymentSorter.
                             <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
                             <!-- The Filter specifies a java.io.FileFilter for scanned
                             directories. Any file not accepted by this filter will not be
                             deployed. The org.jboss.deployment.scanner.DeploymentFilter
                             rejects the following patterns:
                             "#*", "%*", ",*", ".*", "_$*", "*#", "*$", "*%", "*.BAK",
                             "*.old", "*.orig", "*.rej", "*.bak", "*,v", "*~", ".make.state",
                             ".nse_depinfo", "CVS", "CVS.admin", "RCS", "RCSLOG", "SCCS",
                             "TAGS", "core", "tags"
                             <attribute name="Filter">org.jboss.deployment.scanner.DeploymentFilter</attribute>
                             <attribute name="ScanPeriod">5000</attribute>
                             <!-- URLs are comma seperated and unprefixed arguments are considered
                             file URLs and resolve relative to server home(JBOSS_DIST/server/default)
                             unless the given path is absolute. Any referenced directories cannot
                             be unpackaged archives, use the parent directory of the unpacked
                             <attribute name="URLs">


                            • 11. Re: FAQ - Read this second
                              Steve Posick Newbie


                              How do I configure JBoss to use Oracle Advanced queue as a JMS Provider.


                              JBoss JMS provider for Oracle Advanced Queue Patch.


                              • 12. Re: FAQ - Read this second
                                Adrian Brock Master


                                I get an error about JMS (XAConnectionFactory) not bound in jboss 3.2.1


                                In conf/jboss-server.xml change the scanner to the following:

                                 <attribute name="RecursiveSearch">True</attribute>


                                I get the same message but I have RecursiveSearch of True?
                                But I do get an IncompleteDeploymentException


                                You have broken your JMS configuration. Most likely the persistence manager
                                Enable TRACE logging as described in the "READ THIS FIRST" and look for
                                error messages, most likely SQLExceptions from the database.
                                You can ignore DEBUG messages about " jms* table already exists" these are normal.

                                • 13. Re: FAQ - Read this second
                                  Adrian Brock Master


                                  I get a java.net exception when using JMS what is the problem.


                                  There is something wrong with your network configuration.
                                  1) On linux check /etc/hosts doesn't have mapped to your host name
                                  2) check your ip address is reachable from the client, try pinging the server/client
                                  from the other machine
                                  3) Try telnet host port, e.g. is jndi visible - telnet serverip 1099 or UIL2 - telnet serverip 8093
                                  4) Check your dns/dhcp setup, has your lease expired.
                                  5) nslookup will help you get a host name from an ip address to check
                                  reverse resolution - do the server and client agree about which host binds
                                  to which ip address?
                                  6) Try tracing the route to the server - traceroute serverip
                                  7) Is there an firewall in the way?
                                  8) Use netstat to see what ports are open and bound to where, e.g. netstat -an
                                  9) Do you have multi nics (network interface cards), are you multi-homing?
                                  Are the services bound to all of them?
                                  10) Add the folllowing log4j.properties to the client which will produce a log
                                  showing where the client thinks it is connecting to

                                  log4j.rootCategory=INFO, Default
                                  log4j.appender.Default.layout.ConversionPattern=%d %-5p [%c(1)] {%t} %m%n

                                  Running this code on the client or server will help you understand what java
                                  thinks is your hostname/ip address
                                  import java.net.InetAddress;
                                  public class WhatIsMyAddress
                                   public static void main(String[] args) throws Exception

                                  Are you accidently discovering the wrong server using jboss's HAJNDI.
                                  Try adding the following to your jndi properties to disable discovery of a jboss
                                  server on your network.

                                  • 14. Re: FAQ - Read this second
                                    Adrian Brock Master


                                    I am sending messages with a ttl (time to live) on the message.
                                    The message should not have expired yet, but my client is not receiving messages.


                                    The clocks are not in synch between the client and the server.
                                    e.g. Your client thinks it is 10 O'clock but the server thinks it is 11 O'clock.
                                    Sending a message with a ttl of less than one hour will mean the server expires
                                    the message immediately.

                                    Obviously, the reverse could be true and messages don't get expired when expected.

                                    1 2 Previous Next