Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 54603 invoked from network); 13 Sep 2006 08:40:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Sep 2006 08:40:01 -0000 Received: (qmail 4508 invoked by uid 500); 13 Sep 2006 08:40:00 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 4477 invoked by uid 500); 13 Sep 2006 08:40:00 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 4460 invoked by uid 99); 13 Sep 2006 08:40:00 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2006 01:40:00 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=lists@nabble.com; spf=pass X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: pass (idunn.apache.osuosl.org: domain nabble.com designates 72.21.53.35 as permitted sender) Received: from ([72.21.53.35:48761] helo=talk.nabble.com) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 05/D0-08607-9E3C7054 for ; Wed, 13 Sep 2006 01:40:11 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GNQHf-0002mv-8z for activemq-users@geronimo.apache.org; Wed, 13 Sep 2006 01:39:51 -0700 Message-ID: <6281322.post@talk.nabble.com> Date: Wed, 13 Sep 2006 01:39:51 -0700 (PDT) From: petera To: activemq-users@geronimo.apache.org Subject: Re: Postgres persistence in Tomcat In-Reply-To: <6262661.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: peter.anderson@egsgroup.com References: <6167044.post@talk.nabble.com> <44FF2BF6.8060200@exist.com> <6186145.post@talk.nabble.com> <6243677.post@talk.nabble.com> <6247570.post@talk.nabble.com> <6262661.post@talk.nabble.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N James, The problem goes away if I keep the connection open during my Tomcat session. Is this advisable ? Should I use connection pooling with ActiveMQ connections ? Peter petera wrote: > > > James, > > Sorry I spoke to soon. I am using a web app to produce and consume > messages. I can produce the messages or consume the messages in separate > Tomcat sessions but when > I try to to both in the same session I get the following error message: > > javax.jms.JMSException: Could not connect to broker URL: > vm://localhost?brokerConfig=xbean:activemq.xml. Reason: > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'org.apache.activemq.store.PersistenceAdapterFactoryBean' > defined in class path resource [activemq.xml]: Can't resolve reference to > bean 'postgres-ds' while setting property 'dataSource'; nested exception > is org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'postgres-ds' defined in class path resource > [activemq.xml]: Error setting property values; nested exception is > org.springframework.beans.PropertyAccessExceptionsException: > PropertyAccessExceptionsException (1 errors); nested > propertyAccessExceptions are: > [org.springframework.beans.MethodInvocationException: Property > 'dataSourceName' threw exception; nested exception is > java.lang.IllegalArgumentException: DataSource with name 'postgres' > already exists!] > > FULL log of ActiveMQ interaction creating and attempting to consume simple > text messages: > > Sep 12, 2006 10:25:18 AM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource [activemq.xml] > Sep 12, 2006 10:25:18 AM > org.springframework.context.support.AbstractRefreshableApplicationContext > refreshBeanFactory > INFO: Bean factory for application context > [org.apache.xbean.spring.context.ClassPathXmlApplicationContext;hashCode=16710868]: > org.springframework.beans.factory.support.DefaultListableBeanFactory > defining beans > [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer,org.apache.activemq.xbean.XBeanBrokerService,postgres-ds]; > root of BeanFactory hierarchy > Sep 12, 2006 10:25:19 AM > org.springframework.context.support.AbstractApplicationContext refresh > INFO: 3 beans defined in application context > [org.apache.xbean.spring.context.ClassPathXmlApplicationContext;hashCode=16710868] > Sep 12, 2006 10:25:19 AM org.springframework.core.CollectionFactory > > INFO: JDK 1.4+ collections available > Sep 12, 2006 10:25:19 AM > org.springframework.context.support.AbstractApplicationContext > initMessageSource > INFO: Unable to locate MessageSource with name 'messageSource': using > default > [org.springframework.context.support.DelegatingMessageSource@42c516] > Sep 12, 2006 10:25:19 AM > org.springframework.context.support.AbstractApplicationContext > initApplicationEventMulticaster > INFO: Unable to locate ApplicationEventMulticaster with name > 'applicationEventMulticaster': using default > [org.springframework.context.event.SimpleApplicationEventMulticaster@16b6cd] > Sep 12, 2006 10:25:19 AM > org.springframework.beans.factory.support.DefaultListableBeanFactory > preInstantiateSingletons > INFO: Pre-instantiating singletons in factory > [org.springframework.beans.factory.support.DefaultListableBeanFactory > defining beans > [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer,org.apache.activemq.xbean.XBeanBrokerService,postgres-ds]; > root of BeanFactory hierarchy] > Sep 12, 2006 10:25:19 AM org.apache.activemq.broker.BrokerService > getBroker > INFO: ActiveMQ 4.0.1 JMS Message Broker (localhost) is starting > Sep 12, 2006 10:25:19 AM org.apache.activemq.broker.BrokerService > getBroker > INFO: For help or more information please see: > http://incubator.apache.org/activemq/ > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.jdbc.JDBCPersistenceAdapter createAdapter > INFO: Database driver recognized: [postgresql_native_driver] > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter doCreateTables > WARNING: Could not create JDBC tables; they could already exist. Failure > was: CREATE TABLE ACTIVEMQ_MSGS(ID INTEGER NOT NULL, CONTAINER > VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ INTEGER, EXPIRATION > BIGINT, MSG BYTEA, PRIMARY KEY ( ID ) ) Message: ERROR: relation > "activemq_msgs" already exists > SQLState: 42P07 Vendor code: 0 > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter doCreateTables > WARNING: Could not create JDBC tables; they could already exist. Failure > was: CREATE INDEX ACTIVEMQ_MSGS_MIDX ON ACTIVEMQ_MSGS > (MSGID_PROD,MSGID_SEQ) Message: ERROR: current transaction is aborted, > commands ignored until end of transaction block > SQLState: 25P02 Vendor code: 0 > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter doCreateTables > WARNING: Could not create JDBC tables; they could already exist. Failure > was: CREATE INDEX ACTIVEMQ_MSGS_CIDX ON ACTIVEMQ_MSGS (CONTAINER) Message: > ERROR: current transaction is aborted, commands ignored until end of > transaction block > SQLState: 25P02 Vendor code: 0 > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter doCreateTables > WARNING: Could not create JDBC tables; they could already exist. Failure > was: CREATE INDEX ACTIVEMQ_MSGS_EIDX ON ACTIVEMQ_MSGS (EXPIRATION) > Message: ERROR: current transaction is aborted, commands ignored until end > of transaction block > SQLState: 25P02 Vendor code: 0 > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter doCreateTables > WARNING: Could not create JDBC tables; they could already exist. Failure > was: CREATE TABLE ACTIVEMQ_ACKS(CONTAINER VARCHAR(250) NOT NULL, CLIENT_ID > VARCHAR(250) NOT NULL, SUB_NAME VARCHAR(250) NOT NULL, SELECTOR > VARCHAR(250), LAST_ACKED_ID INTEGER, PRIMARY KEY ( CONTAINER, CLIENT_ID, > SUB_NAME)) Message: ERROR: current transaction is aborted, commands > ignored until end of transaction block > SQLState: 25P02 Vendor code: 0 > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.journal.JournalPersistenceAdapter recover > INFO: Journal Recovery Started from: Active Journal: using 5 x 20.0 Megs > at: /Volumes/RAID/apache-tomcat-5.5.17/activemq-data/journal > Sep 12, 2006 10:25:19 AM > org.apache.activemq.store.journal.JournalPersistenceAdapter recover > INFO: Journal Recovered: 1 message(s) in transactions recovered. > Sep 12, 2006 10:25:20 AM > org.apache.activemq.transport.TransportServerThreadSupport doStart > INFO: Listening for connections at: > tcp://EGS-COM-42-Peter-Anderson.local:61616 > Sep 12, 2006 10:25:20 AM > org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent > start > WARNING: brokerName not set > Sep 12, 2006 10:25:20 AM org.apache.activemq.broker.TransportConnector > start > INFO: Connector default Started > Sep 12, 2006 10:25:20 AM > org.apache.activemq.transport.TransportServerThreadSupport doStart > INFO: Listening for connections at: > tcp://EGS-COM-42-Peter-Anderson.local:61613?wireFormat=stomp > Sep 12, 2006 10:25:20 AM org.apache.activemq.broker.TransportConnector > start > INFO: Connector stomp Started > Sep 12, 2006 10:25:20 AM org.apache.activemq.network.NetworkConnector > doStart > INFO: Network Connector default Started > Sep 12, 2006 10:25:20 AM org.apache.activemq.broker.BrokerService start > INFO: ActiveMQ JMS Message Broker (localhost, > ID:EGS-COM-42-Peter-Anderson.local-50379-1158053119113-1:0) started > Sep 12, 2006 10:25:20 AM > org.apache.activemq.transport.vm.VMTransportFactory bind > INFO: binding to broker: localhost > Sep 12, 2006 10:25:20 AM org.apache.activemq.broker.TransportConnector > start > INFO: Connector vm://localhost Started > Sep 12, 2006 10:25:20 AM > org.apache.activemq.transport.vm.VMTransportFactory stopped > INFO: Shutting down VM connectors for broker: localhost > Sep 12, 2006 10:25:20 AM > org.apache.activemq.transport.vm.VMTransportFactory stopped > INFO: Shutting down VM connectors for broker: localhost > Sep 12, 2006 10:25:20 AM org.apache.activemq.broker.TransportConnector > stop > INFO: Connector vm://localhost Stopped > Sep 12, 2006 10:25:20 AM org.apache.activemq.broker.BrokerService stop > INFO: ActiveMQ Message Broker (localhost, > ID:EGS-COM-42-Peter-Anderson.local-50379-1158053119113-1:0) is shutting > down > Sep 12, 2006 10:25:20 AM org.apache.activemq.network.NetworkConnector > doStop > INFO: Network Connector default Stopped > Sep 12, 2006 10:25:20 AM > org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent > run > SEVERE: failed to process packet: java.net.SocketException: Socket closed > Sep 12, 2006 10:25:22 AM org.apache.activemq.broker.TransportConnector > stop > INFO: Connector default Stopped > Sep 12, 2006 10:25:22 AM org.apache.activemq.broker.TransportConnector > stop > INFO: Connector stomp Stopped > Sep 12, 2006 10:25:22 AM > org.apache.activemq.transport.vm.VMTransportFactory stopped > INFO: Shutting down VM connectors for broker: localhost > Sep 12, 2006 10:25:22 AM org.apache.activemq.broker.BrokerService stop > INFO: ActiveMQ JMS Message Broker (localhost, > ID:EGS-COM-42-Peter-Anderson.local-50379-1158053119113-1:0) stopped > Sep 12, 2006 10:27:36 AM > org.springframework.beans.factory.xml.XmlBeanDefinitionReader > loadBeanDefinitions > INFO: Loading XML bean definitions from class path resource [activemq.xml] > Sep 12, 2006 10:27:36 AM > org.springframework.context.support.AbstractRefreshableApplicationContext > refreshBeanFactory > INFO: Bean factory for application context > [org.apache.xbean.spring.context.ClassPathXmlApplicationContext;hashCode=5223444]: > org.springframework.beans.factory.support.DefaultListableBeanFactory > defining beans > [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer,org.apache.activemq.xbean.XBeanBrokerService,postgres-ds]; > root of BeanFactory hierarchy > Sep 12, 2006 10:27:36 AM > org.springframework.context.support.AbstractApplicationContext refresh > INFO: 3 beans defined in application context > [org.apache.xbean.spring.context.ClassPathXmlApplicationContext;hashCode=5223444] > Sep 12, 2006 10:27:36 AM > org.springframework.context.support.AbstractApplicationContext > initMessageSource > INFO: Unable to locate MessageSource with name 'messageSource': using > default > [org.springframework.context.support.DelegatingMessageSource@847705] > Sep 12, 2006 10:27:36 AM > org.springframework.context.support.AbstractApplicationContext > initApplicationEventMulticaster > INFO: Unable to locate ApplicationEventMulticaster with name > 'applicationEventMulticaster': using default > [org.springframework.context.event.SimpleApplicationEventMulticaster@a1f659] > Sep 12, 2006 10:27:36 AM > org.springframework.beans.factory.support.DefaultListableBeanFactory > preInstantiateSingletons > INFO: Pre-instantiating singletons in factory > [org.springframework.beans.factory.support.DefaultListableBeanFactory > defining beans > [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer,org.apache.activemq.xbean.XBeanBrokerService,postgres-ds]; > root of BeanFactory hierarchy] > Sep 12, 2006 10:27:36 AM > org.springframework.beans.factory.support.AbstractBeanFactory > destroySingletons > INFO: Destroying singletons in factory > {org.springframework.beans.factory.support.DefaultListableBeanFactory > defining beans > [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer,org.apache.activemq.xbean.XBeanBrokerService,postgres-ds]; > root of BeanFactory hierarchy} > javax.jms.JMSException: Could not connect to broker URL: > vm://localhost?brokerConfig=xbean:activemq.xml. Reason: > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'org.apache.activemq.store.PersistenceAdapterFactoryBean' > defined in class path resource [activemq.xml]: Can't resolve reference to > bean 'postgres-ds' while setting property 'dataSource'; nested exception > is org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'postgres-ds' defined in class path resource > [activemq.xml]: Error setting property values; nested exception is > org.springframework.beans.PropertyAccessExceptionsException: > PropertyAccessExceptionsException (1 errors); nested > propertyAccessExceptions are: > [org.springframework.beans.MethodInvocationException: Property > 'dataSourceName' threw exception; nested exception is > java.lang.IllegalArgumentException: DataSource with name 'postgres' > already exists!] > > > > > > > James.Strachan wrote: >> >> On 9/11/06, petera wrote: >>> >>> James, >>> >>> Now loaded the bean-spring jar file I am getting further ut now >>> receiving >>> error message: >>> >>> >Could not connect to broker URL: >>> vm://localhost?brokerConfig=xbean:activemq.xml. Reason: >>> org.springframework.beans.factory.BeanDefinitionStoreException: Error >>> registering bean with >name 'postgres-ds' defined in class path resource >>> [activemq.xml]: Bean class [org.postgresql.ds.PGPoolingDataSource] not >>> found; nested exception is java.lang.ClassNotFoundException: >>> >org.postgresql.ds.PGPoolingDataSource >>> >>> I have the Postgres 8.1.4 jdbc jar loaded in commons/lib >> >> The answer is that last bit of log... >> >> exception is java.lang.ClassNotFoundException: >>>org.postgresql.ds.PGPoolingDataSource >> >> So you need to find a jar with that class and add it to your classpath >> -- >> >> James >> ------- >> http://radio.weblogs.com/0112098/ >> >> > > -- View this message in context: http://www.nabble.com/Postgres-persistence-in-Tomcat-tf2225497.html#a6281322 Sent from the ActiveMQ - User forum at Nabble.com.