tags:

views:

21

answers:

1

Hi,

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 ?

+1  A: 

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:

# If no java.home is specified a VM is located by looking in these places in this
# order:
#
#  1) JAVA_HOME environment variables (same rules as java.home above)
#  2) bin directory for java.dll (windows) or lib/<ARCH>/libjava.so (unix)
#  3) ../jre 
#  4) registry (windows only)
#
java.home=C:/apps_x86/Java/jdk1.6.0_21/
Rydell
Thank you. I forgot to write the solution. I did what you mention a few weeks ago. It solved my problem.
Wilhelm Peraud
Do we have to point a JDK or can I just use a JRE ? are there some known issues when the web application is hosted on a Win 64 bits OS, on Tomcat 6.0.29 64 bits ? Could you also please tell me how to get the stacktrace ? I set to true the "verbose stack trace", but I don't get anything. Thank
Wilhelm Peraud