简体   繁体   中英

gwt compiler can't find entry point classes

i'm trying to run a gwt application which is giving me this errors.

[ERROR] [studentsystem2] - Unable to find type 'com.example.studentsystem2.client.StudentSystem2'
[ERROR] [studentsystem2] - Unable to find type 'com.example.studentsystem2.client.StudentSystem2'
[ERROR] [studentsystem2] - Unable to find type 'com.example.studentsystem2.client.StudentSystem2'
[ERROR] [studentsystem2] - Unable to find type 'com.example.studentsystem2.client.StudentSystem2'
[ERROR] [studentsystem2] - Unable to find type 'com.example.studentsystem2.client.StudentSystem2'

What should i have to do?

here is my classes and xml files.

StudentSystem2.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
  "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='studentsystem2'>
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.clean.Clean'/>
  <entry-point class='com.example.studentsystem2.client.StudentSystem2'/>
  <source path='client'/>
  <source path='shared'/>
</module>

StudentSystem2.java

package com.example.studentsystem2.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;


public class StudentSystem2 implements EntryPoint {

    public void onModuleLoad() {

        RootPanel.get().add(new Enter());

    }
}

Here is the Enter.java code.

package com.example.studentsystem2.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class Enter extends Composite implements HasText {

    private static EnterUiBinder uiBinder = GWT.create(EnterUiBinder.class);
    @UiField Label SId;
    @UiField Label name;
    @UiField Label department;
    @UiField Button addButton;
    @UiField Label label;
    @UiField TextBox IdTextField;
    @UiField TextBox nameTextField;
    @UiField TextBox departmentTextField;




    interface EnterUiBinder extends UiBinder<Widget, Enter> {
    }

    public Enter() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    public Enter(String firstName) {
        initWidget(uiBinder.createAndBindUi(this));
        addButton.setText(firstName);
    }

    public void setText(String text) {
        addButton.setText(text);
    }

    public String getText() {
        return addButton.getText();
    }


    @UiHandler("label")
    void onLabelClick(ClickEvent event) {

    }
    @UiHandler("addButton")
    void onAddButtonClick(ClickEvent event) {




    }
}

and the Enter.ui.xml file

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <ui:style>
    .important {
        font-weight: bold;
    }
    </ui:style>
    <g:HTMLPanel>
        <g:AbsolutePanel height="377px">
            <g:at left="10" top="48">
                <g:Label text="StudentId" ui:field="SId"/>
            </g:at>
            <g:at left="10" top="117">
                <g:Label text="Name" ui:field="name"/>
            </g:at>
            <g:at left="10" top="190">
                <g:Label text="Department" ui:field="department"/>
            </g:at>
            <g:at left="128" top="32">
                <g:TextBox ui:field="IdTextField"/>
            </g:at>
            <g:at left="128" top="101">
                <g:TextBox ui:field="nameTextField"/>
            </g:at>
            <g:at left="128" top="174">
                <g:TextBox ui:field="departmentTextField"/>
            </g:at>
            <g:at left="172" top="237">
                <g:Button width="101px" height="30px" text="Add" ui:field="addButton"/>
            </g:at>
            <g:at left="17" top="287">
                <g:Label text="See Students" ui:field="label"/>
            </g:at>
        </g:AbsolutePanel>
    </g:HTMLPanel>
</ui:UiBinder> 

Did you change your project/package name since you created the project? If so, make sure the new name matches the one in the "GWT Compile" window, and the "Run" window.

Also make sure your Project's directory structure looks like the one in the image: 还要确保您项目的目录结构看起来像图像中的目录结构。

If you did change the name, you should delete the old compiled output in the war/<old project name> directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM