CSUG / HouseMD

HouseMD is an awesome diagnosing tool better than BTrace
http://csug.github.io/HouseMD/
Apache License 2.0
700 stars 218 forks source link

windows支持 #45

Closed leafgray closed 12 years ago

leafgray commented 12 years ago

issue #37的处理,windows支持. 1.agentJarFile取值通过File.getCanonicalPath转换避免平台间的差异. 2.errorlog的路径由/tmp修改为logs.当执行的当前目录创建日志目录. 3.添加了bat执行脚本.

不过,目前还没有能够进入console. java version "1.6.0_21" Java(TM) SE Runtime Environment (build 1.6.0_21-b07) Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode) 以下是截取了一段jstack,看上去是两边通信的流读取没有结束. Telephone.scala 47跟源码有点没对上. 2012-06-16 15:54:25 Full thread dump Java HotSpot(TM) 64-Bit Server VM (17.0-b17 mixed mode):

"NonBlockingInputStreamThread" daemon prio=6 tid=0x000000002c4cc000 nid=0xb3c in Object.wait() [0x00000000373af000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method)

"HouseMD-Duck" daemon prio=6 tid=0x000000002c4cb000 nid=0x19b4 runnable [0x000000003718f000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.net.SocketInputStream.read(SocketInputStream.java:182) at jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:167)

zhongl commented 12 years ago

初步判断问题可能出在jline2windowsconsole支持不太好. 因我在windows下尝试运行了jline2Example, 得到如下异常:

java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
    at org.fusesource.jansi.internal.WindowsSupport.setConsoleMode(WindowsSupport.java:60)
    at jline.WindowsTerminal.setConsoleMode(WindowsTerminal.java:181)
    at jline.WindowsTerminal.restore(WindowsTerminal.java:93)
    at jline.TerminalSupport$1.run(TerminalSupport.java:49)
    at jline.internal.ShutdownHooks.runTasks(ShutdownHooks.java:66)
    at jline.internal.ShutdownHooks.access$000(ShutdownHooks.java:22)
    at jline.internal.ShutdownHooks$1.run(ShutdownHooks.java:47)

你提交的合并, 我将另开一个分支, 并将master回滚至稳定版本, 如果你有新的进展, 请再向我发起pull request, 谢谢!

leafgray commented 12 years ago

这一说,确实是这个问题. -Djline.terminal=jline.UnsupportedTerminal 加上这个项执行程序就可以得到console了.可以开始体验了.... 嘿嘿.

回头我了解一下jline再看看.Kernel32,很可能是64bit的支持不完善.

zhongl commented 12 years ago

厉害了, 等你好消息!

leafgray commented 12 years ago

嗯,经历了一个工作上的调动.再回过头来看.... 汗.

还没确认具体的问题,修改了一下bat文件,可以运行体验先了.console看上去是涉及到另外一个yascli工作的,目前还是scala小白...

zhongl commented 12 years ago

yascli 只是对jline2的封装, 若是找到了jline的问题所在, 只需要在Shell.scala中对ConsoleReader相关的代码作调整就好了。