我使用Flex 3.5.0.12683和hudson CI服務器和Ant來編譯我們的項目。在爲這個項目編譯資源包時,我遇到了問題。錯誤:null,同時在Linux下使用hudson編譯資源包
用root用戶的一切編譯成功,但是當我試圖編譯我的Flex項目哈德森(螞蟻),它失敗:
compile_resource:
[mxmlc] Loading configuration file /opt/lib/flex3.5/frameworks/flex-config.xml
[mxmlc] Error: null
[mxmlc]
[mxmlc] java.lang.NullPointerException
[mxmlc] at flex2.tools.CommandLineConfiguration.compilingResourceModule(CommandLineConfiguration.java:70)
[mxmlc] at flex2.tools.CommandLineConfiguration.getTargetFile(CommandLineConfiguration.java:45)
[mxmlc] at flex2.tools.CommandLineConfiguration.validate(CommandLineConfiguration.java:97)
[mxmlc] at flex2.tools.Compiler.processConfiguration(Compiler.java:672)
[mxmlc] at flex2.tools.Compiler.processConfiguration(Compiler.java:526)
[mxmlc] at flex2.tools.Compiler.mxmlc(Compiler.java:84)
[mxmlc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[mxmlc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[mxmlc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[mxmlc] at java.lang.reflect.Method.invoke(Method.java:616)
[mxmlc] at flex.ant.FlexTask.executeInProcess(FlexTask.java:283)
[mxmlc] at flex.ant.FlexTask.execute(FlexTask.java:225)
[mxmlc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[mxmlc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[mxmlc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[mxmlc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[mxmlc] at java.lang.reflect.Method.invoke(Method.java:616)
[mxmlc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[mxmlc] at org.apache.tools.ant.Task.perform(Task.java:348)
[mxmlc] at org.apache.tools.ant.Target.execute(Target.java:390)
[mxmlc] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[mxmlc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
[mxmlc] at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
[mxmlc] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[mxmlc] at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
[mxmlc] at org.apache.tools.ant.Main.runBuild(Main.java:801)
[mxmlc] at org.apache.tools.ant.Main.startAnt(Main.java:218)
[mxmlc] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[mxmlc] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
看起來有一些權限失敗,但我想不出什麼因爲編譯器沒有太多的輸出。
也只是看着CommandLineConfiguration.java文件,發現沒有行: resourceModulePath = I18 nUtils.getGeneratedResourceModule(本).getPath(); 似乎是編譯器無法找到資源存儲在簡單的用戶 – 2010-10-05 11:35:52
所以我猜無論用戶哈德森在運行,它沒有一些權限來訪問所需的路徑。 – 2010-10-07 12:43:44
是的,似乎是這樣。目前通過將hudson添加到具有運行mxmlc和compc權限的sudoers文件來解決此問題。但是,確定這不是真正的解決方案。 – 2010-10-07 14:01:31