生成器在重新绑定时抛出异常 [英] Generator threw an exception while rebinding

查看:132
本文介绍了生成器在重新绑定时抛出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发GPS监控系统的前端。我需要添加新功能 - 地理围栏。我已经创建了geofence模型和它的PropertyAccess接口。
当我编译项目时出现错误:

以下是geofence的模型:

 public class Geofence extends JavaScriptObject {

protected Geofence(){}
$ b $ public final int int getId()/ * - {return this.id; } - * /;
public final native String getName()/ * - {return this.name; } - * /;
public final String getDescription()/ * - {return this.description; } - * /;
public final native Type getType()/ * - {return this.type; } - * /;
public final native Coordinate [] getCoordinates()/ * - {return this.coordinates; } - * /;
public final native double getRadius()/ * - {return this.radius; } - * /;
public final int int getUserId()/ * - {return this.userId; } - * /;

public final void setId(int id)/ * - {this.id = id; } - * /;
public final void setName(String name)/ * - {this.name = name; } - * /;
public final void setDescription(String description)/ * - {this.description = description; } - * /;
public final native void setType(Type type)/ * - {this.type = type; } - * /;
public final native void setCoordinates(Coordinate [] coordinates)/ * - {this.coordinates = coordinates; } - * /;
public final native void setRadius(double radius)/ * - {this.radius = radius; } - * /;
public final void setUserId(int userId)/ * - {this.userId = userId; } - * /;

public final String getEmpty(){
return;
}
}

以及访问其属性的界面:

  public interface GeofenceProperties扩展了PropertyAccess< Geofence> {

@ Editor.Path(id)
ModelKeyProvider< Geofence>键();

ValueProvider< Geofence,Integer> ID();
ValueProvider< Geofence,String>名称();
ValueProvider< Geofence,String>描述();
ValueProvider< Geofence,Coordinate []>坐标();
ValueProvider< Geofence,Double>半径();
ValueProvider< Geofence,Integer>用户名();
ValueProvider< Geofence,String>空();

$ / code>

这是错误:


使用-strict编译或使用-logLevel设置为TRACE或DEBUG以查看所有错误。
计算为 'org.bitbucket.treklab.client.model.GeofenceProperties'
重新绑定org.bitbucket.treklab.client.model.GeofenceProperties
调用发电机com.sencha.gxt所有可能重新绑定结果.data.rebind.PropertyAccessGenerator
[错误]生成器'com.sencha.gxt.data.rebind.PropertyAccessGenerator'在重新绑定'org.bitbucket.treklab.client.model.GeofenceProperties'时发生异常
java .lang.NullPointerException
at com.sencha.gxt.data.rebind.ValueProviderCreator.typesMatch(ValueProviderCreator.java:315)
at com.sencha.gxt.data.rebind.ValueProviderCreator.getSetterExpression(ValueProviderCreator。 Java的:297)
处com.sencha.gxt.data.rebind.ValueProviderCreator.create(ValueProviderCreator com.sencha.gxt.data.rebind.ValueProviderCreator.appendSetterBody(ValueProviderCreator.java:134)
。 java:93)
at com.sencha.gxt.core.rebind.Abs tractCreator.create(AbstractCreator.java:48)
at com.sencha.gxt.data.rebind.PropertyAccessGenerator.generate(PropertyAccessGenerator.java:94)
com.google.gwt.core.ext。 IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
,位于com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:760)
,位于com.google.gwt.dev.cfg。 RuleGenerateWith.realize(RuleGenerateWith.java:160)维持在com.google.gwt.dev com.google.gwt.dev.shell.StandardRebindOracle $ Rebinder.rebind(StandardRebindOracle.java:79)

