2010-12-14 2 views
0

Я начал простое модульное приложение maven (parent и webapp) с google gwt в netbeans и, похоже, у меня уже есть этот ошибка:Поиск проблемы классов точек входа в Netbeans 6.9, maven 2 и gwt 2.1.0 project

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

я использую NetBeans 6.9 и мой родитель POM вида:

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

Вот 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> 

Мой главный класс входа POIN как это:

//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 выглядит следующим образом:

<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, как это:

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

Нет, я пришел к этому gwt-maven plugin example Я думаю, что там, где я скорее потерян. И что конкретно может быть причиной этой ошибки? проблема с classpath или проблема с maven-plugin или мне даже нужна дополнительная настройка?

Спасибо, что прочитали этот довольно длинный пост, но это ради точности. И если вы считаете, что лучше переключиться на затмение (STS), пожалуйста, дайте мне понять.

ответ

0

У меня такая же проблема:

  1. переименовать пакет с MainEntryPoint как клиент последний суб-пакет (например, com.mycompany.mainproject.adminwebapp.frontend.client.)
  2. пут main.gwt.xml в реальном времени с клиентским пакетом (ex/com/mycompany/mainproject/adminwebapp/frontend).
Смежные вопросы