Dave, thanks for your help! What you said makes sense, but
unfortunately I'm still having trouble with it.

Here's my ColdFusion code:

<cfscript>
      MXMLc = URLClassLoader.LoadJarClass("C:\Program Files\Adobe\Flex
Framework 2\lib\mxmlc.jar", "flex2.tools.Compiler");

      Args = '-flexlib "C:\Program Files\Adobe\Flex Framework
2\frameworks\" "C:\inetpub\builder\mxml\test1.mxml";

      MXMLc.main(JavaCast("String", Args));
</cfscript>

I *think* this follows what you suggested. When I try to run this, I
get the following error message:

"The selected method main was not found."

"Either there are no methods with the specified method name and
argument types, or the method main is overloaded with arguments types
that ColdFusion can't decipher reliably. If this is a Java object and
you verified that the method exists, you may need to use the javacast
function to reduce ambiguity."

So... any more tips?

BTW I do know that I'm initializing the class properly; if I pass
MXMLc to the CFDUMP tag, I see the following:

object of flex2.tools.Compiler
Methods:
      main (returns void)
      hashCode (returns int)
      getClass (returns java.lang.Class)
      wait (returns void)
      wait (returns void)
      wait (returns void)
      equals (returns boolean)
      notify (returns void)
      notifyAll (returns void)
      toString (returns java.lang.String)
FILE_SPECS:
      file-specs

Thanks!
Avi

--- In flexcoders@yahoogroups.com, "Dave Wolf" <[EMAIL PROTECTED]> wrote:
>
> In any Java JAR there can be a main-class which is the class called
> when no classname is specified.  That main-class will also have a
> main() method which si the default entry point of the class.  That
> method has the following signature
>
> public static void main(String[] args);
>
> Where the String[] are the command line arguments.
>
> Call the main() method passing in whatever command line arguments
> there would be as the String[].
>
> --
> Dave Wolf
> Cynergy Systems, Inc.
> Macromedia Flex Alliance Partner
> http://www.cynergysystems.com
>
> Email:  [EMAIL PROTECTED]
> Office: 866-CYNERGY
>
> --- In flexcoders@yahoogroups.com, "Avi Flax" <avif@> wrote:
> >
> > I'd like to invoke the Flex2b2 compiler from ColdFusion using the Java
> > class, if possible.
> >
> > I looked at the file MANIFEST.MF in mxmlc.jar, and saw:
> >
> > Main-Class: flex2.tools.Compiler
> >
> > So, I tried this in CF:
> >
> > Application.com.MXMLc =
> > Application.com.URLClassLoader.LoadJarClass(CompilerPath,
> > "flex2.tools.Compiler");
> >
> > That works, and I can CFDUMP the object to see a list of its methods
> > and properties, but:
> >
> > - I can't set the property FILE_SPECS: I get an
> > java.lang.IllegalAccessException with the message: "field is final"
> >
> > - I can't invoke the "compile" method. My code is:
> > Application.com.MXMLc.compile(JavaCast("String", MxmlPath));
> > I get the CF message "The selected method compile was not found."
> >
> > Can anyone shed some light on this? Is it documented anywhere?
> >
> > I apologize if this is silly; I'm expert with CFML but not experienced
> > with Java interaction.
> >
> > I did try to just use CFEXECUTE at first, with mxmlc.exe, but had
> > trouble with it. I've always found CFEXECUTE frustrating, so I thought
> > I'd give this approach a try.
> >
> > Thanks!
> > Avi Flax
> > Flex Newbie
> > Arc90, New York
> > http://www.arc90.com/
> >
>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to