When I build the war file for deployment (ant war), the GWT compiler acts as if it has never heard of java.io.Reader or java.io.BufferedReader. When I make the development build for devmode (ant javac), they build just fine. I'm using GWT 2.4.0. Does anyone know what is going on?
gwtc:
[java] Compiling module com.foo.Foo
[java] Validating newly compiled units
[java] [ERROR] Errors in 'file:[...]/Foo/src/com/foo/shared/ReaderLineIterator.java'
[java] [ERROR] Line 13: No source code is available for type java.io.BufferedReader; did you forget to inherit a required module?
[java] [ERROR] Line 21: No source code is available for type java.io.Reader; did you forget to inherit a required module?
[java] [ERROR] Aborting compile due to errors in some input files
BUILD FAILED
Not the complete package java.io is supported by GWT.
See the JRE Emulation Reference for details
The client-side of GWT does not have access to the whole Java API. java.io is one of them.
When you run or compile it will give you did you forget to inherit a required module? error. But you can definitely use it on the server-side of GWT. You can find the list of classes that can be used at client-side here.
Related
I am trying to compile a GWT project but I am getting the following error: Can anyone please explain if I am missing anything? I have downloaded the GWT plugins for the eclipse.
Compiling module com.nolij.nolijweb.ui.entrypoint.user.UserInterface Validating units:
Ignored 28 units with compilation errors in first pass. Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. Finding entry point classes
[ERROR] Errors in 'com/google/gwt/core/client/GWTBridge.java'
[ERROR] Line 25: No source code is available for type com.google.gwt.core.shared.GWTBridge; did you forget to inherit a required module?
[ERROR] Unable to find type 'com.nolij.nolijweb.ui.entrypoint.user.client.UserInterface'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
I'm trying to user super-source to emulate classes GWT has no access to the source code. This ran fine first. But when I use those classes in classes that get validated by Bean Validation (JSR 303), I get an error:
[java] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
...
...
[java] Caused by: java.lang.NoClassDefFoundError: somepath/myClass
IMHO this looks like I cannot use Emulations in 'shared' packages but only in the 'client'.
any experiences here?
TIA
ujbi
In GWT:
client package compiled to javascript.
Shared package compiles both to java byte code and javascript.
Most probably while compiling to java code no issues raise.But while compiling to java script you might thrown in to this issue.
IMHO This looks like I cannot use Emulations in
'shared' packages but only in the 'client'.
Yes unfortunately that's true.
The code in the shared package must friendly to Compiler. I.e It should emulate.
I'm trying to start using GWTQuery in a GWT project.
I've created sample GWT project in Eclipse
Added gwtquery-1.3.2.jar
into war/WEB-INF/lib
Edited Myproject.gwt.xml (added <inherits name='com.google.gwt.query.Query'/>)
When I compile the project it writes a lot of deffered errors but at the end it comes with:
Scanning for additional dependencies: jar:file:/C:/eclipseBacklog/Backlog/war/WEB-INF/lib/gwtquery-1.3.2.jar!/com/google/gwt/query/client/GQuery.java
Computing all possible rebind results for 'com.google.gwt.query.client.GQuery'
Rebinding com.google.gwt.query.client.GQuery
Checking rule <replace-with class='com.google.gwt.query.client.impl.SelectorEngineNativeIE8'/>
[ERROR] Errors in 'jar:file:/C:/eclipseBacklog/Backlog/war/WEB-INF/lib/gwtquery-1.3.2.jar!/com/google/gwt/query/client/Properties.java'
[ERROR] Line 20: The import com.google.gwt.core.shared cannot be resolved
[ERROR] Line 39: GWT cannot be resolved
[ERROR] Unable to find type 'com.google.gwt.query.client.GQuery'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] Errors in 'jar:file:/C:/eclipseBacklog/Backlog/war/WEB-INF/lib/gwtquery-1.3.2.jar!/com/google/gwt/query/client/GQuery.java'
[ERROR] Line 1483: Failed to resolve 'com.google.gwt.query.client.GQuery' via deferred binding
What I'm doing wrong?
Check your version of gwt, you have to update to GWT-2.5.x. because this artifact of gquery has a undesired dependency of it. There are two GWT.java classes in 2.5, and gquery is depending of the new com.google.gwt.core.shared by mistake.
Open an issue at the gwtquery site becasuse this release should work with older gwt version as well.
You could also change the gquery version to 1.3.1 or 1.4.0-SNAPSHOT
Update: I've just deprecated version 1.3.2, and released 1.3.3 which compiles with previous gwt versions
I created a service, async, impl for an rpc service. However, when I go to do the gwt compile (I'm using Eclispe Indigo with the gwt 2.4 plugin) I'm getting these errors:
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Scanning for additional dependencies: file:/C:/.../client/activity/CalculatorActivity.java
Computing all possible rebind results for '...Calculator.client.CalculatorService'
Rebinding com... CalculatorService
Checking rule
[ERROR] Errors in 'file:/...Calcuator/src/...Calculator/client/CalculatorService.java'
[ERROR] Line 17: No source code is available for type java.io.InputStream; did you forget to inherit a required module?
[ERROR] Unable to find type '...Calculator.client.CalculatorService'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] Errors in 'file:/...Calculator/client/activity/CalculatorActivity.java'
[ERROR] Line 59: Failed to resolve '...CalculatorService' via deferred binding
[ERROR] Cannot proceed due to previous errors
I'm not sure what is causing this? I'm not getting any compile errors under Eclipse, but something isn't setup right for the RPC service apparently.
Any ideas as to what the problem is?
It seems, you use the InputStream class somewhere in your client side code. But in client side code you are restricted to the classes mentioned in the JRE Emulation Reference.
I've installed the plugin from this article by Peter
http://www.cacoethes.co.uk/blog/groovyandgrails/the-command-pattern-w....
While compile time its not able to find the module file which is
present in the plugin. Since there are no jar files for the module,
can you tell me what I'm missing here..
The stack trace is as follows:
[java] Loading inherited module 'grails.plugins.gwt.Grails'
[java] [ERROR] Unable to find 'grails/plugins/gwt/Grails.gwt.xml' on your classpath; could be a typo, or maybe you forgot to incl
ude a classpath entry for source?
[java] [ERROR] Line 12: Unexpected exception while processing element 'inherits'
[java] com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
Hey Satya, I've had similar problems with classpath errors working with other grails plugins.
I've found sometimes it's necessary to manually copy artifacts from (user-home directory)/.grails/(grails-version)/plugins/(plugin-name) into the lib/ directory inside my grails project.
In this case, you might try copying src/gwt (from the grails-gwt-0.5-SNAPSHOT.zip) into lib/gwt? or maybe try to copy it to match grails/plugins/gwt/Grails.gwt.xml?