--- In [email protected], "Avi Flax" <[EMAIL PROTECTED]> wrote:
>
> 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 [email protected], "Dave Wolf" <gatorj24@> 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: dave.wolf@
> > Office: 866-CYNERGY
> >
> > --- In [email protected], "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
SPONSORED LINKS
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

