activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leandro Augusto de Almeida" <leandro.augusto.alme...@gmail.com>
Subject ActiveMQ 4.1.1 - Queue - Oracle 9.2 - Network Adapter could not establish the connection
Date Wed, 31 Oct 2007 16:46:14 GMT
Hi all,

I am testing the ActiveMQ version 4.1.1 with persistence store
configured for Oracle 9.2.0.6.
The test is a simple loop for sending 10.000 messages to one queue.
I didn't use journal. The messages are stored directly to Oracle database.

Below the message error is the configuration used.

I am getting this error:

Exceção de E/S: The Network Adapter could not establish the connection
	at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:46)
	at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1181)
	at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1551)
	at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:465)
	at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:356)
	at br.com.ebiz.sender.Sender.send(Sender.java:59)
	at br.com.ebiz.sender.Sender.main(Sender.java:26)
Caused by: java.io.IOException: Exceção de E/S: The Network Adapter
could not establish the connection
	at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:43)
	at org.apache.activemq.store.jdbc.TransactionContext.getConnection(TransactionContext.java:62)
	at org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doAddMessage(DefaultJDBCAdapter.java:165)
	at org.apache.activemq.store.jdbc.JDBCMessageStore.addMessage(JDBCMessageStore.java:69)
	at org.apache.activemq.store.memory.MemoryTransactionStore.addMessage(MemoryTransactionStore.java:224)
	at org.apache.activemq.store.memory.MemoryTransactionStore$1.addMessage(MemoryTransactionStore.java:117)
	at org.apache.activemq.broker.region.Queue.sendMessage(Queue.java:333)
	at org.apache.activemq.broker.region.Queue.send(Queue.java:326)
	at org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:292)
	at org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:382)
	at org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:193)
	at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:126)
	at org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:98)
	at org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:136)
	at org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:498)
	at org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:604)
	at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:294)
	at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185)
	at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:133)
	at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
	at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
	at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:137)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Exceção de E/S: The Network Adapter
could not establish the connection
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
	at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
	at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353)
	at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
	at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
	at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:169)
	at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:105)
	at org.apache.activemq.store.jdbc.TransactionContext.getConnection(TransactionContext.java:55)
	... 22 more

Configuration:

The adapter parameter i put later, but didn´t make effect.

    <persistenceAdapter>
      <jdbcPersistenceAdapter dataDirectory="./activemq-data"
dataSource="#meu-oracle-ds" adapter="#oracle-adapter"/>
    </persistenceAdapter>

    <transportConnectors>
       <transportConnector name="tcp" uri="tcp://localhost:61616"/>
    </transportConnectors>

  <bean id="oracle-adapter"
class="org.apache.activemq.store.jdbc.adapter.OracleJDBCAdapter">
    <property name="batchStatments" value="true"/>
  </bean>

  <bean id="meu-oracle-ds" class="oracle.jdbc.pool.OracleDataSource"
destroy-method="close">
    <property name="URL" value="jdbc:oracle:thin:@IP:1521:SID"/>
    <property name="user" value="USER****"/>
    <property name="password" value="******"/>
  </bean>

I tried with DBCP too. But got the same error

  <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@222222:1521:xxxx"/>
    <property name="username" value="****"/>
    <property name="password" value="****"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>

the code:

			Context jndiContext =
ContextHelperFactory.createContextHelper().getMQContext();

			ConnectionFactory connectionFactory =
(ConnectionFactory)jndiContext.lookup("MyQueueConnectionFactory");

			Connection connection = connectionFactory.createConnection();

			Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

			Destination destination = (Destination)jndiContext.lookup("INBOX");

			MessageProducer producer = session.createProducer(destination);

			producer.setDeliveryMode(DeliveryMode.PERSISTENT);

			for (int i=0; i<qtdMessages; i++) {
				TextMessage jmsMessage = session.createTextMessage();
				jmsMessage.setText("xxxx " + i);

				producer.send(jmsMessage);
				if (i%100 == 0) {
					System.out.print(".");
				}
			}

			producer.close();

			session.close();

			connection.close();


I changed the mq broker to other version (5.0-20071025.034820-35), but
with no success.

I read a message in this list about this error; but no reply with
solution. (thread: Re: Oracle XE) (date: Wed, 05 Jul 2006 13:53:25
GMT).

Mime
View raw message