0

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> 
ali
  • 25
  • 1
  • 1
  • 9
  • Have you checked if your server starts without errors? Set the LogLevel to TRACE and check wether there are messages inside of "newly compiled units". – El Hoss Jan 27 '14 at 16:57
  • there is something like that while server is starting. "WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.". yes, i have tried and search for "newly compiled units" but there is nothing in the message. – ali Jan 27 '14 at 17:23
  • To avoid the warning: https://groups.google.com/forum/#!topic/google-web-toolkit/LQfsBSwD_ug – El Hoss Jan 27 '14 at 19:12
  • But I think, that's not your problem. Please, can youpost the enter class and ui.xml. – El Hoss Jan 27 '14 at 19:13
  • ok i have added the enter class and xml file. Can you plese look again? – ali Jan 27 '14 at 20:14
  • Your code is ok. just created a small GWT project and it works. Check the link and the hints to solve it. It looks like you have a Java configuration problem. – El Hoss Jan 27 '14 at 21:06
  • Have you tried this: open regedit.exe ( really hate Microsoft and their regedit.reg). change the permission of key: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft.....Right click the icon, then change the permission to full operation. – El Hoss Jan 27 '14 at 21:07
  • oops! it's not worth it:). i'll create a new project with different name. thank you so much for your concern. – ali Jan 27 '14 at 21:27

1 Answers1

0

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

Churro
  • 4,166
  • 3
  • 25
  • 26
  • i didn't change, but to be sure i have checked "war" directory and didn't notice suspicious name. – ali Jan 27 '14 at 17:27