2 Replies Latest reply: Apr 17, 2012 2:24 AM by varsha g RSS

HornetQ Exception.Could not create session: javax.resource.ResourceException

varsha g Newbie

Hi,

   I need to store  the messages on hard disk rather than in memory so did the following configuration on the jboss7.1.2 under the standalone-full.xml.

 

<address-settings>

                    <address-setting match="#">

                        <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                        <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                        <redelivery-delay>0</redelivery-delay>

                        <max-size-bytes>104857600</max-size-bytes>

                        <page-size-bytes>10485760</page-size-bytes>

                        <address-full-policy>PAGE</address-full-policy>

                        <message-counter-history-day-limit>10</message-counter-history-day-limit>

                    </address-setting>

  </address-settings>

 

   Is there any more configuration needed to write the message on hard disk?

 

 

But when I'm trying to add  100 000 message to Jms Queue After some time, I'm not able to fetch the message from queue. MDB gets down.

Throws The following Exception

 

06:49:15,600 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (http--0.0.0.0-8080-61) Could not create session: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/JmsXA

    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:390)

    at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)

    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)

    at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:837)

    at org.hornetq.ra.HornetQRASessionFactoryImpl.createSession(HornetQRASessionFactoryImpl.java:470)

    at com.ecomm.ultimatesms.messaging.feedback.feedback.processRequest(feedback.java:110) [classes:]

    at com.ecomm.ultimatesms.messaging.feedback.feedback.doGet(feedback.java:37) [classes:]

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.1.Final.jar:1.0.1.Final]

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.1.Final.jar:1.0.1.Final]

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.14.Final.jar:]

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.14.Final.jar:]

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.14.Final.jar:]

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.14.Final.jar:]

    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.2.Final-SNAPSHOT.jar:7.1.2.Final-SNAPSHOT]

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.14.Final.jar:]

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.14.Final.jar:]

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.14.Final.jar:]

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.14.Final.jar:]

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.14.Final.jar:]

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.14.Final.jar:]

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) [jbossweb-7.0.14.Final.jar:]

    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]

Caused by: javax.resource.ResourceException: IJ000658: Unexpected throwable while trying to create a connection: null

    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:371)

    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)

    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)

    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)

    ... 21 more

Caused by: javax.resource.ResourceException: Error during setup

    at org.hornetq.ra.HornetQRAManagedConnection.<init>(HornetQRAManagedConnection.java:152)

    at org.hornetq.ra.HornetQRAManagedConnectionFactory.createManagedConnection(HornetQRAManagedConnectionFactory.java:180)

    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:761)

    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:343)

    ... 24 more

Caused by: javax.resource.ResourceException: Failed to create session factory

    at org.hornetq.ra.HornetQRAManagedConnection.setup(HornetQRAManagedConnection.java:821)

    at org.hornetq.ra.HornetQRAManagedConnection.<init>(HornetQRAManagedConnection.java:141)

    ... 27 more

Caused by: javax.jms.JMSException: Failed to create session factory

    at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)

    at org.hornetq.jms.client.HornetQConnectionFactory.createXAConnection(HornetQConnectionFactory.java:155)

    at org.hornetq.jms.client.HornetQConnectionFactory.createXAConnection(HornetQConnectionFactory.java:150)

    at org.hornetq.ra.HornetQRAManagedConnection.setup(HornetQRAManagedConnection.java:810)

    ... 28 more

Caused by: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

    at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:769)

    at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)

    ... 31 more

 

When i restart the server everythig will work fine.

What exactly am missing in HornetQ configuration?

  • 1. Re: HornetQ Exception.Could not create session: javax.resource.ResourceException
    Andy Taylor Master

    Hi,

       I need to store  the messages on hard disk rather than in memory so did the following configuration on the jboss7.1.2 under the standalone-full.xml.

     

    <address-settings>

                        <address-setting match="#">

                            <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                            <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                            <redelivery-delay>0</redelivery-delay>

                            <max-size-bytes>104857600</max-size-bytes>

                            <page-size-bytes>10485760</page-size-bytes>

                            <address-full-policy>PAGE</address-full-policy>

                            <message-counter-history-day-limit>10</message-counter-history-day-limit>

                        </address-setting>

      </address-settings>

     

       Is there any more configuration needed to wirte the message on hard disk?

    This configuration has no effect on persistence, you need to configure the journal and set persistence-enabled to true. look at the HornetQ user manual.

     

    As for your exception, isnt this the same as your last post? like i said in that post, we would need something we could reproduce.

  • 2. Re: HornetQ Exception.Could not create session: javax.resource.ResourceException
    varsha g Newbie

    Hi,

     

      I checked the persistance-enabled in the standalone-full.xml  :

     

             <subsystem xmlns="urn:jboss:domain:messaging:1.2">

                <hornetq-server>

                    <persistence-enabled>true</persistence-enabled>

                    <journal-file-size>102400</journal-file-size>

                    <journal-min-files>2</journal-min-files>

     

       It is already set to true.

     

    Pleasae let me know if I have to change any other settings.

     

    Thanks.