8 Replies Latest reply on Apr 19, 2004 12:10 PM by Adrian Brock

    Cannot bind to connection factories...

    adamfowler Newbie

      Hi all,

      I've been trying all day to try and get the simplist of MDBs working with JBoss. Its an absolute nightmare. I started on JBoss3.2.1 but have downloaded 3.2.3 now (JMS failed completely on 3.2.1 - could not connect to JMS provider or such like)

      I have a normal EJB called Document. I want to connect to a MDB called queue/DocumentUpload. I am using Sun ONE IDE Enterprise edition. I have followed the JBoss WIKI docs for JBossMQ as regards the naming conventions and it fails. It replies for anything I try that the name isn't bound. I have tried the following (and then some):

      env-ref: QueueConnectionFactory
      jndi-name: QueueConnectionFactory

      env-ref: XAConnectionFactory
      jndi-name: XAConnectionFactory

      env-ref: XAConnectionFactory
      jndi-name: java:/JmsXA

      The main problem is that the JBoss docs are next to useless, like so many other projects. (sorry, but its true).

      Could someone please just tell me:

      1) How to set up a queue with a particular JNDI name (I've just copied the example 'A' from the deploy/jms/jbossmq-destinations-service.xml file)
      2) What JNDI name/environment refs I need to use
      3) Any other issues which could be causing this.
      4) Any Sun ONE specific steps I need to take

      NB I'm also using my own DS, and have created the tables in the DB with the correct permissions, so its nothing to do with that. The DB works with everything else so I have no reason to suspect this.

      Thanks in advance, pleeeeease update the wiki with some more info on this,

      Adam.

        • 1. Re: Cannot bind to connection factories...
          Adrian Brock Master

          Your post reads:

          I have a problem trying to configure my queue.
          I'm not going to tell you what my problem is, instead I'm going to complain.

          I'm also going to post a small amount of information that makes no sense:
          e.g. env-ref instead of resource-ref
          e.g. What has queue configuration got to do with an IDE?

          • 2. Re: Cannot bind to connection factories...
            adamfowler Newbie

            I find your reply interesting. I commented that the wiki documentation was next to useless (One small comment) and quite a bit of configuration information, and received a rather insulting reply saying I was merely whining. Such professionalism from support staff.

            Anyways...

            - The information I provided is all that I can find to do with configuration.
            - I mentioned my IDE incase anyone out there also used it and knew if there were any particular steps to easily accomplish my aims.
            - The problem I was having was clearly stated as JBoss complaining that which resource reference I used was "not bound", I then went on to say which ones I'd tried. (Which you may note included the ones in both your queue and code example wiki pages.)
            - Oh dear, I also said env-ref instead of resource-ref. Such typos must be a crime on these forums.

            So, to re-iterate my problem:

            - I have a MDB with a correct entry in the ejb-jar.xml file (exported straight from Sun ONE IDE)
            - This MDB has the JNDI name queue/DocumentUpload
            - I have an entity bean called Document which is trying to look up this MDB, but first it needs a connection factory
            - I have tried several combinations of environment refs and JNDI names, but all result in the same exception, namely that whichever environment entry (strangely, not JNDI name) I use "is not bound".
            - I have used Sun ONE IDE to ensure that the Document EJB has such environment references specified, so they are being set but are apparently wrong.
            - This occurs even though I have followed the JBoss WIKI documentation as regards both configuration and code to use
            - I have not posted the exception as its your standard run-of-the-mill JNDI name not bound exception.
            - I am also using my own JDBC DS which works with other EJBs, so I have no reason to assume this is at fault. This is setup in JBossMQs hsqldb-jdbc2-service.xml. I used this file as it has no DB specific problems, and changing the DS to my own DS didn't produce the previous "reconnecting to JMS provider" problem, as previously mentioned.

            Now, if someone out there has a working MDB with JBoss, I'd love to hear about how you configured it and JBoss' JMS configuration.

            I will happily post output such as JNDIView, my jboss log files etc if it is needed, but I dont want to fill the post with junk. (I note the forum's guide says to keep posts simple.)

            I thank you in advance,

            Adam.


            • 3. Re: Cannot bind to connection factories...
              Steve Lewis Expert

              Are there any lines in the log referring to your MDB? You don't have to post the whole thing, but you should see something like "picking up blah.jar, deploying blah, binding blah to jndi"

              Any exception, even a classpath issue could be keeping you from binding to JNDI.

              • 4. Re: Cannot bind to connection factories...
                Steve Lewis Expert

                Also, you can look in http://server:port/jmx-console, then hit the JNDI link near the top. Scroll down, hit "list" method.

                This will show you everything that is bound to JNDI. Odds are it's not even there yet.

                • 5. Re: Cannot bind to connection factories...
                  Adrian Brock Master

                   

                  "adamfowler" wrote:
                  I find your reply interesting. I commented that the wiki documentation was next to useless (One small comment) and quite a bit of configuration information, and received a rather insulting reply saying I was merely whining. Such professionalism from support staff.


                  Not interested, heard it all before. I'm am using ridicule to try to motivate you
                  into providing useful information. You will find in most free forums your post is
                  ignored because it is unanswerable. I hate that.

                  Help us to help you.


                  I will happily post output such as JNDIView, my jboss log files etc if it is needed, but I dont want to fill the post with junk. (I note the forum's guide says to keep posts simple.)


                  Much better than useless verbage. You have a problem with your
                  configuration - so post it rather than asserting it is correct - it obviously isn't.


                  • 6. Re: Cannot bind to connection factories...
                    adamfowler Newbie

                    Hi all, requested info as below.

                    Please note that it looks weird cos the DocumentUpload MDB has references back to Document, but this is an application oddity - it has to be there for what I'm doing. Its effectively "please finish me later"

                    Hope this helps.

                    Cheers guys,

                    Adam.

                    PS Adrian: q1) Why not just say "Your post doesn't provide enough info. please post your server.log etc."? q2) You're signature has Director of Support for JBoss Inc in it. Did it perhaps occur to you that it as JBoss Inc sells support and documentation that it is in your best interest to firstly be polite on public forums to give your (potential)customers confidence in the company and secondly that it is also in your interests to find out why the free documentation isn't useful in this instance. After all, why would I buy documentation about JBoss if the free documentation is incomplete and doesn't work?

                    Relevant output from server.log:

                    2004-04-19 15:29:56,059 INFO [org.jboss.ejb.EjbModule] Deploying DocumentUpload
                    2004-04-19 15:29:56,460 INFO [org.jboss.resource.connectionmanager.RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=MERCURYDS
                    2004-04-19 15:29:56,460 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=MERCURYDS
                    2004-04-19 15:29:56,470 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.MERCURYDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=MERCURYDS to JNDI name 'java:/MERCURYDS'
                    2004-04-19 15:29:56,470 INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=MERCURYDS
                    2004-04-19 15:29:56,500 INFO [org.jboss.mq.pm.jdbc2.PersistenceManager] Started jboss.mq:service=PersistenceManager
                    2004-04-19 15:29:56,510 INFO [org.jboss.mq.server.jmx.DestinationManager] Started jboss.mq:service=DestinationManager
                    2004-04-19 15:29:56,510 INFO [org.jboss.mq.security.SecurityManager] Started jboss.mq:service=SecurityManager
                    2004-04-19 15:29:56,510 INFO [org.jboss.mq.server.jmx.InterceptorLoader] Started jboss.mq:service=TracingInterceptor
                    2004-04-19 15:29:56,510 INFO [org.jboss.mq.server.jmx.Invoker] Started jboss.mq:service=Invoker
                    2004-04-19 15:29:56,540 INFO [org.jboss.mq.il.http.HTTPServerILService] Started jboss.mq:service=InvocationLayer,type=HTTP
                    2004-04-19 15:29:56,540 INFO [org.jboss.mq.il.jvm.JVMServerILService] Started jboss.mq:service=InvocationLayer,type=JVM
                    2004-04-19 15:29:56,540 INFO [org.jboss.mq.il.oil.OILServerILService] JBossMQ OIL service available at : /0.0.0.0:8090
                    2004-04-19 15:29:56,550 INFO [org.jboss.mq.il.oil.OILServerILService] Started jboss.mq:service=InvocationLayer,type=OIL
                    2004-04-19 15:29:56,550 INFO [org.jboss.mq.il.oil2.OIL2ServerILService] JBossMQ OIL2 service available at : /0.0.0.0:8092
                    2004-04-19 15:29:56,560 INFO [org.jboss.mq.il.oil2.OIL2ServerILService] Started jboss.mq:service=InvocationLayer,type=OIL2
                    2004-04-19 15:29:56,580 INFO [org.jboss.mq.il.rmi.RMIServerILService] Started jboss.mq:service=InvocationLayer,type=RMI
                    2004-04-19 15:29:56,580 INFO [org.jboss.mq.il.uil2.UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
                    2004-04-19 15:29:56,580 INFO [org.jboss.mq.il.uil2.UILServerILService] Started jboss.mq:service=InvocationLayer,type=UIL2
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Queue.DLQ] Bound to JNDI name: queue/DLQ
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Queue.DLQ] Started jboss.mq.destination:service=Queue,name=DLQ
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Topic.testTopic] Bound to JNDI name: topic/testTopic
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Topic.testTopic] Started jboss.mq.destination:service=Topic,name=testTopic
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Topic.securedTopic] Bound to JNDI name: topic/securedTopic
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Topic.securedTopic] Started jboss.mq.destination:service=Topic,name=securedTopic
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Topic.testDurableTopic] Bound to JNDI name: topic/testDurableTopic
                    2004-04-19 15:29:56,590 INFO [org.jboss.mq.server.jmx.Topic.testDurableTopic] Started jboss.mq.destination:service=Topic,name=testDurableTopic
                    2004-04-19 15:29:56,600 INFO [org.jboss.mq.server.jmx.Queue.testQueue] Bound to JNDI name: queue/testQueue
                    2004-04-19 15:29:56,600 INFO [org.jboss.mq.server.jmx.Queue.testQueue] Started jboss.mq.destination:service=Queue,name=testQueue
                    2004-04-19 15:29:56,600 INFO [org.jboss.mq.server.jmx.Queue.DocumentUpload] Bound to JNDI name: queue/DocumentUpload
                    2004-04-19 15:29:56,600 INFO [org.jboss.mq.server.jmx.Queue.DocumentUpload] Started jboss.mq.destination:service=Queue,name=DocumentUpload
                    2004-04-19 15:29:56,610 INFO [org.jboss.mq.server.jmx.Queue.A] Bound to JNDI name: queue/A
                    2004-04-19 15:29:56,610 INFO [org.jboss.mq.server.jmx.Queue.A] Started jboss.mq.destination:service=Queue,name=A
                    2004-04-19 15:29:56,610 INFO [org.jboss.mq.server.jmx.Queue.B] Bound to JNDI name: queue/B
                    2004-04-19 15:29:56,610 INFO [org.jboss.mq.server.jmx.Queue.B] Started jboss.mq.destination:service=Queue,name=B
                    2004-04-19 15:29:56,610 INFO [org.jboss.mq.server.jmx.Queue.C] Bound to JNDI name: queue/C
                    2004-04-19 15:29:56,610 INFO [org.jboss.mq.server.jmx.Queue.C] Started jboss.mq.destination:service=Queue,name=C
                    2004-04-19 15:29:56,620 INFO [org.jboss.mq.server.jmx.Queue.D] Bound to JNDI name: queue/D
                    2004-04-19 15:29:56,620 INFO [org.jboss.mq.server.jmx.Queue.D] Started jboss.mq.destination:service=Queue,name=D
                    2004-04-19 15:29:56,620 INFO [org.jboss.mq.server.jmx.Queue.ex] Bound to JNDI name: queue/ex
                    2004-04-19 15:29:56,620 INFO [org.jboss.mq.server.jmx.Queue.ex] Started jboss.mq.destination:service=Queue,name=ex

                    Relevant output from JNDIView:
                    java:comp namespace of the DocumentUpload bean:

                    +- env (class: org.jnp.interfaces.NamingContext)
                    | +- ejb (class: org.jnp.interfaces.NamingContext)
                    | | +- Document[link -> local/Document] (class: javax.naming.LinkRef)
                    | | +- DocumentObject[link -> local/DocumentObject] (class: javax.naming.LinkRef)


                    java: Namespace

                    +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                    +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                    +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
                    +- MERCURYDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                    +- DefaultJMSProvider (class: org.jboss.jms.jndi.JBossMQProvider)
                    +- comp (class: javax.naming.Context)
                    +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                    +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
                    +- jaas (class: javax.naming.Context)
                    | +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
                    | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
                    | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
                    +- timedCacheFactory (class: javax.naming.Context)
                    Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
                    +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
                    +- Mail (class: javax.mail.Session)
                    +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
                    +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
                    +- TransactionManager (class: org.jboss.tm.TxManager)


                    Global JNDI Namespace

                    +- MercuryLicensingFacade (proxy: $Proxy924 implements interface uk.co.ideagen.mercury.ejb.licensing.facade.MercuryLicensingFacadeHome,interface javax.ejb.Handle)
                    +- jmx (class: org.jnp.interfaces.NamingContext)
                    | +- invoker (class: org.jnp.interfaces.NamingContext)
                    | | +- RMIAdaptor (proxy: $Proxy18 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor)
                    | +- rmi (class: org.jnp.interfaces.NamingContext)
                    | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
                    +- OIL2XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                    +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                    +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                    (Sensitive info)
                    +- UserTransactionSessionFactory (proxy: $Proxy10 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
                    +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                    +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                    +- invokers (class: org.jnp.interfaces.NamingContext)
                    | +- 0.0.0.0 (class: org.jnp.interfaces.NamingContext)
                    | | +- pooled (class: org.jboss.invocation.pooled.interfaces.PooledInvokerProxy)
                    | +- booth (class: org.jnp.interfaces.NamingContext)
                    | | +- jrmp (class: org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy)
                    | | +- http (class: org.jboss.invocation.http.interfaces.HttpInvokerProxy)
                    +- CRQFacade (proxy: $Proxy914 implements interface uk.co.ideagen.mercury.ejb.crq.facade.CRQFacadeHome,interface javax.ejb.Handle)
                    +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
                    +- RMIXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                    +- UILXAConnectionFactory[link -> UIL2XAConnectionFactory] (class: javax.naming.LinkRef)
                    +- UIL2XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
                    +- local (class: org.jnp.interfaces.NamingContext)
                    (Sensitive info)
                    +- topic (class: org.jnp.interfaces.NamingContext)
                    | +- testDurableTopic (class: org.jboss.mq.SpyTopic)
                    | +- testTopic (class: org.jboss.mq.SpyTopic)
                    | +- securedTopic (class: org.jboss.mq.SpyTopic)
                    +- queue (class: org.jnp.interfaces.NamingContext)
                    | +- A (class: org.jboss.mq.SpyQueue)
                    | +- testQueue (class: org.jboss.mq.SpyQueue)
                    | +- ex (class: org.jboss.mq.SpyQueue)
                    | +- DocumentUpload (class: org.jboss.mq.SpyQueue)
                    | +- DLQ (class: org.jboss.mq.SpyQueue)
                    | +- D (class: org.jboss.mq.SpyQueue)
                    | +- C (class: org.jboss.mq.SpyQueue)
                    | +- B (class: org.jboss.mq.SpyQueue)
                    +- console (class: org.jnp.interfaces.NamingContext)
                    | +- PluginManager (proxy: $Proxy19 implements interface org.jboss.console.manager.PluginManagerMBean)
                    +- UIL2ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                    +- UILConnectionFactory[link -> UIL2ConnectionFactory] (class: javax.naming.LinkRef)
                    +- RMIConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                    (Sensitive info)
                    +- OIL2ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
                    +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)

                    • 7. Re: Cannot bind to connection factories...
                      Adrian Brock Master

                       

                      "adamfowler" wrote:

                      PS Adrian: q1) Why not just say "Your post doesn't provide enough info. please post your server.log etc."? q2) You're signature has Director of Support for JBoss Inc in it. Did it perhaps occur to you that it as JBoss Inc sells support and documentation that it is in your best interest to firstly be polite on public forums to give your (potential)customers confidence in the company and secondly that it is also in your interests to find out why the free documentation isn't useful in this instance. After all, why would I buy documentation about JBoss if the free documentation is incomplete and doesn't work?


                      Reminder to self: move this discussion to the "Useless rants" at the bottom of the forums
                      when the problem is solved.

                      Why do you think we offer free support as well as selling it.
                      Answer: Because we are looking few gems were people have real problems
                      rather than most posts which are:
                      1) I can't be bothered doing my own work, please do it for me.
                      2) I can't find the search button so I will post the same old boring question
                      3) I have a problem, IT DOESN'T WORK. I'm not going to tell you what doesn't
                      work - instead we will play 20 questions where I force you through some
                      kind of torturous process to get the information you need to help me
                      4) ME TOO type posts

                      Answers to your questions:
                      q1) That is what I did say (three times when I make my next post).
                      ping/pong/ping/pong...
                      q2) When you have answered thousands questions for free and given your software
                      away for free and written free documentation, you then have the right
                      to come here demanding things - until then just shutup with your useless whining.

                      • 8. Re: Cannot bind to connection factories...
                        Adrian Brock Master

                         

                        "adamfowler" wrote:
                        Hi all, requested info as below.


                        It isn't the information I asked for.


                        Relevant output from JNDIView:
                        java:comp namespace of the DocumentUpload bean:

                        +- env (class: org.jnp.interfaces.NamingContext)
                        | +- ejb (class: org.jnp.interfaces.NamingContext)
                        | | +- Document[link -> local/Document] (class: javax.naming.LinkRef)
                        | | +- DocumentObject[link -> local/DocumentObject] (class: javax.naming.LinkRef)

                        Global JNDI Namespace

                        +- local (class: org.jnp.interfaces.NamingContext)
                        <snip> (Sensitive info)
                        +- topic (class: org.jnp.interfaces.NamingContext)


                        Your ENC has two entries which are linked to entries you don't show.

                        Your initial question was about connection factories,
                        where are your resource-ref definitions from ejb-jar.xml and jboss.xml?

                        TAG your it.