Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Installation - Starting a new project

    Hi,
    I'm new with SmartGWT and I need to understand how it works because we have the ams of a system based on it.

    I'm installing a project following this: https://smartclient.com/smartgwt/jav...enSupport.html.

    The project is based on archetype: archetype-smartgwt-quickstart.

    Following the README.md inside the project the steps are these:
    ### Eclipse

    1. Import the generated project using the "Existing Maven Projects" wizard (File/Import/Maven/Existing Maven Projects)

    2. Ensure that the imported project's client module takes the GWT Facet (Project Properties / Project Facets / GWT is checked)

    3. Package the parent project, causing the SmartGWT runtime to be unpacked to the server (Provide "package" to the 'goals' prompt at Run / Run As / Maven Build). A refresh of the server project's 'target' folder may be necessary.

    _Note that this won't be strictly necessary if you've already tested the project using Command Line Tools, but you'll need to repeat this step following any 'mvn clean' execution._

    4. Add the SmartGWT runtime to the server project's 'Deployment Assembly' (Project Properties / Deployment Assembly).

    **Source**: /target/my-application-server-1.0-SNAPSHOT/myapplication
    **Deploy Path**: myapplication

    5. If necessary, create or edit a Tomcat server with a JNDI configuration similar to those found at src/etc/tomcat/context.xml. Servers/[YOUR SERVER]/context.xml or Servers/[YOUR SERVER]/server.xml (added to the context node)

    6. Add the application to the server and launch it.

    7. Wait for each process to indicate that it's ready, and then load the app in your browser at the URL reported by Eclipse. <http://localhost:8080/my-application-server/index.jsp>



    I'm facing issue at the 3rd point where after "Maven Build..." the project with goals=package the following errors arise in the eclipse console:
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Build Order:
    [INFO]
    [INFO] my-application [pom]
    [INFO] my-application-client [gwt-app]
    [INFO] my-application-server [war]
    [INFO]
    [INFO] ---------------------< com.example:my-application >---------------------
    [INFO] Building my-application 1.0-SNAPSHOT [1/3]
    [INFO] --------------------------------[ pom ]---------------------------------
    [INFO]
    [INFO] -----------------< com.example:my-application-client >------------------
    [INFO] Building my-application-client 1.0-SNAPSHOT [2/3]
    [INFO] ------------------------------[ gwt-app ]-------------------------------
    [INFO]
    [INFO] --- gwt-maven-plugin:1.0.0:enforce-encoding (default-enforce-encoding) @ my-application-client ---
    [INFO]
    [INFO] --- gwt-maven-plugin:1.0.0:add-super-sources (default-add-super-sources) @ my-application-client ---
    [INFO]
    [INFO] --- gwt-maven-plugin:1.0.0:add-test-super-sources (default-add-test-super-sources) @ my-application-client ---
    [INFO]
    [INFO] --- gwt-maven-plugin:1.0.0:generate-module (default-generate-module) @ my-application-client ---
    [INFO]
    [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ my-application-client ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Using 'UTF-8' encoding to copy filtered properties files.
    [INFO] skip non existing resourceDirectory E:\DATI\Macro\Java\my-application\my-application-client\src\main\resources
    [INFO] skip non existing resourceDirectory E:\DATI\Macro\Java\my-application\my-application-client\src\main\super
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ my-application-client ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 1 source file to E:\DATI\Macro\Java\my-application\my-application-client\target\classes
    [INFO]
    [INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ my-application-client ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Using 'UTF-8' encoding to copy filtered properties files.
    [INFO] skip non existing resourceDirectory E:\DATI\Macro\Java\my-application\my-application-client\src\test\resources
    [INFO] skip non existing resourceDirectory E:\DATI\Macro\Java\my-application\my-application-client\src\test\super
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ my-application-client ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- gwt-maven-plugin:1.0.0:test (default-test) @ my-application-client ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- gwt-maven-plugin:1.0.0:compile (default-compile) @ my-application-client ---
    [INFO] Compiling module com.example.myapplication.MyApplication
    [INFO] Compiling 5 permutations
    [INFO] Compiling permutation 0...
    [INFO] Compiling permutation 1...
    [INFO] Compiling permutation 2...
    [INFO] Compiling permutation 3...
    [INFO] Compiling permutation 4...
    [INFO] Compile of permutations succeeded
    [INFO] Compilation succeeded -- 134,688s
    [INFO] Linking into E:\DATI\Macro\Java\my-application\my-application-client\target\my-application-client-1.0-SNAPSHOT\myapp
    [INFO] Link succeeded
    [INFO] Linking succeeded -- 327,460s
    [INFO]
    [INFO] --- gwt-maven-plugin:1.0.0:package-app (default-package-app) @ my-application-client ---
    [INFO] Building war: E:\DATI\Macro\Java\my-application\my-application-client\target\my-application-client-1.0-SNAPSHOT.war
    [INFO]
    [INFO] -----------------< com.example:my-application-server >------------------
    [INFO] Building my-application-server 1.0-SNAPSHOT [3/3]
    [INFO] --------------------------------[ war ]---------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-application-server ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 2 resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ my-application-server ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 1 source file to E:\DATI\Macro\Java\my-application\my-application-server\target\classes
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ my-application-server ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory E:\DATI\Macro\Java\my-application\my-application-server\src\test\resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ my-application-server ---
    [INFO] No sources to compile
    [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ my-application-server ---
    [INFO] No tests to run.
    [INFO]
    [INFO] --- maven-war-plugin:2.2:war (default-war) @ my-application-server ---
    [WARNING] Error injecting: org.apache.maven.plugin.war.WarMojo
    com.google.inject.ProvisionException: Unable to provision, see the following errors:

    1) Error injecting constructor, java.lang.ExceptionInInitializerError: Cannot access defaults field of Properties
    at org.apache.maven.plugin.war.WarMojo.<init>(Unknown Source)
    while locating org.apache.maven.plugin.war.WarMojo

    1 error
    at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:226)
    at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1053)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1086)
    at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:85)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:66)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:112)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:127)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1050)
    at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:520)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:124)
    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:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    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)
    Caused by: java.lang.ExceptionInInitializerError: Cannot access defaults field of Properties
    at com.thoughtworks.xstream.converters.collections.PropertiesConverter.<clinit>(PropertiesConverter.java:46)
    at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:647)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:445)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:385)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:342)
    at org.apache.maven.plugin.war.util.WebappStructureSerializer.<clinit>(WebappStructureSerializer.java:47)
    at org.apache.maven.plugin.war.AbstractWarMojo.<init>(AbstractWarMojo.java:316)
    at org.apache.maven.plugin.war.WarMojo.<init>(WarMojo.java:49)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at com.google.inject.internal.DefaultConstructionProxyFactory$ReflectiveProxy.newInstance(DefaultConstructionProxyFactory.java:126)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
    at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
    at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:112)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:127)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
    at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1050)
    ... 39 more
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary for my-application 1.0-SNAPSHOT:
    [INFO]
    [INFO] my-application ..................................... SUCCESS [ 0.003 s]
    [INFO] my-application-client .............................. SUCCESS [09:00 min]
    [INFO] my-application-server .............................. FAILURE [ 7.096 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 09:08 min
    [INFO] Finished at: 2022-10-29T11:08:16+02:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project my-application-server: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties
    [ERROR] -----------------------------------------------------
    [ERROR] realm = plugin>org.apache.maven.plugins:maven-war-plugin:2.2
    [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
    [ERROR] urls[0] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/apache/maven/plugins/maven-war-plugin/2.2/maven-war-plugin-2.2.jar
    [ERROR] urls[1] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
    [ERROR] urls[2] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
    [ERROR] urls[3] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
    [ERROR] urls[4] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
    [ERROR] urls[5] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
    [ERROR] urls[6] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar
    [ERROR] urls[7] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar
    [ERROR] urls[8] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
    [ERROR] urls[9] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
    [ERROR] urls[10] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar
    [ERROR] urls[11] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
    [ERROR] urls[12] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
    [ERROR] urls[13] = file:/C:/Users/GSQUICCIMARRO/.m2/repository/org/apache/maven/shared/maven-filtering/1.0-beta-2/maven-filtering-1.0-beta-2.jar
    [ERROR] Number of foreign imports: 1
    [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
    [ERROR]
    [ERROR] -----------------------------------------------------
    [ERROR] -> [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/d...ainerException
    [ERROR]
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR] mvn <args> -rf :my-application-server




    Seems that there is a problem with the plugin. Indeed, the pom of server project has error as you can see from the screenshot below:



    Click image for larger version  Name:	Cattura.JPG Views:	0 Size:	159.0 KB ID:	268950

    May you please help?

    Thanks.

    #2
    You haven't provided version numbers, but it looks like you're using a newer version of Java (as stated in the README, the archetype was build with 1.8 in mind) and the older Maven WAR plugin. We'll update the archetype's plugin dependencies in the near-term, but in the meantime you should be able to resolve this on your own by configuring the war plugin explicitly:

    Code:
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId
        <version>3.3.2</version>
    </plugin>

    Comment


      #3
      It works. Thanks.

      Comment


        #4
        Hi,

        now I'm testing project based on archetype-smartgwt-quickstart-relogin but I'm still facing always the same issue: "Cannot access defaults field of Properties".

        I've added these two plugins to the server's pom.xml but the problem is still there:

        Code:
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.3.2</version>
        </plugin>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
        <source>17</source>
        <target>17</target>
        </configuration>
        </plugin>
        What's the problem now?

        Comment


          #5
          My mistake. I've added the plugins in the profile tag instead of the build tag. Now it works.

          Comment

          Working...
          X