gpt4 book ai didi

java - 无法在 NetBeans 中构建 GWT 项目

转载 作者:行者123 更新时间:2023-12-02 07:54:35 26 4
gpt4 key购买 nike

我有一个基于 Maven 的 GWT 项目(GWTApplication),其中包括两个 Java 库(也是基于 Maven 的) - 实体元数据 em>.

实体的pom.xml:

<groupId>com.gfa.gwt</groupId>
<artifactId>gwt-entity</artifactId>
<packaging>jar</packaging>
<version>0.1</version>

元数据的pom.xml:

<groupId>com.gfa.gwt</groupId>
<artifactId>gwt-metadata</artifactId>
<packaging>jar</packaging>
<version>0.1</version>

主项目的pom.xml:

<dependencies>
<dependency>
<groupId>com.gfa.gwt</groupId>
<artifactId>gwt-metadata</artifactId>
<version>0.1</version>
</dependency>

<dependency>
<groupId>com.gfa.gwt</groupId>
<artifactId>gwt-entity</artifactId>
<version>0.1</version>
</dependency>
...
</dependencies>

当我尝试编译此项目(清理和构建)时,输出显示错误:

Compiling module test.application.Application Validating newly compiled units Ignored 42 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 'file:~/workspace/GwtApplication/src/main/java/test/application/client/ApplicationPoint.java' [ERROR] Line 97: No source code is available for type com.gfa.gwt.entity.shared.InstancesLookuper; did you forget to inherit a required module? [ERROR] Line 97: No source code is available for type com.gfa.gwt.metadata.client.MetaDataApi; did you forget to inherit a required module? [ERROR] Unable to find type 'test.application.client.ApplicationPoint' [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 "UnitWriteThread" java.lang.RuntimeException: Unable to read from byte cache at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:196) at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:91) at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) at com.google.gwt.dev.javac.PersistentUnitCache$UnitWriter.run(PersistentUnitCache.java:226) Caused by: java.io.IOException: Stream Closed at java.io.RandomAccessFile.seek(Native Method) at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:182) ... 14 more

当然我在*.gwt.xml文件中继承了这些模块:

<inherits name="com.gfa.gwt.metadata.MetaData"/>
<inherits name="com.gfa.gwt.entity.Entity"/>

在 Eclipse 中,该项目编译没有问题,但在 NetBeans 中编译期间我看到了这些错误。我错过了什么吗?

感谢您的帮助。

最佳答案

您应该将 java 类包含到您的 gwt-metadata jar 文件中。添加到pom(gwt-元数据):

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/client/**</include>
<include>**/shared/**</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

关于java - 无法在 NetBeans 中构建 GWT 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9804101/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com