。 shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
处com.google.gwt.dev com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)
。 DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87)
在com.google.gwt.dev.jjs.impl.UnifyAst $ UnifyVisitor.createStaticRebind表达式(UnifyAst.java:485)
,位于com.google.gwt.dev.jjs.impl.UnifyAst $ UnifyVisitor.createRebindExpression(UnifyAst.java:443)
,位于com.google.gwt.dev。 jjs.impl.UnifyAst $ UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576)
在com.google.gwt.dev.jjs.impl.UnifyAst $ UnifyVisitor.endVisit(UnifyAst.java:306)
。在com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
位于com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java :285)
,位于com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
位于com.google.gwt.dev.jjs.ast.JCastOperation.traverse (JCastOperation.java:67)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
位于com.google.gwt.dev.jjs.ast .JModVisitor.accept(JModVisitor.java:293)
com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
,位于com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
在com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:49)
在com.google.gwt.dev.jjs.ast.JModVisitor $ ListContext.traverse( JModVisitor.java:95)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)
,位于com.google.gwt.dev.jjs.ast。 JBlock.traverse(JBlock.java:92)
位于com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
位于com.google.gwt.dev。 jjs.ast.JModVisitor.accept(JModVisitor.java:293)
位于com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149)
位于com.google。 gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145)
at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.ja va:381)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
位于com.google.gwt.dev.jjs.ast.JModVisitor。在com.google.gwt.dev.jjs.ast.JMethod.visitChildren接受(JModVisitor.java:285)
(com.google.gwt.dev.jjs处为
)(JMethod.java:600)
。 ast.JMethod.traverse(JMethod.java:569)
位于com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
位于com.google.gwt。您可以通过com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
(com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505)
,位于com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870)
。在com.google.gwt.dev.jjs.JavaToJavaScriptCompiler $ Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305)
在com.google.gwt.dev.jjs.JavaToJavaScriptCompiler $ Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038 )
在com。 google.gwt.dev.jjs.JavaToJavaScriptCompiler $ Precompiler.precompile(JavaToJavaScriptCompiler.java:954)
在com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303)
。在com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:286)
at com。 google.gwt.dev.Precompile.precompile(Precompile.java:229)
在com.google.gwt.dev.Precompile.precompile(预编译.java:145)
在com.google.gwt。 dev.Compiler.run(Compiler.java:206)
,位于com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:333)
,位于com.google.gwt.dev。 codeserver.Recompiler.compile(Recompiler.java:161)
在com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:119)
在com.google.gwt.dev。 codeserver.Outbox.recompile(Outbox.java:128)
,位于com.google.gwt.dev.codeserver.JobR unner.recompile(JobRunner.java:81)
在com.google.gwt.dev.codeserver.JobRunner.access $ 100(JobRunner.java:34)
在com.google.gwt.dev.codeserver .JobRunner $ 2.run(JobRunner.java:73)
at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run( FutureTask.java:266)在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
在java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:617

