Wednesday, November 13, 2024

Re: GWT 2.12.0 with net.ltgt.gwt.maven gwt maven plugin: [ERROR] Unable to find 'com/medhok/mm/OEV.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

Best way to troubleshoot: run Maven with debug logs (mvn -X … ; better redirect them to a file as they're very verbose) then look for the lines that start with "Classpath:" and "Arguments:" and examine them closely (please notice that arguments aren't quoted, so if there's an empty-string argument it won't be visible, among other details about quoting). If you notice anything wrong then check your Maven configuration, it's either there or a bug in the plugin. If things look OK then it might be a bug in GWT itself.
In this specific case, it's probably a problem with your project setup, and looking at it from a different point of view (those lower-level logs) might help.
See https://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideCompilerOptions for the GWT compiler arguments.

On Wednesday, November 13, 2024 at 3:08:12 AM UTC+1 venkat...@gmail.com wrote:

Thanks for your response.  With old Mojo's plugin it's working fine with same folder structure.  

The package is com.med.mm it's typo.  Yes as you mentioned src as source directory and resources are under src/main/resources.

So I tried to use same folder structure with new gwt-maven-plugin, that's where I am getting the issue. However I tried to move all packages from src to src/main/java folder still same issue occurred.


On Tuesday, November 12, 2024 at 3:57:57 PM UTC-5 Colin Alworth wrote:
I suspect at least one typo in your last email, but it is hard to be sure, but as written, what you have should not work. The correct module is com.med.mm.OEV, since the packages are com.med.mm, not com.medhok.mm. However, your old gwt-maven-plugin was also using that package, so it doesn't make sense how that used to work either. Can you confirm what the pom (and proj structure) looked like before you started making these changes and the build was passing consistently?

Note that you might have some confusion with locations of resources, since you have src/ as your source directory, but you have src/main/resources (which is inside src/) as your resources. After this issue is resolved, consider changing to the standard maven layout of src/main/java and src/main/resources.


On Tuesday, November 12, 2024 at 2:35:42 PM UTC-6 venkat...@gmail.com wrote:

Here are the my project folder structure:
MedicalMgmt:
   src
        com.med.mm
               OEV.gwt.xml
               MedicalMgmt.gwt.xml
        com.med.mm.client
        com.med.mm.server
        com.med.mm.shared
   src/main/resources
   webapp
   pom.xml

The plugin entry in pom as follows:

<build>

<sourceDirectory>src</sourceDirectory>

<!-- Generate compiled stuff in the folder used for developing mode -->

<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>


<plugins>

<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>buildnumber-maven-plugin</artifactId>

<version>1.4</version>

<executions>

<execution>

<phase>validate</phase>

<goals>

<goal>create</goal>

</goals>

</execution>

</executions>

<configuration>

<doCheck>false</doCheck>

<getRevisionOnlyOnce>true</getRevisionOnlyOnce>

<shortRevisionLength>8</shortRevisionLength>

<scmBranchPropertyName>scmBranch</scmBranchPropertyName>

</configuration>

</plugin>


<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-scm-plugin</artifactId>

<version>1.12.0</version>

<configuration>

<providerImplementations>

<git>jgit</git>

</providerImplementations>

</configuration>

<dependencies>

<dependency>

<groupId>org.apache.maven.scm</groupId>

<artifactId>maven-scm-provider-jgit</artifactId>

<version>1.12.0</version>

</dependency>

</dependencies>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<configuration>

<fork>false</fork>

<debug>false</debug>

<debuglevel>lines,vars,source</debuglevel>

</configuration>

</plugin>


<!-- GWT Maven Plugin -->

<plugin>

<groupId>net.ltgt.gwt.maven</groupId>

<artifactId>gwt-maven-plugin</artifactId>

<version>1.1.0</version>

<executions>

<execution>

<goals>

<goal>compile</goal>

</goals>

</execution>

</executions>

<configuration>

<skipModule>true</skipModule>

