gluonhq / client-samples

Client samples to run with Gluon Client plugins for Maven and Gradle
114 stars 23 forks source link

Application does not start due to MenuButton #101

Closed dman-sol closed 4 years ago

dman-sol commented 4 years ago

If there is a MenuButton in the Controller code or sample.fxml, then the application stops running. I use: GraalVM CE 20.3.0-dev-20200729_0201 for Windows; C ++ / CLI support for v142 build tools (14.26); MSVC v142 - VS 2019 C ++ x64 / x86 build tools (v14.26); Windows 10 SDK (10.0.19041.0); com.gluonhq: client-maven-plugin: 0.1.28 (since from 0.1.29 it refuses to build at all, including samples).

jperedadnr commented 4 years ago

You can find the cause of the exception in the target/client/x86_64-windows/gvm/log folder, there are logs for mvn client:run.

Probably you need to add the class to the reflectionList.

About

since from 0.1.29 it refuses to build at all

can you be more specific? What is failing for you?

dman-sol commented 4 years ago

since from 0.1.29 it refuses to build at all

The target folder is not created in this case, so there are no logs.

image

jperedadnr commented 4 years ago

Can you try mvn clean client:compile client:link instead? Did you notice those weird symbols before?

dman-sol commented 4 years ago

Can you try mvn clean client:compile client:link instead?

I will do this a little later.

Did you notice those weird symbols before?

No, I have not seen this before.

dman-sol commented 4 years ago

Can you try mvn clean client:compile client:link instead?

`C:\Users\DMan\IdeaProjects\graal\Calculator>mvn clean client:compile client:link [INFO] Scanning for projects... [INFO] [INFO] ------------------------< org.dman:Calculator >------------------------- [INFO] Building Calculator 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Calculator --- [INFO] [INFO] >>> client-maven-plugin:0.1.29:compile (default-cli) > process-classes @ Calculator >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Calculator --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ Calculator --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 3 source files to C:\Users\DMan\IdeaProjects\graal\Calculator\target\classes [INFO] [INFO] <<< client-maven-plugin:0.1.29:compile (default-cli) < process-classes @ Calculator <<< [INFO] [INFO] [INFO] --- client-maven-plugin:0.1.29:compile (default-cli) @ Calculator --- [ёЁ ш■ы. 29 13:24:08 MSK 2020][INFO] ==================== COMPILE TASK ====================

[ёЁ ш■ы. 29 13:24:09 MSK 2020][INFO] We will now compile your code for x86_64-microsoft-windows. This may take some time. java.io.IOException: Error: C:\Users\DMan\Java\JDK\graalvm-ce-java11-20.3.0-dev\bin\jar doesn't exist at com.gluonhq.substrate.model.ClassPath.getJars(ClassPath.java:143) at com.gluonhq.substrate.config.ConfigResolver.(ConfigResolver.java:79) at com.gluonhq.substrate.target.AbstractTargetConfiguration.getConfigurationFileArgs(AbstractTargetConfiguration.java:475) at com.gluonhq.substrate.target.AbstractTargetConfiguration.compile(AbstractTargetConfiguration.java:145) at com.gluonhq.substrate.SubstrateDispatcher.nativeCompile(SubstrateDispatcher.java:416) at com.gluonhq.NativeCompileMojo.execute(NativeCompileMojo.java:54) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) at org.apache.maven.cli.MavenCli.main(MavenCli.java:193) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.477 s [INFO] Finished at: 2020-07-29T13:24:10+03:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.gluonhq:client-maven-plugin:0.1.29:compile (default-cli) on project Calculator: Error: Error: C:\Users\DMan\Java\JDK\graalvm-ce-java11-20.3.0-dev\bin\jar doesn't exist -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

C:\Users\DMan\IdeaProjects\graal\Calculator>`

jperedadnr commented 4 years ago

Can you check that C:\Users\DMan\Java\JDK\graalvm-ce-java11-20.3.0-dev\bin\jar exists? If the %GRAALVM_HOME% path is correct, it should.

dman-sol commented 4 years ago

