Discussion:
Compilation issue on GWT 2.8.2 (modular maven project)
Luca Morettoni
2018-11-12 17:50:25 UTC
Permalink
Hello, I’m using the Thomas Broyer fantastic plugin[1] for maven to split my project into multiple subproject (client, shared and server).
Until now I used GWT version 2.8.1, but today I started a new project and I’d like to use the latest version (2.8.2), and some of the POJOs I use in the shared module will be used also in the server module as a response for some REST call (with Jersey).
Usually I annotate my POJOs with the usual @XmlRootElement to use it also in the response payload of a REST call; but switching to 2.8.2 version of GWT I got the known error:

[INFO] [ERROR] Errors in 'file:/Users/luca/tmp/gwt/test/test-shared/src/main/java/net/morettoni/GreetingResponse.java'
[INFO] [ERROR] Line 22: XmlTransient cannot be resolved to a type
[INFO] [ERROR] Line 4: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 8: XmlRootElement cannot be resolved to a type
[INFO] [ERROR] Line 3: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 31: XmlTransient cannot be resolved to a type

and as I see in the messages in this mailing list the solution is to add this extra dependency:

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>...</version>
<classifier>sources</classifier>
<scope>provided</scope>
</dependency>

but I continue to get the same error running the SDM code server (mvn gwt:codeserver -pl *-client -am), even if I added the above to the pom.xml of the shared module.

Any idea on how to fix this issue? I’m using JAVA version 1.8 to compile and run the attached example.
Thanks in advance for the help!

[1]: https://github.com/tbroyer/gwt-maven-archetypes

--
Luca Morettoni <luca(AT)morettoni.net> | http://www.morettoni.net
http://it.linkedin.com/in/morettoni/ | http://twitter.com/morettoni
--
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+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Freddy Boucher
2018-11-12 22:14:24 UTC
Permalink
Juste remove

<scope>provided</scope>

to fix SDM.
--
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+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Luca Morettoni
2018-11-13 07:42:43 UTC
Permalink
Post by Freddy Boucher
Juste remove
<scope>provided</scope>
to fix SDM.
no, I tried this solution but it does not fix the problem...

--
Luca Morettoni <luca(AT)morettoni.net> | http://www.morettoni.net
http://it.linkedin.com/in/morettoni/ | http://twitter.com/morettoni
--
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+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
David Nouls
2018-11-13 09:19:44 UTC
Permalink
By just adding sources to jaxb it will not work.

You need to have these sources in a gwt source folder. so it javax.xml.bind
package must be declared as a source folder in a gwt.xml files before the
GWT compiler picks it up to cross compile.
I don't think that adding the package in you module.gwt.xml will work since
there are probably some java files in there that are refering to non
supported JRE classes. But you could try with excluding those classes.

Regards,
David
Post by Luca Morettoni
Hello, I’m using the Thomas Broyer fantastic plugin[1] for maven to split
my project into multiple subproject (client, shared and server).
Until now I used GWT version 2.8.1, but today I started a new project and
I’d like to use the latest version (2.8.2), and some of the POJOs I use in
the shared module will be used also in the server module as a response for
some REST call (with Jersey).
in the response payload of a REST call; but switching to 2.8.2 version of
[INFO] [ERROR] Errors in
'file:/Users/luca/tmp/gwt/test/test-shared/src/main/java/net/morettoni/GreetingResponse.java'
[INFO] [ERROR] Line 22: XmlTransient cannot be resolved to a type
[INFO] [ERROR] Line 4: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 8: XmlRootElement cannot be resolved to a type
[INFO] [ERROR] Line 3: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 31: XmlTransient cannot be resolved to a type
and as I see in the messages in this mailing list the solution is to add
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>...</version>
<classifier>sources</classifier>
<scope>provided</scope>
</dependency>
but I continue to get the same error running the SDM code server (mvn
gwt:codeserver -pl *-client -am), even if I added the above to the pom.xml
of the shared module.
Any idea on how to fix this issue? I’m using JAVA version 1.8 to compile
and run the attached example.
Thanks in advance for the help!
[1]: https://github.com/tbroyer/gwt-maven-archetypes
--
Luca Morettoni <luca(AT)morettoni.net> | http://www.morettoni.net
http://it.linkedin.com/in/morettoni/ | http://twitter.com/morettoni
--
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+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2018-11-13 08:24:07 UTC
Permalink
provided dependencies are not transitive. you need to add the dependency to
the client package as well.
Post by Luca Morettoni
Hello, I’m using the Thomas Broyer fantastic plugin[1] for maven to split
my project into multiple subproject (client, shared and server).
Until now I used GWT version 2.8.1, but today I started a new project and
I’d like to use the latest version (2.8.2), and some of the POJOs I use in
the shared module will be used also in the server module as a response for
some REST call (with Jersey).
in the response payload of a REST call; but switching to 2.8.2 version of
[INFO] [ERROR] Errors in
'file:/Users/luca/tmp/gwt/test/test-shared/src/main/java/net/morettoni/GreetingResponse.java'
[INFO] [ERROR] Line 22: XmlTransient cannot be resolved to a type
[INFO] [ERROR] Line 4: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 8: XmlRootElement cannot be resolved to a type
[INFO] [ERROR] Line 3: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 31: XmlTransient cannot be resolved to a type
and as I see in the messages in this mailing list the solution is to add
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>...</version>
<classifier>sources</classifier>
<scope>provided</scope>
</dependency>
but I continue to get the same error running the SDM code server (mvn
gwt:codeserver -pl *-client -am), even if I added the above to the pom.xml
of the shared module.
Any idea on how to fix this issue? I’m using JAVA version 1.8 to compile
and run the attached example.
Thanks in advance for the help!
[1]: https://github.com/tbroyer/gwt-maven-archetypes
--
Luca Morettoni <luca(AT)morettoni.net> | http://www.morettoni.net
http://it.linkedin.com/in/morettoni/ | http://twitter.com/morettoni
--
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+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Thomas Broyer
2018-11-13 09:58:43 UTC
Permalink
You're doing your dependencies backwards actually.