<moduleName>com.medhok.mm.OEV</moduleName>

<moduleShortName>MedicalMgmt</moduleShortName>

<failOnError>true</failOnError>

<!-- GWT compiler 2.8 and above requires 1.8, hence define sourceLevel here if you use

a different source language for java compilation -->

<sourceLevel>1.8</sourceLevel>

<!-- Compiler configuration -->

<compilerArgs>

<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->

<arg>-compileReport</arg>

<arg>-XcompilerMetrics</arg>

</compilerArgs>

<jvmArgs>

<jvmArg> -Xmx7G </jvmArg>

<jvmArg> -XX:+UseG1GC </jvmArg>

<jvmArg> -Dgwt.user.agent=${gwt.compile.user.agent} </jvmArg>

</jvmArgs>

<!-- DevMode configuration -->

<warDir>${webappDirectory}</warDir>

<classpathScope>compile+runtime</classpathScope>

<!-- URL(s) that should be opened by DevMode (gwt:devmode). -->

<startupUrls>

<startupUrl>index.html</startupUrl>

</startupUrls>

</configuration>

</plugin>

<!--<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>gwt-maven-plugin</artifactId>

<version>${gwtMavenPluginVersion}</version>

<dependencies>

<dependency>

<groupId>org.gwtproject</groupId>

<artifactId>gwt-user</artifactId>

<version>${gwtVersion}</version>

</dependency>

<dependency>

<groupId>org.gwtproject</groupId>

<artifactId>gwt-dev</artifactId>

<version>${gwtVersion}</version>

</dependency>

</dependencies>

<executions>

<execution>

<goals>

<goal>compile-report</goal>

<goal>compile</goal>

<goal>test</goal>

<goal>i18n</goal>

<goal>generateAsync</goal>

</goals>

</execution>

</executions>

Plugin configuration. There are many available options, see gwt-maven-plugin

documentation at codehaus.org

<configuration>

<modules>

<module>com.medhok.mm.MedicalMgmt</module>

<module>com.medhok.mm.OEV</module>

</modules>


<runTarget>index.html</runTarget>

<hostedWebapp>${webappDirectory}</hostedWebapp>

<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>

<i18nMessagesBundle>com.medhok.mm.client.Messages</i18nMessagesBundle>

<extraJvmArgs>-Xmx1496m -XX:MaxPermSize=256m</extraJvmArgs>

-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl

MedicalMgmt.html -logLevel INFO -port 8888 -war "C:\Users\Pavel Vassiliev\test-workspace\MedicalMgmt\target\medical-mgmt-1.0-SNAPSHOT"

-codeServerPort 9997

extraJvmArgs>-Xmx4G -XX:MaxPermSize=512m -XX:+UseG1GC -Dgwt.compiler.localWorkers=3

-Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs

<extraJvmArgs>-Xmx7G -XX:+UseG1GC -Dgwt.user.agent=${gwt.compile.user.agent}</extraJvmArgs>


</configuration>

</plugin>-->


<!-- Copy static web files before executing gwt:run -->

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-war-plugin</artifactId>

<version>3.2.0</version>


<executions>

<execution>

<phase>compile</phase>

<goals>

<goal>exploded</goal>

</goals>

</execution>

</executions>

<!-- -->

<configuration>

<packagingExcludes>images/client/</packagingExcludes>

<webappDirectory>${webappDirectory}</webappDirectory>

<webResources>

<webResource>

<directory>webapp</directory>

</webResource>

</webResources>

<archive>

<manifest>

<addDefaultImplementationEntries>true</addDefaultImplementationEntries>

</manifest>

<manifestEntries>

<Implementation-Build>${buildNumber}</Implementation-Build>

<Implementation-Branch>${scmBranch}</Implementation-Branch>

<SCM-Branch>${scmBranch}</SCM-Branch>

<Jenkins-Build-Number>${BUILD_NUMBER}</Jenkins-Build-Number>

