开发者

Finding entry point classes problem in Netbeans 6.9, maven 2 and gwt 2.1.0 project

I've started a simple maven modular application (parent and webapp), with google gwt in netbeans and it seems i've started having already this error:

[ERROR] Unable to find type 'com.mycompany.mainproject.adminwebapp.frontend.MainEntryPoint' [ERROR] Hint: Previous compiler errors may have made this type unavailable

i'm using netbeans 6.9 and my parent pom looking like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.mainproject</groupId>
<artifactId>admin</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>MAdmin</name>
<url>http://maven.apache.org</url>
......
 <modules>
    <module>mtbadmin-webapp</module>
</modules>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>2.1.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>2.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.extjs</groupId>
            <artifactId>gxt</artifactId>
            <version>2.2.0</version>
        </dependency>
    </dependencies>
</dependencyManagement>
</project>

Here is the webapp pom :

<dependencies>
   <!-- all the parent's pom dependency without version tags are here-->
</dependencies>


<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1-beta-1</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.1.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>generateAsync</goal>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <finalName>adminWebapp</finalName>
</build>
<profiles>
    <profile>
        <id>endorsed</id>
        <activation>
            <property>
                <n开发者_Python百科ame>sun.boot.class.path</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.0.2</version>
                    <configuration>
                        <!-- javaee6 contains upgrades of APIs contained within the JDK itself.
                             As such these need to be placed on the bootclasspath, rather than classpath of the
                             compiler.
                             If you don't make use of these new updated API, you can delete the profile.
                             On non-SUN jdk, you will need to create a similar profile for your jdk, with the similar property as sun.boot.class.path in Sun's JDK.-->
                        <compilerArguments>
                            <bootclasspath>${settings.localRepository}/javax/javaee-endorsed-api/6.0/javaee-endorsed-api-6.0.jar${path.separator}${sun.boot.class.path}</bootclasspath>
                        </compilerArguments>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>javax</groupId>
                            <artifactId>javaee-endorsed-api</artifactId>
                            <version>6.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
    <tomcat.home>${env.CATALINA_HOME}</tomcat.home>
    <web.context>${project.parent.artifactId}</web.context>
</properties>

My main entry poin class is like this:

//com.mycompany.mainproject.adminwebapp.frontend
public class MainEntryPoint implements EntryPoint {

public MainEntryPoint() {
} 

@Override
public void onModuleLoad() {
    final Label lb = new Label("click this button");
    final  Button btnTest = new Button("test me");

    btnTest.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            lb.setVisible(!lb.isVisible());
        }
    });
    RootPanel.get().add(lb);
    RootPanel.get().add(btnTest);

}

}

main.gwt.xml looks like this :

<module>
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.extjs.gxt.ui.GXT"/>
<entry-point class="com.mycompany.mainproject.adminwebapp.frontend.MainEntryPoint"/>
<inherits name="com.google.gwt.user.theme.standard.Standard"/> 

</module>

web.xml is like this :

<welcome-file-list>
    <welcome-file>index.html</welcome-file> <!--index file only have doctype and body-->
</welcome-file-list>

No i've come accross this gwt-maven plugin example i think that where i'm rather lost. So what concretely can be the cause of this error? a classpath problem or a maven-plugin problem or i even need more configuration?

Thanks for reading this rather long post , but it's for the sake of precision.and if you think it's best i switch to eclipse (STS) please let me have your insight.


I have the same trouble:

  1. rename package with MainEntryPoint as client last sub-package (ex. com.mycompany.mainproject.adminwebapp.frontend.client)
  2. put main.gwt.xml at dir exectly with client package (ex /com/mycompany/mainproject/adminwebapp/frontend).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