Can you check that C:\Users\DMan\Java\JDK\graalvm-ce-java11-20.3.0-dev\bin\jar exists? If the %GRAALVM_HOME% path is correct, it should.

That's right, he's there

jperedadnr commented 4 years ago

Can you run this from the vs 64 bits terminal? %GRAALVM_HOME%\bin\jar --help

dman-sol commented 4 years ago

Can you run this from the vs 64 bits terminal? %GRAALVM_HOME%\bin\jar --help

C:\Users\DMan\IdeaProjects\graal\Calculator>%GRAALVM_HOME%\bin\jar --help
Usage: jar [OPTION...] [ [--release VERSION] [-C dir] files] ...
jar creates an archive for classes and resources, and can manipulate or
restore individual classes or resources from an archive.

 Examples:
 # Create an archive called classes.jar with two class files:
 jar --create --file classes.jar Foo.class Bar.class
 # Create an archive using an existing manifest, with all the files in foo/:
 jar --create --file classes.jar --manifest mymanifest -C foo/ .
 # Create a modular jar archive, where the module descriptor is located in
 # classes/module-info.class:
 jar --create --file foo.jar --main-class com.foo.Main --module-version 1.0
     -C foo/ classes resources
 # Update an existing non-modular jar to a modular jar:
 jar --update --file foo.jar --main-class com.foo.Main --module-version 1.0
     -C foo/ module-info.class
 # Create a multi-release jar, placing some files in the META-INF/versions/9 directory:
 jar --create --file mr.jar -C foo classes --release 9 -C foo9 classes

To shorten or simplify the jar command, you can specify arguments in a separate
text file and pass it to the jar command with the at sign (@) as a prefix.

 Examples:
 # Read additional options and list of class files from the file classes.list
 jar --create --file my.jar @classes.list

 Main operation mode:

  -c, --create               Create the archive
  -i, --generate-index=FILE  Generate index information for the specified jar
                             archives
  -t, --list                 List the table of contents for the archive
  -u, --update               Update an existing jar archive
  -x, --extract              Extract named (or all) files from the archive
  -d, --describe-module      Print the module descriptor, or automatic module name

 Operation modifiers valid in any mode:

  -C DIR                     Change to the specified directory and include the
                             following file
  -f, --file=FILE            The archive file name. When omitted, either stdin or
                             stdout is used based on the operation
      --release VERSION      Places all following files in a versioned directory
                             of the jar (i.e. META-INF/versions/VERSION/)
  -v, --verbose              Generate verbose output on standard output

 Operation modifiers valid only in create and update mode:

  -e, --main-class=CLASSNAME The application entry point for stand-alone
                             applications bundled into a modular, or executable,
                             jar archive
  -m, --manifest=FILE        Include the manifest information from the given
                             manifest file
  -M, --no-manifest          Do not create a manifest file for the entries
      --module-version=VERSION    The module version, when creating a modular
                             jar, or updating a non-modular jar
      --hash-modules=PATTERN Compute and record the hashes of modules
                             matched by the given pattern and that depend upon
                             directly or indirectly on a modular jar being
                             created or a non-modular jar being updated
  -p, --module-path          Location of module dependence for generating
                             the hash

 Operation modifiers valid only in create, update, and generate-index mode:

  -0, --no-compress          Store only; use no ZIP compression

 Other options:

  -?, -h, --help[:compat]    Give this, or optionally the compatibility, help
      --help-extra           Give help on extra options
      --version              Print program version

 An archive is a modular jar if a module descriptor, 'module-info.class', is
 located in the root of the given directories, or the root of the jar archive
 itself. The following operations are only valid when creating a modular jar,
 or updating an existing non-modular jar: '--module-version',
 '--hash-modules', and '--module-path'.

 Mandatory or optional arguments to long options are also mandatory or optional
 for any corresponding short options.
jperedadnr commented 4 years ago

Ok, thanks. I can reproduce the issue

dman-sol commented 4 years ago

Probably you need to add the class to the reflectionList.

Thank. It really helped.

<reflectionList>
       <list>org.dman.Controller</list>
       <list>javafx.scene.control.MenuButton</list>
       <list>javafx.scene.control.MenuItem</list>
</reflectionList>