I want to use the GWT-FXv0.5.0MS_1.jar in my GWT Project, i added the jar file to project path and used the codes up on syntax, now am getting error that not inherited:
Error message is:
11:28:48.829 [ERROR] [uibuilder] Line 80: No source code is available for type org.adamtacy.client.ui.effects.core.NMorphStyle; did you forget to inherit a required module?
You have to add inherit tag in your gwt.xml
<inherits name="com.company.gwt-fx"/>
Related
I have a GWT application (FooGwtApp) and a library module (FooLib) used as a dependency in FooGwtApp. The package structure of FooLib looks like this:
packageFoo.ImportantClass
packageFoo.UnimportantClass
packageBar.OtherClass
I want ImportantClass (and only ImportantClass) to be compiled to JS by the GWT compiler. Moving ImportantClass to another package is not an option.
I created ImportantClass.gwt.xml within packageFoo with the following content:
<module>
<inherits name="com.google.gwt.user.User"/>
<source path="" includes="**/ImportantClass*"/>
</module>
Next I put an inherited reference to the ImportantClass module definition in FooGwtApp.gwt.xml (this seems to work: the IDE recognizes it, and is able to parse the reference to ImportantClass.gwt.xml).
Now If I put references to ImportantClass into FooGwtApp's client code, the GWT compiler fails, because it does not find ImportantClass on the source path:
No source code is available for type packageFoo.ImportantClass; did you forget to inherit a required module?
I likely messed up sommething in the source path / includes attribute in ImportantClass.gwt.xml - either defining the current package as root package with path="" is not a valid notation or something's wrong with the includes attribute. Or both. Or neither.
Can you give me a clue about where it all went wrong?
It turns out the problem was not in ImportantClass.gwt.xml, but in other Maven related stuff:
ImportantClass.gwt.xml should be placed under src/main/resources/packageFoo, not src/main/java/packageFoo, otherwise it won't be packaged into the binary jar.
GWT compiler compiles from Java source to Javascript source. This means we don't just need ImportantClass.class in FooLib.jar, but also its source. Best solution for this is to use maven-source-plugin in FooLib's pom.xml and also to import the FooLib dependency into FooGwtApp with sources classifier.
On the latter topic, see the following SO answers:
Maven: Distribute source code with with jar-with-dependencies
How to properly include Java sources in Maven?
After fixing the above problems, the source path declaration present in the question works.
Im making a multiplayer game with GDX. it works on desktop/android but when I want to compile it with GWT I get this Error:
[ERROR] Line 24: No source code is available for type io.socket.client.Socket; did you forget to inherit a required module?
[ERROR] Line 69: No source code is available for type io.socket.client.IO; did you forget to inherit a required module?
[ERROR] Line 79: No source code is available for type io.socket.emitter.Emitter.Listener; did you forget to inherit a required module?
how can I fix this?
Socket.io is not compatible with GWT. Consider using a different framework, such like Atmosphere.
I am developing a simple web application. I am using sencha(gxt) framework to display chart to user.
When I am compiling the project, I am getting following errors.
[ERROR] Errors in 'file:/E:/eclipse%20Workspace/Chart_Demo/src/com/project/client/Chart_Demo.java'
[ERROR] Line 74: No source code is available for type com.sencha.gxt.chart.client.chart.Chart<M>; did you forget to inherit a required module?
[ERROR] Line 78: No source code is available for type com.sencha.gxt.chart.client.draw.Gradient; did you forget to inherit a required module?
[ERROR] Line 79: No source code is available for type com.sencha.gxt.chart.client.draw.RGB; did you forget to inherit a required module?
[ERROR] Line 84: No source code is available for type com.sencha.gxt.chart.client.chart.axis.CategoryAxis<M,V>; did you forget to inherit a required module?
[ERROR] Line 85: No source code is available for type com.sencha.gxt.chart.client.chart.Chart<M>.Position; did you forget to inherit a required module?
[ERROR] Line 87: No source code is available for type com.sencha.gxt.chart.client.draw.sprite.TextSprite; did you forget to inherit a required module?
[ERROR] Line 102: No source code is available for type com.sencha.gxt.chart.client.chart.series.BarSeries<M>; did you forget to inherit a required module?
[ERROR] Unable to find type 'com.project.client.Chart_Demo'
[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
Exception in thread "pool-1-thread-1" java.lang.RuntimeException: Unable to read from byte cache
Please help me to resolve this issue.
wilome is right. The <inherits>-tags in the module descriptor are missing.
But it looks like Ranjeet is using GXT 3.
In this case it schould be:
<inherits name='com.sencha.gxt.ui.GXT'/>
<inherits name='com.sencha.gxt.chart.Chart' />
You need to inherit the GXT modules in your main module (yourapp.gwt.xml)
<inherits name="com.extjs.gxt.ui.GXT" />
<inherits name="com.extjs.gxt.themes.Themes" />
<inherits name="com.extjs.gxt.charts.Chart" />
It's been about 5 hrs since I decided to use JSR 303 Bean Validation in my GWT project and I gotta say I can't even express (politely) how deeply unsatisfied I am with lame documentation on the subject on Google's website.
I really hope you guys can help me.
I followed this blog post to add client-side bean validation to my project. Unfortunately it worked only once and threw an exception in runtime saying that I need to add Hibernate Validation sources to class path. I fixed that and decided to remassage my dependencies a little too (biggest mistake of my life) but I couldn't make it work ever again.
I can't play with Validation sample from GWT SDK either because it's uncompilable because it has two implementations of class ServerValidator. Weird.
So to simplify my question I created dummy GWT application using project wizard of IntelliJ IDEA.
I added following elements to module xml:
<inherits name="org.hibernate.validator.HibernateValidator"/>
<replace-with class="com.mySampleApplication.client.ClientValidatorFactory">
<when-type-is class="javax.validation.ValidatorFactory"/>
</replace-with>
Created ClientValidatorFactory:
package com.mySampleApplication.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
import com.google.gwt.validation.client.GwtValidation;
import com.google.gwt.validation.client.impl.AbstractGwtValidator;
import javax.validation.Validator;
import javax.validation.groups.Default;
public class ClientValidatorFactory extends AbstractGwtValidatorFactory
{
#GwtValidation(value = {Organization.class}, groups = {Default.class, ClientGroup.class})
public interface GwtValidator extends Validator
{
}
#Override
public AbstractGwtValidator createValidator()
{
return GWT.create(GwtValidator.class);
}
}
And in onModuleLoad() method I added this single line which causes compiler to blow up
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
And finally I used following jars which I copied from Validation sample of GWT SDK.
hibernate-validator-4.1.0.Final-sources.jar
hibernate-validator-4.1.0.Final.jar
log4j-1.2.16.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
validation-api-1.0.0.GA-sources.jar
validation-api-1.0.0.GA.jar
But when I compile my project it gives following meaningless error:
In detailed GWT compiler log I see this:
Loaded 2315 units from persistent store.
Found 2282 cached units. Used 2282 / 2282 units from cache.
Added 0 units to persistent cache.
Validating newly compiled units
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java'
Line 33: No source code is available for type org.hibernate.validator.engine.ConstraintViolationImpl<T>; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/engine/ValidationSupport.java'
Line 43: No source code is available for type org.hibernate.validator.engine.ConstraintViolationImpl<T>; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/EmailValidator.java'
Line 25: No source code is available for type org.hibernate.validator.constraints.Email; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/ScriptAssertValidator.java'
Line 26: No source code is available for type org.hibernate.validator.constraints.Email; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/URLValidator.java'
Line 26: No source code is available for type org.hibernate.validator.constraints.URL; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java'
Line 72: No source code is available for type org.hibernate.validator.engine.NodeImpl; did you forget to inherit a required module?
Why can't it find classses? I have hibernate-validator-4.1.0.Final-sources.jar in my classpath.
Any thoughts ?
I uploaded my project here if you guys want to play with it.
Case closed, guys. Error was caused by lack of hibernate validation sources in classpath because of bug in IntelliJ IDEA. Details are here.
I am trying to use GWT xml parser but the compiler throws next
[ERROR] Line 62: No source code is available for type
com.google.gwt.xml.client.Document; did you forget to inherit a
required module?
[ERROR] Line 62: No source code is available for type com.google.gwt.xml.client.XMLParser; did you forget to inherit a
required module?
[ERROR] Line 63: No source code is available for type com.google.gwt.xml.client.Element; did you forget to inherit a
required module?
[ERROR] Line 65: No source code is available for type com.google.gwt.xml.client.NodeList; did you forget to inherit a
required module?
[ERROR] Line 69: No source code is available for type com.google.gwt.xml.client.Node; did you forget to inherit a required
module?
I don't get it how to solve the problem because import code gives no errors :( Help
It seems I was to add to my gwt.xml code like a
<inherits name="com.google.gwt.xml.XML"/>
then code compiled :)
I hope this saves one's day