- test-shared does depend on jaxb annotations, but not their sources.
Actually, with Java 11, which no longer ships jaxb, it doesn't even compile.
- test-server doesn't directly depend on jaxb annotations (AFAICT), and
could have the dependency transitively from test-shared.
- test-client needs the jaxb annotations as dependency
(see https://github.com/gwtproject/gwt/issues/9612, it won't find the jaxb
annotations from the JDK), and it actually doesn't even need their sources
(but in case you'd need them, this is where you'd put the dependency)


So:

- remove scope=provided and classifier=sources from test-shared
- remove the jaxb dependency from test-server
- possibly add the jaxb dependency with classifier=sources in test-client
Post by Luca Morettoni
Hello, I’m using the Thomas Broyer fantastic plugin[1] for maven to split
my project into multiple subproject (client, shared and server).
Until now I used GWT version 2.8.1, but today I started a new project and
I’d like to use the latest version (2.8.2), and some of the POJOs I use in
the shared module will be used also in the server module as a response for
some REST call (with Jersey).
in the response payload of a REST call; but switching to 2.8.2 version of
[INFO] [ERROR] Errors in
'file:/Users/luca/tmp/gwt/test/test-shared/src/main/java/net/morettoni/GreetingResponse.java'
[INFO] [ERROR] Line 22: XmlTransient cannot be resolved to a type
[INFO] [ERROR] Line 4: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 8: XmlRootElement cannot be resolved to a type
[INFO] [ERROR] Line 3: The import javax.xml.bind cannot be resolved
[INFO] [ERROR] Line 31: XmlTransient cannot be resolved to a type
and as I see in the messages in this mailing list the solution is to add
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>...</version>
<classifier>sources</classifier>
<scope>provided</scope>
</dependency>
but I continue to get the same error running the SDM code server (mvn
gwt:codeserver -pl *-client -am), even if I added the above to the pom.xml
of the shared module.
Any idea on how to fix this issue? I’m using JAVA version 1.8 to compile
and run the attached example.
Thanks in advance for the help!
[1]: https://github.com/tbroyer/gwt-maven-archetypes
--
Luca Morettoni <luca(AT)morettoni.net> | http://www.morettoni.net
http://it.linkedin.com/in/morettoni/ | http://twitter.com/morettoni
--
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+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Luca Morettoni
2018-11-13 10:20:30 UTC
Permalink
Post by Thomas Broyer
remove scope=provided and classifier=sources from test-shared
remove the jaxb dependency from test-server
possibly add the jaxb dependency with classifier=sources in test-client
Thanks Thomas, it works (with this changes):

Added jaxb as dependency in the shared project as:

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>

Added jaxb as dependency in the client project as:

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
<classifier>sources</classifier>
</dependency>

I keep the dependency on the server side, but I will try to remove it with the real project to see if then passes all the tests!

Thanks for the help!!!

--
Luca Morettoni <luca(AT)morettoni.net> | http://www.morettoni.net
http://it.linkedin.com/in/morettoni/ | http://twitter.com/morettoni
--
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+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...