2010-12-14 109 views
0

J'ai démarré une simple application modulaire maven (parent et webapp), avec google gwt dans netbeans et il semble que j'ai déjà commencé erreur:Problème de classes de points d'entrée dans les projets Netbeans 6.9, maven 2 et gwt 2.1.0

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

J'utilise NetBeans 6.9 et mon pom recherche comme parent: ce

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

Voici la pom webapp:

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

Ma principale classe poin d'entrée est comme ceci:

//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 ressemble à ceci:

<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 est comme ceci:

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

Non, je suis venu à travers ce gwt-maven plugin example je pense que là où je suis plutôt perdu. Alors, qu'est-ce qui peut concrètement être la cause de cette erreur? un problème de classpath ou un problème maven-plugin ou j'ai même besoin de plus de configuration?

Merci d'avoir lu ce post plutôt long, mais c'est par souci de précision. Et si vous pensez que c'est mieux, je passe à eclipse (STS) s'il vous plaît laissez-moi avoir votre avis.

Répondre

0

J'ai le même problème:

  1. paquet de changement de nom avec MainEntryPoint en tant que client dernier sous-ensemble (ex com.mycompany.mainproject.adminwebapp.frontend.client.)
  2. mis main.gwt.xml à dir exectly avec le paquet client (ex/com/mycompany/mainproject/adminwebapp/frontend).