<Jenkins-Build-Url>${BUILD_URL}</Jenkins-Build-Url>

<Jenkins-Git-Commit>${GIT_COMMIT}</Jenkins-Git-Commit>

<Jenkins-Build-Time>${BUILD_TIMESTAMP}</Jenkins-Build-Time>

<Build-Time>${maven.build.timestamp}</Build-Time>

<Build-Host>${agent.name}</Build-Host>

<Build-User>${user.name}</Build-User>

<Build-Maven>Maven ${maven.version}</Build-Maven>

<Build-Java>${java.version}</Build-Java>

<Build-OS>${os.name}</Build-OS>

<Build-Label>${project.artifactId}.${project.version}</Build-Label>

<Build-Path>${basedir}</Build-Path>

<Release-Version>${release.info}</Release-Version>

</manifestEntries>

</archive>

</configuration>

</plugin>

<plugin>

<groupId>com.mycila</groupId>

<artifactId>license-maven-plugin</artifactId>

<version>4.3</version>

<configuration>

<licenseSets>

<licenseSet>

<header>src/main/resources/header.txt</header>

<includes>

<include>src/**/*.java</include>

</includes>

</licenseSet>

</licenseSets>

</configuration>

</plugin>

</plugins>

<pluginManagement>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.1</version>

<configuration>

<fork>true</fork>

<debug>true</debug>

<debuglevel>lines,vars,source</debuglevel>

</configuration>

</plugin>

</plugins>

</pluginManagement>

</build>


 The error I am receiving is "Unable to find 'com/medhok/mm/OEV.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?"

Appreciate your help on this.

On Tuesday, November 12, 2024 at 12:08:33 PM UTC-5 Colin Alworth wrote:
If you'd like to share the full example project that fails so that we can look at it and understand what is misconfigured, that would help here, but we can't guess about code and configuration we can't see. My steps in past messages were to give you questions to ask yourself or to answer in your replies so we would have enough information to help, or steps to take to experiment and spot important differences between "works" and "doesn't work".

Best guess, you've managed the version somewhere else in your project to no longer match 1.0.0.GA, but if you literally only have the archetype sources and none of your own pom or own sources, that shouldn't be possible.

On Tuesday, November 12, 2024 at 9:19:33 AM UTC-6 venkat...@gmail.com wrote:
I do have the mentioned dependency in my pom.xml file:

<dependency>

<groupId>javax.validation</groupId>

<artifactId>validation-api</artifactId>

<version>1.0.0.GA</version>

<!-- Note: use classifier=sources rather than type=java-sources so they're added to the classpath -->

<classifier>sources</classifier>

</dependency>


On Tuesday, November 12, 2024 at 8:33:11 AM UTC-5 Colin Alworth wrote:
To use any classes in your GWT code, you need sources (though you need bytecode too to compile with javac). Add the source version of that same jar as well:

            <dependency>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                <version>1.0.0.GA</version>
                <classifier>sources</classifier>
            </dependency>
On Monday, November 11, 2024 at 8:27:22 PM UTC-6 venkat...@gmail.com wrote:
Thanks for your input Colin,

i have created sample project with GWT 2.11.0 and gwt-maven-plugin.  I am getting the following error:

