0
votes

I have a maven-based GWT project (GWTApplication) which includes two java libraries (which are also maven-based) - entity and metadata.

Entity's pom.xml:

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

Metadata's pom.xml:

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

Main project's 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>

When I try to compile this project (clean and build) output shows errors:

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

Of course I have inherited these modules in *.gwt.xml file:

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

In eclipse this project compiles with no problems, but in NetBeans during compilation I see those errors. Did I miss something?

Thanks for any help.

1

1 Answers

2
votes

You should to include java classes to your gwt-metadata jar file. Add to pom (gwt-metadata):

<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>

or

<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>