debug属性可以在ant脚本的JAVAC标记中将值设置为“on”

时间:2015-08-20 12:21:23

标签: java debugging ant

我有点困惑。有人可以帮助解决以下问题吗

我正在编写一个ant脚本,它将编译java代码并部署文件。请注意,在javac标签中我添加了一个属性 debug =“on”。根据文档,调试的leagle值为 true或false (不是开启和关闭)。

据我所知,debug会将Java代码链接回行号,源代码中的变量名称以及源本身的名称(使用debuglevel属性)。

出于问题,我添加了debug =“on”并且认为我将在堆栈交易中收到“未知来源”而不是行号,而是我收到带有行号的正确堆栈跟踪。

Questin:我对调试属性的理解是不正确的。如果是的话,你能帮帮我吗?

下面粘贴的是已编辑的堆栈交易。我对debug = true和debug = on都是一样的。

> javax.naming.CommunicationException: Failed to connect to server
> localhost:1099 [Root exception is
> javax.naming.ServiceUnavailableException: Failed to connect to server
> localhost:1099 [Root exception is java.net.ConnectException:
> Connection refused: connect]]     at
> org.jnp.interfaces.NamingContext.getServer(NamingContext.java:216)    at
> org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1116)    at
> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:478)   at
> org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)   at
> javax.naming.InitialContext.lookup(InitialContext.java:392)   at
> com.XXXXX.products.fi.mbs.server.someclass2.<init>(someclass2.java:85)
>   at
> com.XXXXX.products.eurorepo.server.someclass1.<init>(someclass1.java:21)
>   at
> com.XXXXX.products.eurorepo.server.boot.someclass3.registerFactories(someclass3.java:136)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>   at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>   at java.lang.reflect.Method.invoke(Method.java:597)     at
> com.XXXXX.products.common.someclass4.callMethod(someclass4.java:154)
>   at
> com.XXXXX.products.server.someclass5.callMethod(someclass5.java:118)
>   at
> com.XXXXX.products.common.someclass4.callMethod(someclass4.java:141)
>   at
> com.XXXXX.products.server.someclass5.registerFactories(someclass5.java:48)
>   at com.XXXXX.cs.yyy.yyyServer.init(yyyServer.java:292)  at
> com.XXXXX.cs.yyy.yyyServer.<init>(yyyServer.java:135)     at
> com.XXXXX.cs.yyy.yyyServer.bootyyyServer(yyyServer.java:494)  at
> com.XXXXX.cs.yyy.yyyServer.main(yyyServer.java:691)   at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>   at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>   at java.lang.reflect.Method.invoke(Method.java:597)     at
> com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: javax.naming.ServiceUnavailableException: Failed to connect
> to server localhost:1099 [Root exception is java.net.ConnectException:
> Connection refused: connect]  at
> org.jnp.interfaces.NamingContext.getServer(NamingContext.java:191)
>   ... 24 more Caused by: java.net.ConnectException: Connection refused:
> connect   at java.net.PlainSocketImpl.socketConnect(Native Method)    at
> java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)  at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
>   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)   at
> java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)    at
> java.net.Socket.connect(Socket.java:529)  at
> java.net.Socket.connect(Socket.java:478)  at
> java.net.Socket.<init>(Socket.java:375)   at
> java.net.Socket.<init>(Socket.java:276)   at
> org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
>   at
> org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
>   at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:187)

1 个答案:

答案 0 :(得分:1)

好的,感谢stackoverflowthis中的帖子,我找到了答案。是的,ON / OFF可以与true / false互换。