[1m--- [0;32mgwt:1.1.0:compile [m [1m(default) [m @ [36mOEV [0;1m --- [m

[INFO] Compiling module com.mm.medhok.OEV

[INFO] Tracing compile failure path for type 'com.google.gwt.validation.client.impl.NodeImpl'

[INFO] [ERROR] Errors in 'com/google/gwt/validation/client/impl/NodeImpl.java'

[INFO] [ERROR] Line 81: The method getKey() of type NodeImpl must override or implement a supertype method

[INFO] [ERROR] Line 76: The method getIndex() of type NodeImpl must override or implement a supertype method

[INFO] [ERROR] Line 42: Node cannot be resolved to a type

[INFO] [ERROR] Line 30: Node cannot be resolved to a type

[INFO] [ERROR] Line 102: The method isInIterable() of type NodeImpl must override or implement a supertype method

[INFO] [ERROR] Line 38: Node cannot be resolved to a type

[INFO] [ERROR] Line 20: The import javax.validation.Path cannot be resolved

[INFO] [ERROR] Line 25: Node cannot be resolved to a type

[INFO] [ERROR] Line 28: Node cannot be resolved to a type

[INFO] [ERROR] Line 34: Node cannot be resolved to a type

[INFO] [ERROR] Line 86: The method getName() of type NodeImpl must override or implement a supertype method

[INFO] Tracing compile failure path for type 'com.google.gwt.validation.client.constraints.MinValidatorForNumber'

even though I have added below dependency.

<dependency>

<groupId>javax.validation</groupId>

<artifactId>validation-api</artifactId>

<version>1.0.0.GA</version>

</dependency>

Please let me know If I missed any.

On Monday, November 11, 2024 at 6:01:24 PM UTC-5 Colin Alworth wrote:
Can you describe your project layout, how the modules are structured, depend on each other, how your source directories are laid out? What is the <packaging> of this client project where the pom is, and what command are you running to build (and from which directory)?

Consider downgrading to GWT 2.11 and only change the plugin, rather than changing both plugin and GWT version at the same time, so that you don't confuse issues from one change with the other.

Also consider using one of the archetypes to generate a sample project, and then look at the differences between your project and that sample. You can adjust the archetype-created project to be more like your own, and when it stops building, you may have a better idea about what is going on.

On Monday, November 11, 2024 at 3:12:47 PM UTC-6 venkat...@gmail.com wrote:

Thanks Frank to look into this.  Following is the entry in my pom.xml:

<plugin>

<groupId>net.ltgt.gwt.maven</groupId>

<artifactId>gwt-maven-plugin</artifactId>

<version>1.1.0</version>

<executions>

<execution>

<goals>

<goal>compile</goal>

</goals>

</execution>

</executions>

<configuration>

<moduleName>com.medhok.mm.OEV</moduleName>

<moduleShortName>MedicalMgmt</moduleShortName>

<failOnError>true</failOnError>

<!-- GWT compiler 2.8 and above requires 1.8, hence define sourceLevel here if you use

a different source language for java compilation -->

<sourceLevel>1.8</sourceLevel>

<!-- Compiler configuration -->

<compilerArgs>

<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->

<arg>-compileReport</arg>

<arg>-XcompilerMetrics</arg>

</compilerArgs>

<!-- DevMode configuration -->

<warDir>${webappDirectory}</warDir>

<classpathScope>compile+runtime</classpathScope>

<!-- URL(s) that should be opened by DevMode (gwt:devmode). -->

<startupUrls>

<startupUrl>index.html</startupUrl>

</startupUrls>

</configuration>

</plugin>

As per entry in the plugin it has to look into src/main/java.  Some how it's not finding the right classpath entry.

Appreciate your help.

On Monday, November 11, 2024 at 4:05:19 PM UTC-5 Venkateswara Rao wrote:
I have moved to src/main/java. Didn't rename.

On Monday, November 11, 2024 at 4:01:23 PM UTC-5 Frank Hossfeld wrote:
Have you tried to move your OEV.gwt.xml  into the main folder and rename it to: module.gwt.xml? 

Venkateswara Rao schrieb am Montag, 11. November 2024 um 18:49:42 UTC+1:
Hello,

Currently I am migration my gwt application from 2.11.0 to 2.12.0 with .  During this migration we are getting the following error:
[ERROR] Unable to find 'com/medhok/mm/OEV.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
Any leads on this error.

However, as part of the following article https://tbroyer.github.io/gwt-maven-plugin/ I have moved my src to src/main/java.

Still I am getting the above error.

Appreciate your help.

Thanks,
Venkat.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/99daafdc-9c00-4910-ae99-688fd913d06fn%40googlegroups.com.

No comments:

Post a Comment