osx - Ant socket task not working on mac -
i got following on build.xml
<target name="check-port" description="check whether tomcat running"> <condition property="tomcat.running"> <socket server="localhost" port="8080"/> </condition> </target>
it stopped working mac, on windows works fine, on mac shows true when got nothing running on localhost:8080.
i'm not sure why happening or why working on windows. used work on mac...
i'm testing on osx yosemite version 10.10.2
what related to? how can fix it?
the first thing emulate behaviour of ant
condition code compiling , running following code:
import java.net.socket; import java.io.ioexception; public class test { public static void main(string args[]) { try { socket socket = new socket("localhost", 8080); } catch (ioexception e) { system.out.println("down"); system.exit(0); } system.out.println("up"); } }
if that outputs up
when tomcat not running have fundamental disagreement between java
, lsof
in terms of constitutes "upness", , 1 needs investigated.
one way see if there is there try connect it, such with:
telnet localhost 8080
if connects, i'd try lsof
see process has got but, state, appears not work. may different tool like:
netstat -na | grep ':8080 '
would trick.
if outputs down
have different issue, either problem within ant
or possibly build process starting server (or different server). also require further investigation you'll @ least have narrowed problem down.
one thing might try run java code within build process itself, see thinks @ same time ant
telling server there.
Comments
Post a Comment