at java.lang.Thread.run(Thread.java:745)
[错误]'org / bitbucket / treklab / client / view / DeviceView.java'中的错误
[错误]第145行:无法通过延迟绑定来解析'org.bitbucket.treklab.client.model.GeofenceProperties'
计算'org.bitbucket.treklab.client.resources.Resources'的所有可能重新绑定结果
重新绑定org.bitbucket.treklab.client.resource s.Resources
调用生成器com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
准备方法cogWheel
[WARN]资源'org / bitbucket / treklab / client / theme / icon / cogWheel.png'通过ClassLoader来定位。因此,该资源的更改不会反映在每个文件重新编译中。它应该通过或在您的.gwt.xml中进行注册。在将来的GWT版本中,我们将删除此回退并且您的应用程序将停止编译
[WARN]对于以下类型,生成的源从未提交(您是否忘记调用commit()?)
[WARN] org.bitbucket.treklab.client.model.GeofencePropertiesImpl
[WARN] org.bitbucket.treklab.client.model.Geofence_coordinates_ValueProviderImpl
计算为org.bitbucket所有可能重新绑定结果。 treklab.client.model.GeofenceProperties'
重新绑定org.bitbucket.treklab.client.model.GeofenceProperties
调用生成器com.sencha.gxt.data.rebind.PropertyAccessGenerator
[错误]生成器' com.sencha.gxt.data.rebind.PropertyAccessGenerator org.bitbucket.treklab.client.model.GeofenceProperties '
显示java.lang.NullPointerException
在com.sencha.gxt,而重新绑定抛出一个异常'。 data.rebind.ValueProviderCreator.type SMATCH(ValueProviderCreator.java:315)
处com.sencha.gxt.data.rebind.ValueProviderCreator com.sencha.gxt.data.rebind.ValueProviderCreator.getSetterExpression(ValueProviderCreator.java:297)
。 appendSetterBody(ValueProviderCreator.java:134)
at com.sencha.gxt.data.rebind.ValueProviderCreator.create(ValueProviderCreator.java:93)
at com.sencha.gxt.core.rebind.AbstractCreator。在com.google.gwt.core.ext.IncrementalGenerator中创建(AbstractCreator.java:48)
在com.sencha.gxt.data.rebind.PropertyAccessGenerator.generate(PropertyAccessGenerator.java:94)
。 generateNonIncrementally(IncrementalGenerator.java:40)
处com.google.gwt.dev.cfg.RuleGenerateWith com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:760)
。通过com.google.gwt.dev.shell.StandardRebindOracle实现(RuleGenerateWith.java:160)
$ Rebinder.rebind(StandardRebindOracle.java:79)
在com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
在com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)
在com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87)
com.google.gwt.dev.jjs.impl.UnifyAst $ UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485)
。在com.google.gwt.dev.jjs.impl.UnifyAst $ UnifyVisitor.createRebindExpression(UnifyAst.java:443)
在com.google.gwt.dev.jjs.impl.UnifyAst $ UnifyVisitor.handleMagicMethodCall( UnifyAst.java:576)
,位于com.google.gwt.dev.jjs.impl.UnifyAst $ UnifyVisitor.endVisit(UnifyAst.java:306)
,位于com.google.gwt.dev.jjs。 ast.JMethodCall.traverse(JMethodCall.java:248)
位于com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
位于com.google.gwt。 dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
,位于com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
在com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67)
在com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java :381)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
位于com.google.gwt.dev.jjs.ast.JModVisitor.accept (JModVisitor.java:285)
,位于com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
,位于com.google.gwt.dev.jjs.ast .JDeclarationStatement.traverse(JDeclarationStatement.java:49)
,位于com.google.gwt.dev.jjs.ast.JModVisitor $ ListContext.traverse(JModVisitor.java:95)
,位于com.google.gwt .dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)
at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
at com .google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor .java:381)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
,位于com.google.gwt.dev.jjs.ast.JVisitor .accept(JVisitor.java:149)
,位于com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145)
,位于com.google.gwt.dev.jjs .ast.JMethodBody.traverse(JMethodBody.java:83)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
,位于com.google.gwt .dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
at com .google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600)
,位于com.google.gwt.dev.jjs.ast.JConstructor.traverse(JConstructor.java:142)$ b $ com com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java: 293)
,位于com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505)
,位于com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler $ Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler $ Precompiler.constructJavaAst(JavaToJavaScriptCompiler。 Java的:1038)
在com.google.gwt.dev.jjs.JavaToJavaScriptCompiler $ Precompiler.precompile(JavaToJavaScriptCompiler.java:954)
在com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile( MonolithicJavaToJavaScriptCompiler.java:303)
,位于com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38)
,位于com.google.gwt.dev.Precompile.precompile(预编译。 java:286)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
,位于com.google.gwt.dev。 Compiler.run(Compiler.java:206)
位于com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:333)
位于com.google.gwt.dev.codeserver。 Recompiler.compile(Recompiler.java:161)
位于com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:119)
位于com.google.gwt.dev.codeserver。 Outbox.recompile(Outbox.java:128)
位于com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:81)
位于com.google.gwt.dev.codeserver。 JobRunner.access $ 100(JobRunner.java:34)
,位于com.google.gwt.dev.codeserver.JobRunner $ 2.run(JobRunner.java:73)
,位于java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)
在java.util.concurrent.FutureTask.run(FutureTask.java:266)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: (java.util.concurrent.ThreadPoolExecutor)
$ Worker.run(ThreadPoolExecutor.java:617)$ b $在java.lang.Thread.run(Thread.j ava:745)
[错误]'org / bitbucket / treklab / client / Application.java'中的错误
[错误]第43行:无法解析'org.bitbucket.treklab.client.model。 GeofenceProperties'通过延迟绑定
[WARN]对于以下类型,生成的源文件从未提交过(您是否忘记调用commit()?)
[WARN] org.bitbucket.treklab.client .model.Geofence_coordinates_ValueProviderImpl
[WARN] org.bitbucket.treklab.client.model.GeofencePropertiesImpl
统一遍历1267个字段和方法以及1208个类型。 18个被认为是当前模块的一部分,18个已经遍历了所有的领域和方法。
[WARN]一些陈旧的类型([org.bitbucket.treklab.client.model.Geofence_description_ValueProviderImpl,org.bitbucket.treklab.client.model.GeofencePropertiesImpl,org.bitbucket.treklab.client.model.Geofence_userId_ValueProviderImpl,org。 bitbucket.treklab.client.model.Geofence_coordinates_ValueProviderImpl,org.bitbucket.treklab.client.model.Geofence_radius_ValueProviderImpl,org.bitbucket.treklab.client.model.Geofence_name_ValueProviderImpl,org.bitbucket.treklab.client.model.Geofence_id_ModelKeyProviderImpl,org.bitbucket。 treklab.client.model.Geofence_empty_ValueProviderImpl,org.bitbucket.treklab.client.model.Geofence_id_ValueProviderImpl])未按照预期重新处理。这是一个编译器错误,或者一个Generator已经合法地停止创建这些类型。
[错误]编译器返回false
[WARN]重新编译失败
[WARN]继续提供以前的版本

