Configuring posgreSQL experiencing connection timeout
blaisepascal May 29, 2003 5:29 PMI have been trying to set up a single entity bean on a JBoss 3.2.0 Tomcat server connecting to a postgreSQL using the pg73jdbc3.jar driver package. I started with a whole app but since I ran into the problems described below I'm attempting a single bean as a test. I am simply trying to get anything going.
The JBoss server is running on WinNT4 SP5 and the DB is running on RH Linux 8.0.
Everything seems to go fine when starting the server but when I drop the bean jar file in the deploy directory I get the series of errors below.
I'm trying to do this with two DataSources. I've not done anything with the Hypersonic setup since it is used by JMS and is local. But the postgres DB is remote so I've set up another DataSource for it I'm calling SecondaryDS. The entity bean is to use the postgres DB.
I tried repeatedly to get this working with the remote DB and couldn't get any further. So I also set up a postgres DB on the local system but got exactly the same error.
Does anyone know what the problem is here? Is it wrong to try to have two datasources? If so, why? I'd rather allow JMS to use a local DB reasonable since this is a very Message intensive app. What else could be the problem?
Any help would be appreciated.
Thanks,
Aaron
Below is the error trace and what I think are the relevant config segments.
17:13:19,992 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.0_tomcat-4.1.24/server/default/deploy/BSII.jar
17:14:05,318 WARN [NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.DeploymentException is assignable from: class org.jboss.deployment.DeploymentException
17:14:05,328 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@e5619079{ url=file:/C:/jboss-3.2.0_tomcat-4.1.24/server/default/deploy/BSII.jar, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: exception in init of file:/C:/jboss-3.2.0_tomcat-4.1.24/server/default/deploy/BSII.jar; - nested throwable: (org.jboss.deployment.DeploymentException: Connection timed out: connect; - nested throwable: (java.net.ConnectException: Connection timed out: connect))
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:720)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:637)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:280)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)
Caused by: org.jboss.deployment.DeploymentException: Connection timed out: connect; - nested throwable: (java.net.ConnectException: Connection timed out: connect)
at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:271)
at org.jboss.ejb.EJBDeployer.init(EJBDeployer.java:391)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:694)
... 14 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:386)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:602)
at sun.net.www.http.HttpClient.(HttpClient.java:303)
at sun.net.www.http.HttpClient.(HttpClient.java:264)
at sun.net.www.http.HttpClient.New(HttpClient.java:336)
at sun.net.www.http.HttpClient.New(HttpClient.java:317)
at sun.net.www.http.HttpClient.New(HttpClient.java:312)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:481)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:472)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:574)
at java.net.URL.openStream(URL.java:960)
at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:740)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:700)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:258)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:811)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:221)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:248)
... 16 more
standardjbosscmp-jdbc.xml
...
java:/SecondaryDS
<datasource-mapping>PostgreSQL 7.2</datasource-mapping>
<create-table>true</create-table>
<remove-table>false</remove-table>
<read-only>false</read-only>
...
--------------
login-config.xml
...
<application-policy name = "PostgresDBRealm">
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">xxx</module-option>
<module-option name = "userName">xxx</module-option>
<module-option name = "password">yyy</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=SecondaryDS</module-option>
</login-module>
</application-policy>
...
--------------
postgres-ds.xml
...
<local-tx-datasource>
<jndi-name>SecondaryDS</jndi-name>
<connection-url>jdbc:postgresql://myHostname/myDBName</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>xxx</user-name>
yyy
</local-tx-datasource>
...