错误:null,在使用hudson编译Linux下的资源包时

时间:2010-10-05 11:08:17

标签: linux flex ant hudson

我正在使用Flex 3.5.0.12683和hudson CI服务器以及Ant来编译我们的项目。在为这个项目编译资源包时,我遇到了问题。

使用root用户一切都已成功编译但是当我尝试用hudson(ant)编译我的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)

看起来有一些权限失败,但由于编译器没有太多输出,我无法确定是什么和在哪里。

2 个答案:

答案 0 :(得分:2)

因为编译器在编译资源模块时创建目录/ tmp / Adob​​e / Flex / GeneratedResourceModules并在目录下创建临时文件,如果超级用户首先在系统上编译,则其他普通用户无法创建临时文件。为避免这种情况,我在正常用户编译之前执行了以下命令。

  

chmod a + w / tmp / Adob​​e / Flex / GeneratedResourceModules

  

rm -rf / tmp / Adob​​e

答案 1 :(得分:0)

如果您没有超级用户权限,则还可以通过在mxmlc ant任务中设置 java.io.tmpdir 属性来更改编译器放置输出文件的位置:

<java jar="${FLEX_HOME}/lib/mxmlc.jar" failonerror="true" fork="true">
  <jvmarg value="-Djava.io.tmpdir=${MY_OUTPUT_DIR}"/>
  ...