有什么可以帮助我理解为什么我的应用程序在运行时抛出此错误的原因mvn gwt:compile
:
[INFO] Compiling module org.jboss.errai.ui.demo.App
[INFO] Scanning for additional dependencies: jar:file:/home/xkm/.m2/repository/org/jboss/errai/errai-ioc/2.2.0.Final/errai-ioc-2.2.0.Final.jar!/org/jboss/errai/ioc/client/Container.java
[INFO] Computing all possible rebind results for 'org.jboss.errai.ioc.client.QualifierEqualityFactory'
[INFO] Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO] Generating Extensions Bootstrapper...
[ERROR] Apr 07, 2013 1:39:10 PM org.jboss.errai.reflections.Reflections scan
[ERROR] INFO: Reflections took 1387 ms to scan 12 urls, producing 403 keys and 1809 values [using 2 cores]
[INFO] Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Computing all possible rebind results for 'org.jboss.errai.ioc.client.Bootstrapper'
[INFO] Rebinding org.jboss.errai.ioc.client.Bootstrapper
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
[INFO] Generating Extensions Bootstrapper...
[ERROR] Apr 07, 2013 1:39:11 PM org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator generate
[ERROR] INFO: generating IOC bootstrapping class...
[ERROR] Apr 07, 2013 1:39:11 PM org.jboss.errai.config.rebind.EnvUtil getAllReachableClasses
[ERROR] WARNING: reachability analysis disabled. errai may generate unnecessary code.
[ERROR] Apr 07, 2013 1:39:11 PM org.jboss.errai.config.rebind.EnvUtil getAllReachableClasses
[ERROR] WARNING: enable reachability analysis with -Derrai.compile.perf.perform_reachability_analysis=true
[INFO] Checking ErraiApp.properties for configured types ...
[ERROR] Apr 07, 2013 1:39:13 PM org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator generate
[ERROR] INFO: generated IOC bootstrapping class in 1827ms (4034 beans processed)
[ERROR] Apr 07, 2013 1:39:13 PM org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator generate
[ERROR] INFO: using IOC bootstrapping code at: /home/xkm/juno/workspace/myapp/.errai/BootstrapperImpl.java
[INFO] Rebinding org.jboss.errai.ioc.client.Bootstrapper
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.Bootstrapper
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.Bootstrapper
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.Bootstrapper
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Rebinding org.jboss.errai.ioc.client.Bootstrapper
[INFO] Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
[INFO] Generating Extensions Bootstrapper...
[INFO] Scanning for additional dependencies: jar:file:/home/xkm/.m2/repository/org/jboss/errai/errai-marshalling/2.2.0.Final/errai-marshalling-2.2.0.Final.jar!/org/jboss/errai/marshalling/client/api/MarshallerFramework.java
[INFO] Computing all possible rebind results for 'org.jboss.errai.marshalling.client.api.MarshallerFactory'
[INFO] Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
[INFO] Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
[INFO] Generating Marshallers Bootstrapper...
[ERROR] Apr 07, 2013 1:39:13 PM org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory generate
[ERROR] INFO: generating marshalling class...
[ERROR] Apr 07, 2013 1:39:14 PM org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory generate
[ERROR] INFO: generated marshalling class in 583ms.
[ERROR] Apr 07, 2013 1:39:14 PM org.jboss.errai.marshalling.rebind.MarshallersGenerator _generate
[ERROR] INFO: considering '/home/xkm/juno/workspace/myapp/src/main/webapp/WEB-INF/classes/' as module output path ...
[ERROR] Apr 07, 2013 1:39:14 PM org.jboss.errai.marshalling.rebind.MarshallersGenerator _generate
[ERROR] INFO: found '/home/xkm/juno/workspace/myapp/src/main/webapp/WEB-INF/classes' output directory
[ERROR] Apr 07, 2013 1:39:15 PM org.jboss.errai.marshalling.rebind.MarshallersGenerator _generate
[ERROR] INFO: ** deposited marshaller class in : /home/xkm/juno/workspace/myapp/src/main/webapp/WEB-INF/classes
[ERROR] Apr 07, 2013 1:39:15 PM org.jboss.errai.config.rebind.EnvUtil getAllReachableClasses
[ERROR] WARNING: reachability analysis disabled. errai may generate unnecessary code.
[ERROR] Apr 07, 2013 1:39:15 PM org.jboss.errai.config.rebind.EnvUtil getAllReachableClasses
[ERROR] WARNING: enable reachability analysis with -Derrai.compile.perf.perform_reachability_analysis=true
[ERROR] Apr 07, 2013 1:39:15 PM org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory generate
[ERROR] INFO: generating marshalling class...
[ERROR] Apr 07, 2013 1:39:15 PM org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory generate
[ERROR] INFO: generated marshalling class in 509ms.
[INFO] Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
[INFO] Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
[INFO] Generating Marshallers Bootstrapper...
[INFO] Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
[INFO] Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
[INFO] Generating Marshallers Bootstrapper...
[INFO] Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
[INFO] Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
[INFO] Generating Marshallers Bootstrapper...
[INFO] Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
[INFO] Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
[INFO] Generating Marshallers Bootstrapper...
[INFO] Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
[INFO] Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
[INFO] Generating Marshallers Bootstrapper...
[ERROR] Apr 07, 2013 1:39:17 PM org.jboss.errai.bus.rebind.RpcProxyLoaderGenerator generate
[ERROR] INFO: generating rpc proxy loader class.
[INFO] Scanning for additional dependencies: /home/xkm/juno/workspace/myapp/target/.generated/org/jboss/errai/ioc/client/BootstrapperImpl.java
[INFO] Computing all possible rebind results for 'org.jboss.errai.ioc.client.BootstrapperImpl.org_jboss_errai_ui_demo_client_local_PasswordRequiredPageTemplateResource'
[INFO] Rebinding org.jboss.errai.ioc.client.BootstrapperImpl.org_jboss_errai_ui_demo_client_local_PasswordRequiredPageTemplateResource
[INFO] Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
[INFO] Creating assignment for getContents()
[INFO] Finding resources
[INFO] [ERROR] Resource org/jboss/errai/ui/demo/client/local/PasswordRequiredPage.html not found. Is the name specified as Class.getResource() would expect?
[INFO] [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
[INFO] [WARN] org.jboss.errai.ioc.client.BootstrapperImpl_org_jboss_errai_ui_demo_client_local_PasswordRequiredPageTemplateResource_default_InlineClientBundleGenerator
[INFO] [ERROR] Errors in '/home/xkm/juno/workspace/myapp/target/.generated/org/jboss/errai/ioc/client/BootstrapperImpl.java'
[INFO] [ERROR] Line 149: Failed to resolve 'org.jboss.errai.ioc.client.BootstrapperImpl.org_jboss_errai_ui_demo_client_local_PasswordRequiredPageTemplateResource' via deferred binding
[ERROR] Apr 07, 2013 1:39:21 PM org.jboss.errai.databinding.rebind.BindableProxyLoaderGenerator generate
[ERROR] INFO: generating bindable proxy loader class.
[ERROR] Apr 07, 2013 1:39:21 PM org.jboss.errai.enterprise.rebind.JaxrsProxyLoaderGenerator generate
[ERROR] INFO: generating jax-rs proxy loader class.
[INFO] [ERROR] Cannot proceed due to previous errors
深入查看代码,我可以看到:
[ERROR] Resource org/jboss/errai/ui/demo/client/local/PasswordRequiredPage.html not found. Is the name specified as Class.getResource() would expect?
但是html页面在那里有相应的PasswordRequiredPage.java:
PasswordRequiredPage.java:
@Dependent
@Templated("#passwordrequired")
@Page
public class PasswordRequiredPage extends Composite {
}
PasswordRequiredPage.html:
<div data-field="passwordrequired">
<!-- Content -->
</div>
我的应用程序可能出了什么问题?我已经搞定了:
- mvn clean (SUCCESS)
- mvn gwt:compile (FAIL)
- mvn gwt:run (FAILE)
最佳答案
尽管PasswordRequiredPage.html
与PasswordRequiredPage.java
放在同一文件夹中,但是当gwt-compiler运行时,它应该位于类路径中。
您可以通过两种方式修复它:
将PasswordRequiredPage.html
复制到Java编译器生成PasswordRequiredPage.class
的文件夹中,完成配置maven-resources-plugin的操作(目标复制资源)
将.html
所在的源文件夹添加到编译类路径中。
我从没用过Errai,也不知道它如何使用gwt编译器,但是由于某种原因,它正在向类路径中添加.java文件(也可能是.css和.png),但没有.html文件。