PDA

View Full Version : Need help setting up GXT project in Eclipse



catacaustic
30 Apr 2009, 8:33 PM
I know this is supposed to be the most basic thing that I can do, but I can't seem to get it to work.

I'm using Eclipse 3.4, and I've installed the Google plugin for it. I've created a new GWT 'Web Application' project using GWT 1.6.4 that gives me all of the files that I need. This runs fine as long as I don't want to import any GXT components into it. I've added the GXT 2.0 M1 library to the project and that shows up fine. When I try to include GXT in the projects XML file using
<inherits name="com.extjs.gxt.ui.GXT" />I get this error:
[ERROR] Line 16: Unexpected exception while processing element 'inherits'
java.lang.NoClassDefFoundError: com/google/gwt/core/ext/Generator
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClass0(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.google.gwt.dev.cfg.ModuleDefSchema$ObjAttrCvt.convertToArg(ModuleDefSchema.java:720)
at com.google.gwt.dev.util.xml.HandlerArgs.convertToArg(HandlerArgs.java:64)
at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:214)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:257)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:314)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48)
at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:385)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:243)
at com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__inherits_begin(ModuleDefSchema.java:212)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:223)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:257)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:314)
at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48)
at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:385)
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:243)
at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:155)
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:269)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:127)
at com.google.gwt.dev.HostedModeBase.loadModule(HostedModeBase.java:536)
at com.google.gwt.dev.HostedMode.loadModule(HostedMode.java:426)
at com.google.gwt.dev.HostedMode.doStartup(HostedMode.java:351)
at com.google.gwt.dev.HostedModeBase.startUp(HostedModeBase.java:585)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:397)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)Line 16 in the XML file is the line that inherits GXT, as I've shown above. Firstly I thought that I was just trying to get it from the wrong place, but I've changed around where I thought it should be, and it tells me that it could not be found. Then I changed it back to this, which I have seen is correct, and the error occurs again.

Does anyone out there know what this means, and where I've gone wrong. I'm 99% sure that it's something small that I've forgotten. Any pointers greatfully accepted!!

Motaro
6 Jul 2009, 3:58 PM
I'm having the same problem, don't seem to understand why can't find the class. Did you found a way to solve it?

catacaustic
6 Jul 2009, 4:14 PM
The only way that I could get anything to work with that project was to scrap it completely and start again right from the start. I don't remember doing anything differently, but it seemed to work. The same thing has happened on a few projects since that too, and I think that a lot of the time it's either me missing a tiny step, or Eclipse just skips something when it tries to set up the details.

markmacumber
6 Jul 2009, 5:53 PM
From my experience in this area, it seems that when you get the classes NoClassDefFoundError it means that your runtime class path in not right, obviously, your app compiles, which means your eclipse classpath that builds it IS correct.

When you run your app, can you look at the execution command that eclipse generates and see if it has the correct classpath setup?

Motaro
7 Jul 2009, 5:52 PM
where can I see the command that is being run?

markmacumber
7 Jul 2009, 6:11 PM
switch to the debug perspective, and you can see it in the Debug view... "right-click" on the running thread and click on "properties", there should be a panel called "Command Line"