但是当我改变时

 坐标[] 

  List< Coordinate> 

一切正常。

解决方案


com.sencha.gxt.data.rebind.PropertyAccessGenerator [错误]生成器'com.sencha.gxt.data.rebind.PropertyAccessGenerator'在com.sencha.gxt.data.rebind中重新绑定'org.bitbucket.treklab.client.model.GeofenceProperties'java.lang.NullPointerException时抛出异常。 ValueProviderCreator.typesMatch(ValueProviderCreator.java:315)...


来自ValueProviderCreator.java:


$ (b.isPrimitive()!= null){
返回a.getQualifiedSourceName();
pre $ ().equals(b.isPrimitive()getQualifiedBoxedSourceName());
} else {
assert b.isClassOrInterface()!= null;

返回b.isClassOrInterface()。isAssignableTo(a);




$ b这个代码(我几年前写的,但我今天不为Sencha工作)假定您的bean属性中的类型是基元或对象(或接口)。在GWT中,显然这排除了使用数组的可能性。从GWT的JArrayType:

  public JClassType isClass(){
//故意为空
return null;
}

您需要提交GXT本身的错误来改变它。但是,无论如何,你的代码可能无法工作(并且几乎可以肯定这是你的问题的根源在无法将JSON字符串解析为GWT中的Java / JavaScriptObject ,另一个问题):

你不能拥有JavaScriptObject的属性是非JavaScript类型。 GWT生成的数组几乎看起来像js数组,但会丢失重要的类型细节,而java.util.List根本不起作用。



改为将 getCoordinates 更改为 JsArray< Coordinate>


I develop the front-end for the GPS-monitoring system. I need to add the new feature - geofence. I have created geofence model and its PropertyAccess interface. When I compile the project I getting the error:

Here is the model of geofence:

public class Geofence extends JavaScriptObject {

protected Geofence() {}

public final native int getId() /*-{ return this.id; }-*/;
public final native String getName() /*-{ return this.name; }-*/;
public final native String getDescription() /*-{ return this.description; }-*/;
public final native Type getType() /*-{ return this.type; }-*/;
public final native Coordinate[] getCoordinates() /*-{ return this.coordinates; }-*/;
public final native double getRadius() /*-{ return this.radius; }-*/;
public final native int getUserId() /*-{ return this.userId; }-*/;

public final native void setId(int id) /*-{ this.id = id; }-*/;
public final native void setName(String name) /*-{ this.name = name; }-*/;
public final native void setDescription(String description) /*-{ this.description = description; }-*/;
public final native void setType(Type type) /*-{ this.type = type; }-*/;
public final native void setCoordinates(Coordinate[] coordinates) /*-{ this.coordinates = coordinates; }-*/;
public final native void setRadius(double radius) /*-{ this.radius = radius; }-*/;
public final native void setUserId(int userId) /*-{ this.userId = userId; }-*/;

public final String getEmpty() {
    return "";
}
}

and the interface to access its properties:

public interface GeofenceProperties extends PropertyAccess<Geofence> {

@Editor.Path("id")
ModelKeyProvider<Geofence> key();

ValueProvider<Geofence, Integer> id();
ValueProvider<Geofence, String> name();
ValueProvider<Geofence, String> description();
ValueProvider<Geofence, Coordinate[]> coordinates();
ValueProvider<Geofence, Double> radius();
ValueProvider<Geofence, Integer> userId();
ValueProvider<Geofence, String> empty();
}

Here is the error:

Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. Computing all possible rebind results for 'org.bitbucket.treklab.client.model.GeofenceProperties' Rebinding org.bitbucket.treklab.client.model.GeofenceProperties Invoking generator com.sencha.gxt.data.rebind.PropertyAccessGenerator [ERROR] Generator 'com.sencha.gxt.data.rebind.PropertyAccessGenerator' threw an exception while rebinding 'org.bitbucket.treklab.client.model.GeofenceProperties' java.lang.NullPointerException at com.sencha.gxt.data.rebind.ValueProviderCreator.typesMatch(ValueProviderCreator.java:315) at com.sencha.gxt.data.rebind.ValueProviderCreator.getSetterExpression(ValueProviderCreator.java:297) at com.sencha.gxt.data.rebind.ValueProviderCreator.appendSetterBody(ValueProviderCreator.java:134) at com.sencha.gxt.data.rebind.ValueProviderCreator.create(ValueProviderCreator.java:93) at com.sencha.gxt.core.rebind.AbstractCreator.create(AbstractCreator.java:48) at com.sencha.gxt.data.rebind.PropertyAccessGenerator.generate(PropertyAccessGenerator.java:94) at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40) at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:760) at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:160) at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79) at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276) at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265) at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:443) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:306) at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) at com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:49) at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95) at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351) at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145) at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600) at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:569) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505) at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954) at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303) at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38) at com.google.gwt.dev.Precompile.precompile(Precompile.java:286) at com.google.gwt.dev.Precompile.precompile(Precompile.java:229) at com.google.gwt.dev.Precompile.precompile(Precompile.java:145) at com.google.gwt.dev.Compiler.run(Compiler.java:206) at com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:333) at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:161) at com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:119) at com.google.gwt.dev.codeserver.Outbox.recompile(Outbox.java:128) at com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:81) at com.google.gwt.dev.codeserver.JobRunner.access$100(JobRunner.java:34) at com.google.gwt.dev.codeserver.JobRunner$2.run(JobRunner.java:73) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) [ERROR] Errors in 'org/bitbucket/treklab/client/view/DeviceView.java' [ERROR] Line 145: Failed to resolve 'org.bitbucket.treklab.client.model.GeofenceProperties' via deferred binding Computing all possible rebind results for 'org.bitbucket.treklab.client.resources.Resources' Rebinding org.bitbucket.treklab.client.resources.Resources Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator Preparing method cogWheel [WARN] Resource 'org/bitbucket/treklab/client/theme/icon/cogWheel.png' was located via ClassLoader. As a result changes in that resource will not be reflected in per-file recompiles. It should be registered via or entry in your .gwt.xml. In a future version of GWT, we will remove this fallback and your application will stop compiling [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?) [WARN] org.bitbucket.treklab.client.model.GeofencePropertiesImpl [WARN] org.bitbucket.treklab.client.model.Geofence_coordinates_ValueProviderImpl Computing all possible rebind results for 'org.bitbucket.treklab.client.model.GeofenceProperties' Rebinding org.bitbucket.treklab.client.model.GeofenceProperties Invoking generator com.sencha.gxt.data.rebind.PropertyAccessGenerator [ERROR] Generator 'com.sencha.gxt.data.rebind.PropertyAccessGenerator' threw an exception while rebinding 'org.bitbucket.treklab.client.model.GeofenceProperties' java.lang.NullPointerException at com.sencha.gxt.data.rebind.ValueProviderCreator.typesMatch(ValueProviderCreator.java:315) at com.sencha.gxt.data.rebind.ValueProviderCreator.getSetterExpression(ValueProviderCreator.java:297) at com.sencha.gxt.data.rebind.ValueProviderCreator.appendSetterBody(ValueProviderCreator.java:134) at com.sencha.gxt.data.rebind.ValueProviderCreator.create(ValueProviderCreator.java:93) at com.sencha.gxt.core.rebind.AbstractCreator.create(AbstractCreator.java:48) at com.sencha.gxt.data.rebind.PropertyAccessGenerator.generate(PropertyAccessGenerator.java:94) at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40) at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:760) at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:160) at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79) at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276) at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265) at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:443) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576) at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:306) at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128) at com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:49) at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95) at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351) at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149) at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145) at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600) at com.google.gwt.dev.jjs.ast.JConstructor.traverse(JConstructor.java:142) at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285) at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505) at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954) at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303) at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38) at com.google.gwt.dev.Precompile.precompile(Precompile.java:286) at com.google.gwt.dev.Precompile.precompile(Precompile.java:229) at com.google.gwt.dev.Precompile.precompile(Precompile.java:145) at com.google.gwt.dev.Compiler.run(Compiler.java:206) at com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:333) at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:161) at com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:119) at com.google.gwt.dev.codeserver.Outbox.recompile(Outbox.java:128) at com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:81) at com.google.gwt.dev.codeserver.JobRunner.access$100(JobRunner.java:34) at com.google.gwt.dev.codeserver.JobRunner$2.run(JobRunner.java:73) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) [ERROR] Errors in 'org/bitbucket/treklab/client/Application.java' [ERROR] Line 43: Failed to resolve 'org.bitbucket.treklab.client.model.GeofenceProperties' via deferred binding [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?) [WARN] org.bitbucket.treklab.client.model.Geofence_coordinates_ValueProviderImpl [WARN] org.bitbucket.treklab.client.model.GeofencePropertiesImpl Unification traversed 1267 fields and methods and 1208 types. 18 are considered part of the current module and 18 had all of their fields and methods traversed. [WARN] Some stale types ([org.bitbucket.treklab.client.model.Geofence_description_ValueProviderImpl, org.bitbucket.treklab.client.model.GeofencePropertiesImpl, org.bitbucket.treklab.client.model.Geofence_userId_ValueProviderImpl, org.bitbucket.treklab.client.model.Geofence_coordinates_ValueProviderImpl, org.bitbucket.treklab.client.model.Geofence_radius_ValueProviderImpl, org.bitbucket.treklab.client.model.Geofence_name_ValueProviderImpl, org.bitbucket.treklab.client.model.Geofence_id_ModelKeyProviderImpl, org.bitbucket.treklab.client.model.Geofence_empty_ValueProviderImpl, org.bitbucket.treklab.client.model.Geofence_id_ValueProviderImpl]) were not reprocessed as was expected. This is either a compiler bug or a Generator has legitimately stopped creating these types. [ERROR] Compiler returned false [WARN] recompile failed [WARN] continuing to serve previous version

But when I change

Coordinate[] 

to

List<Coordinate>

all works fine. Where I made a mistake?

解决方案

com.sencha.gxt.data.rebind.PropertyAccessGenerator [ERROR] Generator 'com.sencha.gxt.data.rebind.PropertyAccessGenerator' threw an exception while rebinding 'org.bitbucket.treklab.client.model.GeofenceProperties' java.lang.NullPointerException at com.sencha.gxt.data.rebind.ValueProviderCreator.typesMatch(ValueProviderCreator.java:315)...

From ValueProviderCreator.java:

private boolean typesMatch(JClassType a, JType b) {
  if (b.isPrimitive() != null) {
    return a.getQualifiedSourceName().equals(b.isPrimitive().getQualifiedBoxedSourceName());
  } else {
    assert b.isClassOrInterface() != null;

    return b.isClassOrInterface().isAssignableTo(a);
  }
}

This code (which I actually wrote several years ago, but I don't work for Sencha today) assumes either that the type in your bean property is either a primitive or an object (or interface). In GWT, apparently this excludes the possibility of using an array. From GWT's JArrayType:

public JClassType isClass() {
  // intentional null
  return null;
}

You'll need to file a bug with GXT itself to get this changed. However, your code might not work after this anyway (and almost certainly this is the root of your problem in Can't parse JSON string to Java/JavaScriptObject in GWT, your other question):

You can't have a JavaScriptObject's properties be non-JavaScript types. GWT's generated arrays almost look like js arrays, but will be missing important type details, and java.util.List won't work at all.

Instead, change your getCoordinates to return JsArray<Coordinate>.

这篇关于生成器在重新绑定时抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