在 Java 中调用 Flex 编译器 mxmlc 导致 64 位 JVM 崩溃 (dcpr.dll)
我有一个可以将 SVG 文件转换为 swf 文件的 Web 应用程序。 为此,需要执行 3 个步骤: 1 - 运行文件夹中的 SVG 文件
for (final File file : tFiles) {
final String fileName = file.getName();
final int nbEr = flashEngine.convert(fileName);
if (nbEr > 0) {
LOG.error("Error with SVG file : " + fileName);
}
file.delete();
}
2 - 将每个 SVG 转换为 .AS 临时文件并在其中添加信息
public final int convert(final String svgName) {
// *****************
// DIVERS TREATMENTS
// *****************
final int nbError = computeSwf(svgName);
// ******************
// DIVERS TREATMENTS
// ******************
return nbError;
}
3 - 通过 Mxmlc 编译器将 .as 转换为 .swf
private int computeSwf(final String svgName) {
final String[] argscompiler = new String[5];
argscompiler[0] = "+flexlib";
argscompiler[1] = [flex framework path : /flex/frameworks];
argscompiler[2] = [temporary .as file path];
argscompiler[3] = "-output"; // output folder path
argscompiler[4] = [output file name thanks to svgName];
flex2.tools.Compiler.mxmlc(argscompiler);
return ThreadLocalToolkit.errorCount();
}
大多数时候,一切正常。 但是,在某些情况下,整个 JVM 会在没有警告的情况下崩溃。
我在 mxmlc 编译器周围添加了日志,调用:
try {
LOG.info("mxmlc compiler calling");
flex2.tools.Compiler.mxmlc(argscompiler);
LOG.info("mxmlc compilation finished");
} catch (final Throwable e) {
LOG.fatal(e, e);
}
在我的日志中,它向我显示对于很多文件,编译是有效的。 但在“mxmlc 编译器调用”行之后,JVM 崩溃了。
所以,问题来自于flex编译器。
经过一些测试,我获得了“JVM崩溃报告”:
<?xml version="1.0" encoding="UTF-16"?>
<WERReportMetadata>
<OSVersionInformation>
<WindowsNTVersion>6.1</WindowsNTVersion>
<Build>7600 </Build>
<Product>(0x30): Windows 7 Professional</Product>
<Edition>Professional</Edition>
<BuildString>7600.16539.amd64fre.win7_gdr.100226-1909</BuildString>
<Revision>1</Revision>
<Flavor>Multiprocessor Free</Flavor>
<Architecture>X64</Architecture>
<LCID>1036</LCID>
</OSVersionInformation>
<ParentProcessInformation>
<ParentProcessId>2052</ParentProcessId>
<ParentProcessPath>C:\Java\jre6\bin\javaw.exe</ParentProcessPath>
<ParentProcessCmdLine>C:\Java\jre6\bin\javaw.exe -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:59809 -Dcatalina.base=C:\Workspaces\Eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 -Dcatalina.home=C:\Tomcat55 -Dwtp.deploy=C:\Workspaces\Eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps -Djava.endorsed.dirs=C:\Tomcat55\common\endorsed -Xms512M -Xmx1024M -XX:MaxPermSize=256m -Dfile.encoding=UTF-8 -classpath C:\Workspaces\Eclipse\[MY PROJECT]\webcontent\WEB-INF\lib\wsdl4j-1.5.1.jar;C:\Tomcat55\bin\bootstrap.jar org.apache.catalina.startup.Bootstrap start</ParentProcessCmdLine>
</ParentProcessInformation>
<ProblemSignatures>
<EventType>APPCRASH</EventType>
<Parameter0>java.exe</Parameter0>
<Parameter1>6.0.200.2</Parameter1>
<Parameter2>4bc39549</Parameter2>
<Parameter3>dcpr.dll</Parameter3>
<Parameter4>6.0.200.2</Parameter4>
<Parameter5>4bc3ace7</Parameter5>
<Parameter6>c00000fd</Parameter6>
<Parameter7>000000000000dacc</Parameter7>
</ProblemSignatures>
<DynamicSignatures>
<Parameter1>6.1.7600.2.0.0.256.48</Parameter1>
<Parameter2>1036</Parameter2>
<Parameter22>dfc4</Parameter22>
<Parameter23>dfc49eb22582397c699a9ef43341068a</Parameter23>
<Parameter24>7fc1</Parameter24>
<Parameter25>7fc14f899de80bb4d59ec0501e30665b</Parameter25>
</DynamicSignatures>
<SystemInformation>
<MID>961D9682-D49E-4725-9224-B2748025A619</MID>
<SystemManufacturer>Dell Inc.</SystemManufacturer>
<SystemProductName>OptiPlex 780</SystemProductName>
<BIOSVersion>A03</BIOSVersion>
</SystemInformation>
</WERReportMetadata>
如您所见,似乎dcpr.dll(Sun Java dll)崩溃了。 我已经遇到过这样的问题,但是通过从 jdk 1.5 升级到 1.6 解决了这个问题。 看来这不是一个真正的解决方案:s
信息: Java版本:JDK 1.6.0.20 64位 Flex 版本:flex_sdk_3.5.0.12683
我不使用“Full JDK”,即带有 [flex]/bin/jvm.config 文件的版本。
所以,这是我的问题: - 我可以简单地添加一个 jvm.config 文件(或另一个文件)来设置 mxmlc 编译器吗? - 我必须使用 32 位 jdk 吗? (好像有关于flex和64位jdk的问题) - 是否有其他编译器可以转换为 swf ?
I have a web application that converts SVG files into swf ones.
In order to do so, there are 3 steps :
1 - Running through SVG Files in a folder
for (final File file : tFiles) {
final String fileName = file.getName();
final int nbEr = flashEngine.convert(fileName);
if (nbEr > 0) {
LOG.error("Error with SVG file : " + fileName);
}
file.delete();
}
2 - Converting each SVG in a .AS temporary file and adding info in it
public final int convert(final String svgName) {
// *****************
// DIVERS TREATMENTS
// *****************
final int nbError = computeSwf(svgName);
// ******************
// DIVERS TREATMENTS
// ******************
return nbError;
}
3 - Converting th .as into .swf thanks to Mxmlc compiler
private int computeSwf(final String svgName) {
final String[] argscompiler = new String[5];
argscompiler[0] = "+flexlib";
argscompiler[1] = [flex framework path : /flex/frameworks];
argscompiler[2] = [temporary .as file path];
argscompiler[3] = "-output"; // output folder path
argscompiler[4] = [output file name thanks to svgName];
flex2.tools.Compiler.mxmlc(argscompiler);
return ThreadLocalToolkit.errorCount();
}
Most of the time, everything works fine.
But, in some cases, the entire JVM crashes without warning.
I added logs around the mxmlc compiler calling :
try {
LOG.info("mxmlc compiler calling");
flex2.tools.Compiler.mxmlc(argscompiler);
LOG.info("mxmlc compilation finished");
} catch (final Throwable e) {
LOG.fatal(e, e);
}
In my logs, it shows me that for lots of files, the compilation works.
But the JVM crashes, after a "mxmlc compiler calling" line.
So, the issues comes from the flex compiler.
After some tests, I obtained a "JVM Crash report" :
<?xml version="1.0" encoding="UTF-16"?>
<WERReportMetadata>
<OSVersionInformation>
<WindowsNTVersion>6.1</WindowsNTVersion>
<Build>7600 </Build>
<Product>(0x30): Windows 7 Professional</Product>
<Edition>Professional</Edition>
<BuildString>7600.16539.amd64fre.win7_gdr.100226-1909</BuildString>
<Revision>1</Revision>
<Flavor>Multiprocessor Free</Flavor>
<Architecture>X64</Architecture>
<LCID>1036</LCID>
</OSVersionInformation>
<ParentProcessInformation>
<ParentProcessId>2052</ParentProcessId>
<ParentProcessPath>C:\Java\jre6\bin\javaw.exe</ParentProcessPath>
<ParentProcessCmdLine>C:\Java\jre6\bin\javaw.exe -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:59809 -Dcatalina.base=C:\Workspaces\Eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 -Dcatalina.home=C:\Tomcat55 -Dwtp.deploy=C:\Workspaces\Eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps -Djava.endorsed.dirs=C:\Tomcat55\common\endorsed -Xms512M -Xmx1024M -XX:MaxPermSize=256m -Dfile.encoding=UTF-8 -classpath C:\Workspaces\Eclipse\[MY PROJECT]\webcontent\WEB-INF\lib\wsdl4j-1.5.1.jar;C:\Tomcat55\bin\bootstrap.jar org.apache.catalina.startup.Bootstrap start</ParentProcessCmdLine>
</ParentProcessInformation>
<ProblemSignatures>
<EventType>APPCRASH</EventType>
<Parameter0>java.exe</Parameter0>
<Parameter1>6.0.200.2</Parameter1>
<Parameter2>4bc39549</Parameter2>
<Parameter3>dcpr.dll</Parameter3>
<Parameter4>6.0.200.2</Parameter4>
<Parameter5>4bc3ace7</Parameter5>
<Parameter6>c00000fd</Parameter6>
<Parameter7>000000000000dacc</Parameter7>
</ProblemSignatures>
<DynamicSignatures>
<Parameter1>6.1.7600.2.0.0.256.48</Parameter1>
<Parameter2>1036</Parameter2>
<Parameter22>dfc4</Parameter22>
<Parameter23>dfc49eb22582397c699a9ef43341068a</Parameter23>
<Parameter24>7fc1</Parameter24>
<Parameter25>7fc14f899de80bb4d59ec0501e30665b</Parameter25>
</DynamicSignatures>
<SystemInformation>
<MID>961D9682-D49E-4725-9224-B2748025A619</MID>
<SystemManufacturer>Dell Inc.</SystemManufacturer>
<SystemProductName>OptiPlex 780</SystemProductName>
<BIOSVersion>A03</BIOSVersion>
</SystemInformation>
</WERReportMetadata>
As you can see, it seems that the dcpr.dll (Sun Java dll) crashes.
I already had a issue like this one, but it was resolved by going from jdk 1.5 to 1.6.
It seems that this is not a real solution :s
Info :
Java version : JDK 1.6.0.20 64 bits
Flex version : flex_sdk_3.5.0.12683
I do not use the "Full JDK", the one with the [flex]/bin/jvm.config file.
So, here are my questions :
- can I simply add a jvm.config file (or another one), to set the mxmlc compiler up ?
- do I have to use a 32 bits jdk ? (it seems that there are issues concerning flex and 64 bits jdk)
- are there other compiler to convert as to swf ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
两者都可以按照 jvm.config 中的注释进行工作:
either will work as the comments in the jvm.config states :
mxmlc 编译器需要 32 位 JVM。
为了解决类似问题,我所做的就是下载最新的 32 位版本的 jdk,并更改 jvm.config 文件以指向该 jdk。
从flex sdk bin目录中的jvm.config:
The mxmlc compiler requires a 32-bit JVM.
What I did to get around a similar issue was download the latest 32-bit version of the jdk, and change the jvm.config file to point to that jdk.
From the jvm.config in the flex sdk bin directory: