Grails 1.3.1 and SmartGWT dependency problems

426 views
Skip to first unread message

Carlos

unread,
May 25, 2010, 6:04:34 PM5/25/10
to grails-gwt
Hi all,

I'm trying to create a Grails 1.3.1 application using the gwt plugin
and SmartGWT. I'm getting the following stacktrace (see below) when
running 'grails compile-gwt-modules'. One thing to note is that I
don't have the smartgwt jar files under /lib/gwt, I'm using Grails new
dependency management solution from the BuildConfig.groovy file. Any
suggestions would be much appreciated!

======= Exception =======

czuniga@czuniga-mac:~/Documents/other/dev/collaboration$ grails
compile-gwt-modules
Welcome to Grails 1.3.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Users/czuniga/bin/grails

Base Directory: /Users/czuniga/Documents/other/dev/collaboration
Resolving dependencies...
Dependencies resolved in 5958ms.
Running script /Users/czuniga/.grails/1.3.1/projects/collaboration/
plugins/gwt-0.5/scripts/CompileGwtModules.groovy
Environment set to development
Compiling GWT i18n properties files ...
Module: com.czuniga.collaboration.Main ...
No i18n Constants file found ...
No i18n Messages file found ...
Finished compiling the i18n properties files. ...
Compiling GWT modules ...
Module: com.czuniga.collaboration.Main ...
[java] Loading inherited module 'com.smartgwt.SmartGwt'
[java] [ERROR] Unable to find 'com/smartgwt/SmartGwt.gwt.xml'
on your classpath; could be a typo, or maybe you forgot to include a
classpath entry for source?
[java] [ERROR] Line 5: Unexpected exception while processing
element 'inherits'
[java] com.google.gwt.core.ext.UnableToCompleteException: (see
previous log entries)
[java] at
com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:
239)
[java] at com.google.gwt.dev.cfg.ModuleDefSchema
$BodySchema.__inherits_begin(ModuleDefSchema.java:354)
[java] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown
Source)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at
com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:
223)
[java] at com.google.gwt.dev.util.xml.ReflectiveParser
$Impl.startElement(ReflectiveParser.java:270)
[java] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:
501)
[java] at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:
179)
[java] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:
1343)
[java] at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(X

...


======= BuildConfig.groovy =======

grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn',
'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()

mavenCentral()
mavenRepo "http://www.smartclient.com/maven2" // SmartClient repo
}
dependencies {
// specify dependencies here under either 'build', 'compile',
'runtime', 'test' or 'provided' scopes eg.

runtime 'mysql:mysql-connector-java:5.1.5'
runtime 'com.smartgwt:smartgwt:2.2'
}

}

======= Installed Plugins =======

Plug-ins you currently have installed are listed below:
-------------------------------------------------------------

gwt 0.5 -- The Google Web Toolkit for
Grails.
hibernate 1.3.1 -- Hibernate for Grails
jetty 1.2-SNAPSHOT -- Jetty Plugin
joda-time 0.5.1 -- Joda-Time Plugin
tomcat 1.3.1 -- Apache Tomcat plugin for
Grails

Message has been deleted

Rogério Valente

unread,
May 26, 2010, 9:50:39 AM5/26/10
to grails-gwt
Hi Carlos,

It's seems to me that is a library path problem.
Make sure that lib/gwt is created in the project's root, then, copy
the smartgwt.jar and smartgwt-skins.jar to lib/gwt folder.
Add both files to build path of your project. Go to Configure build
path / Libraries tab / Add JARs and point to the smartgwt files in lib
folder.


It's working to me.

Hugs,

Rogério Alcântara Valente.

On 25 maio, 19:04, Carlos <carlosluiszun...@gmail.com> wrote:
> Hi all,
>
> I'm trying to create a Grails 1.3.1 application using the gwt plugin
> and SmartGWT. I'm getting the following stacktrace (see below) when
> running 'grails compile-gwt-modules'. One thing to note is that I
> don't have the smartgwt jar files under /lib/gwt, I'm using Grails new
> dependency management solution from the BuildConfig.groovy file. Any
> suggestions would be much appreciated!
>
> ======= Exception =======
>
> czuniga@czuniga-mac:~/Documents/other/dev/collaboration$ grails
> compile-gwt-modules

> Welcome to Grails 1.3.1 -http://grails.org/

Carlos

unread,
May 27, 2010, 12:17:43 PM5/27/10
to grails-gwt
hanks for your answer Rogerio. You are right the problem is in the
classpath and because I'm using the Grails 1.3.1 dependency management
system (using the BuildConfig.groovy file) I don't have a lib/gwt
folder. I have modified the plugin to allow the gwt jars to be managed
by the dependency system instead of requiring them to be under lib/
gwt. I'll try to get it incorporated to the next release of the
plugin. The diff is as follows:

--- a/scripts/_GwtInternal.groovy
+++ b/scripts/_GwtInternal.groovy
@@ -404,6 +404,10 @@ gwtRun = { String className, Closure body ->
// Add the plugin's module paths.
pathElement(location: "${gwtPluginDir}/${gwtSrcPath}")
pathElement(location: "${gwtPluginDir}/${grailsSrcPath}")
+
+ grailsSettings.runtimeDependencies.each { dep ->
+ pathElement(location: dep)
+ }

// Add the DTO source path if that plugin is installed in
// the current project.

Predrag Knežević

unread,
May 27, 2010, 12:53:34 PM5/27/10
to grail...@googlegroups.com
Hi Carlos,

I am not sure if your patch will work in general: as far as I
remember, the reason why the GWT plugin introduced the additional
lib/gwt directory was due to the requirements of GWT compiler: it
needed to have in its classpath source folders and GWT prepared jars
(containing .*gwt.xml and *.java files) ONLY. I am not sure if this is
still valid with GWT 2.x.

Please, let us know if your patched GWT plugin can compile and start
the development mode, if you add to your dependencies a non-gwt jar
file.

Cheers,

Predrag

Rogério Valente

unread,
May 27, 2010, 1:08:34 PM5/27/10
to grails-gwt
Yes Pedrag, this is still valid on GWt 2.x.

I'm using GWT 2.0.3 and SmartGWT 2.2.

Cheers,
Rogério.

Peter Ledbrook

unread,
May 28, 2010, 4:36:14 AM5/28/10
to grail...@googlegroups.com
> --- a/scripts/_GwtInternal.groovy
> +++ b/scripts/_GwtInternal.groovy
> @@ -404,6 +404,10 @@ gwtRun = { String className, Closure body ->
>             // Add the plugin's module paths.
>             pathElement(location: "${gwtPluginDir}/${gwtSrcPath}")
>             pathElement(location: "${gwtPluginDir}/${grailsSrcPath}")
> +
> +            grailsSettings.runtimeDependencies.each { dep ->
> +                       pathElement(location: dep)
> +            }

Note that all runtime dependencies are included in the WAR file. This
isn't what you want for most GWT libraries I think. In fact, I'm
pretty sure dependencies in "lib/gwt" aren't included in the WAR file.

So, what I propose to do is add a special "gwt" dependency
configuration. The plugin will then include all dependencies in that
configuration on the gwtRun classpath.

Peter

Reply all
Reply to author
Forward
0 new messages