Possible solution for 'Error logged from Ant UI' [message #802412] |
Sun, 19 February 2012 18:37  |
Eclipse User |
|
|
|
I was attempting to run an Ant build configuration with no environment variables and I kept getting the following error:
!ENTRY org.eclipse.ant.launching 4 120 2012-02-19 17:36:57.314
!MESSAGE Error logged from Ant UI:
!STACK 0
java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(Unknown Source)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:89)
The only environment variable in my Ant build configuration was the ANT_HOME variable and it was set to the Ant plugin directory in Eclipse.
If I switched to 'Append environment to native environment', my build configuration ran successfully. However, when I ran with 'Replace native environment with specified environment' and only the ANT_HOME variable set, the error above would be written to the eclipse log and the configuration would terminate with nothing written to the console.
In my searching for an answer to this issue, I found that many other people also hit this issue and there were several different suggestions, some of them worked for some people but not for everyone. All those suggestions did not work for me so I decided to experiment with the environmental variables.
I added all the environment variables available via the 'Select...' button and it worked fine. So, then I whittled down the list until I found that I needed only one other environment variable for the configuration to run successfully and that variable was the 'SystemRoot' variable.
So, I thought I would post this topic in case this solution helps others. I'm not sure why it works for me but it did. If anyone has any thoughts on why this worked, please reply to this message with the answer.
As for my system specs:
HP Pavilion dv7 laptop
Windows 64-bit system
Eclipse Helios 3.6.1 (64-bit)
I hope this helps
Chris
|
|
|
Re: Possible solution for 'Error logged from Ant UI' [message #825347 is a reply to message #802412] |
Tue, 20 March 2012 14:52  |
Eclipse User |
|
|
|
We had the same issue trying to connect to an Oracle database running via an Eclipse Java Application configuration (Run As) on several machines. On one machine, setting SystemRoot resolves the problem (Env mode = replace + explicit setting or Env mode = append and pull from the system environment). The other machine fails, regardless.
I've also been able to duplicate this outside of Eclipse, running in Ant.
<java classname="com.myclass.EtlStart"
fork="true"
newenvironment="true">
will trigger the problem. Setting newenvironment = false resolves the issue (likely b/c SystemRoot is then defined).
I'm fairly sure the error text originates from the Oracle driver ("Io exception: The Network Adapter could not establish the connection")
Putting our experiences together, I'd say this suggests some underlying network code is dependent on this environment setting, and therefore likely limited to Windows some/all platforms.
Anyway, here is what such a stack trace looks like:
EtlStart.java:145 is calling BasicDataSource.getConnection().
13:27:17 ERROR (EtlStart.java:257) - Exception in EtlStart.main(): Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection)
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io exception: The Network Adapter could not establish the connection)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.myclass.etl.main.EtlStart.main(EtlStart.java:145)
Caused by: java.sql.SQLException: Io exception: 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.driver.OracleConnection.<init>(OracleConnection.java:418)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
... 2 more
WinXP 32-bit
Oracle Java 1.6.0_30
Both Eclipse 3.3.2 & 3.7
Oracle server 11.2.0.2.0
Oracle jdbc driver 10.2.0.1.0
|
|
|
Powered by
FUDForum. Page generated in 0.10279 seconds