gwt 2.3 gwt-servlet-deps.jar from Ant Ivy build

631 views
Skip to first unread message

pohl

unread,
May 5, 2011, 2:57:02 PM5/5/11
to Google Web Toolkit
I am trying to get a simple GWT 2.3 project working in DevMode with an
Ant Ivy build. I have used Ivy for GWT projects prior to 2.3 (GWT
2.0.x in particular), and the following dependencies (in my Ivy module
xml file) have worked for me in the past: (I have removed the specific
names for my Ivy configurations, and show them as "..." below.)

<dependency org="com.google.gwt" name="gwt-dev" rev="2.3.0"
conf="..." />
<dependency org="com.google.gwt" name="gwt-servlet" rev="2.3.0"
conf="..." />
<dependency org="com.google.gwt" name="gwt-user" rev="2.3.0"
conf="..." />

My gwt-compile (when GWT's Java-to-Javascript compiler is invoked)
fails using the above under GWT 2.3, however. In particular, with
several errors similar to the following:

[java] [ERROR] Errors in 'jar:file:/../gwt-user-2.3.0.jar!/com/google/
gwt/editor/client/EditorDriver.java'
[java] [ERROR] Line 97: No source code is available for type
javax.validation.ConstraintViolation<T>; did you forget to inherit a
required module?

After searching online for references that may be relevant, I find
threads like this one regarding similar problems while building
release candidates of 2.3 from source.

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/86ee81f80a3f5d67/ca5481d6be62bd3b?lnk=raot

These threads frequently mention a gwt-servlet-deps.jar that one needs
to include in the compilation classpath, which appears to be the
fruits of the labor around this issue in the GWT issue tracking
system:

http://code.google.com/p/google-web-toolkit/issues/detail?id=5468

Of course with Ivy it's not quite the same as the advice I'm seeing.
The above <dependency... rules do not appear to download a gwt-servlet-
deps.jar (as opposed to downloading GWT's official distribution,
wherein a special copy of that jar can be found).

So I have reasoned out that in the Ivy universe I probably need to add
something like this:

<dependency org="javax.validation" name="validation-api"
rev="1.0.0.GA" conf="..."/>

...and I thought I was pretty bad-ass for even having that idea (I
seem to be a perpetual newbie to the Ivy & Maven world) but, alas, I
am still getting the same errors.

Apparently the Java-to-Javascript compiler would like the sources, not
just the bytecode jar, but I don't know how to tell Ivy to go get
them. I feel like I'm close because I have found this thread...

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/86ee81f80a3f5d67/ca5481d6be62bd3b?lnk=raot

...which shows an Ant task that copies two validation jars into lib
(both bytecode and sources), but I need some help to connect the dots
for the Ivy world.

How would I tell Ivy to grab the source jar?

Juan Pablo Gardella

unread,
May 5, 2011, 3:00:26 PM5/5/11
to google-we...@googlegroups.com
http://stackoverflow.com/questions/4950048/what-is-the-ivy-equivalent-of-mavens-versionsdisplay-dependency-updates

2011/5/5 pohl <pohl.l...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


pohl

unread,
May 5, 2011, 4:10:06 PM5/5/11
to Google Web Toolkit
http://stackoverflow.com/questions/4950048/what-is-the-ivy-equivalent-of-mavens-versionsdisplay-dependency-updates

Could you elaborate as to what lesson I'm supposed to draw from this
link? The use of ivy::report seems like
a good idea, but i'm not sure how it helps me.

I have implemented an equivalent target and generated such a report
for my build configurations. The report
is impressive looking. I see a row of tabs along the top of the page,
one for each Ivy configuration that
I have.

Each one of the configurations shows "0 Errors".

Is there some other thing on the report I should be looking for?

Filipe Sousa

unread,
May 5, 2011, 4:22:10 PM5/5/11
to google-we...@googlegroups.com
I'm having the same problem with IvyDE.
I can't pass the validation-api-1.0.0.GA-sources.jar to the eclipse classpath. Let me know if you find a solution.

pohl

unread,
May 5, 2011, 4:30:43 PM5/5/11
to Google Web Toolkit
Filipe, I found that issue in the tracker yesterday. You may want to
star this. It looks like you, at least, have a workaround if you're
willing to add that jar directly to your classpath.

http://code.google.com/p/google-web-toolkit/issues/detail?id=6225

Juan Pablo Gardella

unread,
May 5, 2011, 8:28:10 PM5/5/11
to google-we...@googlegroups.com
If you use maven resolve this problem with this:

   <dependency>
                       <groupId>javax.validation</groupId>
                       <artifactId>validation-api</artifactId>
                       <version>1.0.0.GA</version>
                       <scope>provided</scope>
               </dependency>
               <dependency>
                       <groupId>javax.validation</groupId>
                       <artifactId>validation-api</artifactId>
                       <version>1.0.0.GA</version>
                       <classifier>sources</classifier>
                       <scope>provided</scope>
               </dependency>

You need to define in Ivy this dependencies. You must declare the dependency plus the classifier. Ivy support this but I don't know Ivy to paste the code that define a dependency with classifier

Juan

2011/5/5 pohl <pohl.l...@gmail.com>

Filipe Sousa

unread,
May 6, 2011, 5:23:52 AM5/6/11
to google-we...@googlegroups.com
On Friday, May 6, 2011 1:28:10 AM UTC+1, Juan Pablo Gardella wrote:
If you use maven resolve this problem with this:

   <dependency>
                       <groupId>javax.validation</groupId>
                       <artifactId>validation-api</artifactId>
                       <version>1.0.0.GA</version>
                       <scope>provided</scope>
               </dependency>
               <dependency>
                       <groupId>javax.validation</groupId>
                       <artifactId>validation-api</artifactId>
                       <version>1.0.0.GA</version>
                       <classifier>sources</classifier>
                       <scope>provided</scope>
               </dependency>

You need to define in Ivy this dependencies. You must declare the dependency plus the classifier. Ivy support this but I don't know Ivy to paste the code that define a dependency with classifier

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd

<dependency org="javax.validation" name="validation-api" rev="1.0.0.GA">
<artifact name="validation-api"/>
<artifact name="validation-api" m:classifier="sources"/>
</dependency>

I had already tried this yesterday and did not work. But now it's working:)

pohl

unread,
May 6, 2011, 11:13:34 AM5/6/11
to Google Web Toolkit

This smells like it should work to me, but I get this:

impossible to ivy retrieve: java.lang.RuntimeException: problem
during retrieve Multiple
artifacts of the module javax.validation#validation-api;1.0.0.GA are
retrieved to the same file!
Update the retrieve pattern to fix this error.

I'm not sure what they mean by "retrieve pattern" in this context.


On May 6, 4:23 am, Filipe Sousa <nat...@gmail.com> wrote:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="2.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
> xmlns:m="http://ant.apache.org/ivy/maven">
>
> <dependency org="javax.validation" name="validation-api" rev="1.0.0.GA">
> <artifact name="validation-api"/>
> <artifact name="validation-api" *m:classifier="sources"*/>

pohl

unread,
May 6, 2011, 1:46:05 PM5/6/11
to Google Web Toolkit
In order to get around the multiple-artifacts error above, I needed to
go into the
Ant build file that drives Ivy, and modify the pattern attribute on
the "retrieve"
element.

In particular, I had to add the parenthetical classifier piece at the
end:

<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[revision](-
[classifier]).[ext]" />

I'm still not building, but at least I'm getting a different error
now:

Compiling module org.screaming.web.ui.Main
[java] [ERROR] Errors in 'jar:file:/home/pohl/.ant/playpen/
gwt.compile/gwt-user-2.3.0.jar!/com/google/gwt/user/client/ui/
DisclosurePanel.java'
[java] [ERROR] Internal compiler error
[java] java.lang.NoSuchMethodError:
com.google.gwt.resources.ext.ClientBundleRequirements.addConfigurationProperty(Ljava/
lang/String;)V

Filipe Sousa

unread,
May 6, 2011, 3:00:37 PM5/6/11
to google-we...@googlegroups.com
Using the following

build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="test" default="resolve">
<target name="resolve" description="--> resolve dependencies">
<ivy:retrieve sync="true" type="jar"/>
</target>
</project>

ivy.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd
<info organisation="pt.ipb" module="test" status="release" />
<dependencies>
<dependency org="com.google.gwt" name="gwt-user" rev="2.3.0" />
<dependency org="com.google.gwt" name="gwt-servlet" rev="2.3.0" />
<dependency org="com.google.gwt" name="gwt-dev" rev="2.3.0" />
<dependency org="javax.validation" name="validation-api" rev="1.0.0.GA">
<artifact name="validation-api"/>
<artifact name="validation-api" m:classifier="sources"/>
</dependency>
</dependencies>
</ivy-module>

[fsousa@nostradamus ivy-test]$ ant
Buildfile: /home/fsousa/ivy-test/build.xml

resolve:
[ivy:retrieve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: url = jar:file:/opt/apache-ant-1.8.2/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: pt.ipb#test;working@nostradamus
[ivy:retrieve] confs: [default]
[ivy:retrieve] found com.google.gwt#gwt-user;2.3.0 in public
[ivy:retrieve] found com.google.gwt#gwt-servlet;2.3.0 in public
[ivy:retrieve] found com.google.gwt#gwt-dev;2.3.0 in public
[ivy:retrieve] found javax.validation#validation-api;1.0.0.GA in public
[ivy:retrieve] :: resolution report :: resolve 199ms :: artifacts dl 16ms
---------------------------------------------------------------------
|                  |            modules            ||   artifacts   |
|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
|      default     |   4   |   0   |   0   |   0   ||   11  |   0   |
---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: pt.ipb#test [sync]
[ivy:retrieve] confs: [default]
[ivy:retrieve] 0 artifacts copied, 5 already retrieved (0kB/9ms)

BUILD SUCCESSFUL
Total time: 0 seconds

[fsousa@nostradamus ivy-test]$ ls -l lib 
total 44076
-rw-rw-r-- 1 fsousa fsousa 28046854 May  3 16:02 gwt-dev-2.3.0.jar
-rw-rw-r-- 1 fsousa fsousa  5004997 May  3 16:04 gwt-servlet-2.3.0.jar
-rw-rw-r-- 1 fsousa fsousa 11962987 May  3 16:03 gwt-user-2.3.0.jar
-rw-rw-r-- 1 fsousa fsousa    47433 Feb 25  2010 validation-api-1.0.0.GA.jar
-rw-rw-r-- 1 fsousa fsousa    65220 Feb 25  2010 validation-api-1.0.0.GA-sources.jar

As you can see, I'm getting all the jars needed. The same happens with IvyDE.

pohl

unread,
May 6, 2011, 3:25:17 PM5/6/11
to Google Web Toolkit
The exception that I'm getting now appears to be the result of Gin
1.5. It looks like the dependency information in the ibiblio package
must be pulling in gwt-servlet.jar from 2.2.0, and it is not getting
evicted for some reason.

(I can tell this by the ivy:report that I am generating, thanks to
Juan Pablo's advice above.)

I'm not sure what I can do to tell Gin 1.5 to proceed with gwt-
servlet.jar from 2.3.0, or if that is even possible. Maybe I need to
wait for Gin to cut another release, and for it to worm its way
through the ibiblio package maintainers to me?

I see you're not using Gin, so that must be why it is working for you
and not me.

On May 6, 2:00 pm, Filipe Sousa <nat...@gmail.com> wrote:
> Using the following
>
> *ivy.xml:*

Filipe Sousa

unread,
May 6, 2011, 4:09:14 PM5/6/11
to google-we...@googlegroups.com
for gin i'm using this
<dependency org="com.google.gwt.inject" name="gin" rev="1.5.0" />

[fsousa@nostradamus ivy-test]$ ant
Buildfile: /home/fsousa/ivy-test/build.xml

resolve:
[ivy:retrieve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: url = jar:file:/opt/apache-ant-1.8.2/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: pt.ipb#test;working@nostradamus
[ivy:retrieve] confs: [default]
[ivy:retrieve] found com.google.gwt#gwt-user;2.3.0 in public
[ivy:retrieve] found com.google.gwt#gwt-servlet;2.3.0 in public
[ivy:retrieve] found com.google.gwt#gwt-dev;2.3.0 in public
[ivy:retrieve] found javax.validation#validation-api;1.0.0.GA in public
[ivy:retrieve] found com.google.gwt.inject#gin;1.5.0 in public
[ivy:retrieve] found com.google.inject#guice;3.0-rc2 in public
[ivy:retrieve] found javax.inject#javax.inject;1 in public
[ivy:retrieve] found aopalliance#aopalliance;1.0 in public
[ivy:retrieve] found org.sonatype.sisu.inject#cglib;2.2.1-v20090111 in public
[ivy:retrieve] found asm#asm;3.1 in public
[ivy:retrieve] found com.google.inject.extensions#guice-assistedinject;3.0-rc2 in public
[ivy:retrieve] :: resolution report :: resolve 334ms :: artifacts dl 25ms
[ivy:retrieve] :: evicted modules:
[ivy:retrieve] com.google.gwt#gwt-servlet;2.2.0 by [com.google.gwt#gwt-servlet;2.3.0] in [default]
[ivy:retrieve] com.google.gwt#gwt-user;2.2.0 by [com.google.gwt#gwt-user;2.3.0] in [default]
---------------------------------------------------------------------
|                  |            modules            ||   artifacts   |
|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
|      default     |   13  |   0   |   0   |   2   ||   20  |   0   |
---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: pt.ipb#test [sync]
[ivy:retrieve] confs: [default]
[ivy:retrieve] 0 artifacts copied, 12 already retrieved (0kB/13ms)

BUILD SUCCESSFUL
Total time: 1 second


[fsousa@nostradamus ivy-test]$ ls -l lib/
total 45268
-rw-rw-r-- 1 fsousa fsousa     4467 Aug  1  2005 aopalliance-1.0.jar
-rw-rw-r-- 1 fsousa fsousa    43033 Jan 20  2008 asm-3.1.jar
-rw-rw-r-- 1 fsousa fsousa   278864 Jan  4 13:12 cglib-2.2.1-v20090111.jar
-rw-rw-r-- 1 fsousa fsousa   131347 Mar  1 03:24 gin-1.5.0.jar
-rw-rw-r-- 1 fsousa fsousa   704045 Jan 10 02:14 guice-3.0-rc2.jar
-rw-rw-r-- 1 fsousa fsousa    36944 Jan 10 02:16 guice-assistedinject-3.0-rc2.jar
-rw-rw-r-- 1 fsousa fsousa 28046854 May  3 16:02 gwt-dev-2.3.0.jar
-rw-rw-r-- 1 fsousa fsousa  5004997 May  3 16:04 gwt-servlet-2.3.0.jar
-rw-rw-r-- 1 fsousa fsousa 11962987 May  3 16:03 gwt-user-2.3.0.jar
-rw-rw-r-- 1 fsousa fsousa     2497 Oct 14  2009 javax.inject-1.jar

pohl

unread,
May 6, 2011, 4:29:38 PM5/6/11
to Google Web Toolkit
That's what I'm using for gin too. Hmm...

pohl

unread,
May 6, 2011, 5:32:59 PM5/6/11
to Google Web Toolkit
Ok, I'm going to run to the loving, conventional arms of maven now.
Goodbye, cruel Ivy.

Thanks to all for trying to help. Maybe I'll be back after beating my
head against a wall of archetypes for the umpteenth time.

Eugen Paraschiv

unread,
Jun 30, 2011, 10:31:59 AM6/30/11
to google-we...@googlegroups.com
Including the 2 depenencies without a validation provider doesn't seem right. You also need a provider, otherwise:
javax.validation.ValidationException: Unable to find a default provider.
Any ideas on how to solve this? (besides actually including a provider just to be able to run gwt).
Thanks.
Eugen.
Reply all
Reply to author
Forward
0 new messages