[jboss-user] [JBoss Messaging] - Re: Replacing persistence database - Hibernate to Postgres

anshah1 do-not-reply at jboss.com
Tue Sep 19 19:57:23 EDT 2006


Yeah that document helps. Finally got the replacement working and can see that the tables are created in my postgres db. however there's now a very strange behavior that I have noticed.

I have written a Queue client that listens on myQueue. It's a stand alone java program and here's how I initialize my connection to the queue.

public void initialize() throws Exception {
  | 		// lookup the queue and topic objects
  | 		System.out.println("Starting init");
  | 		Destination queue = (Destination) mCtx.lookup("/queue/myQueue");
  | 		System.out.println("q look up done   " + queue);
  | 		// lookup a connection factory
  | 		ConnectionFactory factory = (ConnectionFactory) mCtx
  | 				.lookup("/ConnectionFactory");
  | 		System.out.println("factory done ");
  | 		// create a connection
  | 		javax.jms.Connection connection = factory.createConnection();
  | 		System.out.println("created connection ");
  | 		// create a  session
  | 		Session session = connection.createSession(true,
  | 				Session.AUTO_ACKNOWLEDGE);
  | 		System.out.println("created session");
  | 		// create a message consumer for the topic
  | 		MessageConsumer subscriber = session.createConsumer(queue);
  | 		System.out.println("created consumer");
  | 		// set this class as message listener for the topic
  | 		subscriber.setMessageListener(this);
  | 		System.out.println("finished init");
  | 		connection.start(); // start connection
  | 	}

You see so many print statements only because I wanted to figure out at what step does it hang..

here's the output for this java program

     [java] You are connecting to server wd55237
  |      [java] Threads available 4
  |      [java] datasource look up done
  |      [java] Starting init
  |      [java] q look up done   JBossQueue[myQueue]
  |      [java] factory done

However it does not get past the createConnection() step. It just hangs there??? Any ideas why?

Here's the classpath that I am running this clss with
C:\Documents and 
  | 	 Settings\d3m293\workspace\NCBIOfflineRetrieval\build\lib\ncbiretrieval.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\blueprint-commons-db-3.8.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\brm-server.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\brm-util.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\jboss-messaging-client.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\seqhound-4.0.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\axis\axis.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\axis\commons-discovery-0.2.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\axis\commons-logging.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\axis\jaxrpc.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\axis\saaj.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\lib\axis\wsdl4j-1.5.1.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\activation.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\antlr-2.7.5H3.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\asm-attrs.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\asm.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\autonumber-plugin.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\axis.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\bcel.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\bindingservice-plugin.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\blueprint-commons-db-3.8.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\bsf.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\bsh-1.3.0.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\bsh-deployer.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\cglib-2.1_2jboss.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\commons-collections.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\commons-httpclient.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\commons-logging.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\ejb3-persistence.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\hibernate-annotations.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\hibernate-entitymanager.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\hibernate3.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\hsqldb-plugin.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\hsqldb.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\javax.servlet.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\javax.servlet.jsp.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-common-jdbc-wrapper.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-hibernate.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-j2ee.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-jaxrpc.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-jca.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-jsr77.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-jsr88.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-management.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-monitoring.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-remoting.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-saaj.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss-transaction.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jboss.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jbosssx.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jmx-adaptor-plugin.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jnpserver.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jpl-pattern.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\jpl-util.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\log4j.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\mail-plugin.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\mail.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\msbase.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\mssqlserver.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\msutil.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\mysql-connector-java-5.0-nightly-20060131-bin.
  | 	 jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\pg74jdbc3.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\properties-plugin.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\scheduler-plugin-example.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\scheduler-plugin.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\seqhound-4.0.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\snmp-support.jar
  | 	-C:\jboss-4.0.3SP1\server\messaging\lib\xmlentitymgr.jar
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\etc\jndi.properties
  | 	-C:\Documents and Settings\d3m293\workspace\NCBIOfflineRetrieval\build\lib
  | 

Any idea why this is happening? This was working before with the hypersonic database default configuration and suddenly now it just seems to hang while creating a connection. 

Thanks,
Anuj


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972783#3972783

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972783



More information about the jboss-user mailing list