PDA

View Full Version : error in beta4 Mail demo



mjmsmith
2 Jun 2008, 1:55 PM
After successfully building the beta4 Mail sample, I get the following error when I run it:

[ERROR] Unable to instantiate 'com.extjs.gxt.samples.mail.server.MailServiceImpl'
java.lang.ClassNotFoundException: com.extjs.gxt.samples.mail.server.MailServiceImpl

This is on OS X 10.5.3 with java version "1.5.0_13".

gslender
2 Jun 2008, 2:06 PM
how exactly are you launching it? the error is saying it can't find the classes specified so perhaps something is missing in your launch config.

mjmsmith
2 Jun 2008, 2:17 PM
I edited Mail-compile.sh and Mail-shell.sh as follows:

- added "-Xmx512M"
- changed GWT_HOME to point to my GWT dir (1.5RC1)
- changed "gwt-dev-linux.jar" to "gwt-dev-mac.jar" in the classpath

I also added "-XstartOnFirstThread" to Mail-shell.sh.

I built/launched it by running the shell script from the samples/mail dir.

The sample loads ok initially. I don't get the error until after the login dialog goes away and the "EXT GWT Mail Demo" interface is displayed.

gslender
2 Jun 2008, 3:08 PM
ok - so did you javac compile the mail have source into a directory called bin?

the shell script is only looking in these locations for the java compile classes... do any of these match?

src:
.:
../bin:

posta07
3 Jun 2008, 7:11 AM
I too am getting the error mjmsmith is getting.
I am on windows with GWT 1.5 RC1 and GXT beta 4.

Please help me understand why I am getting this error.

Thanks!


[ERROR] Unable to instantiate 'com.extjs.gxt.samples.mail.server.MailServiceImpl'
java.lang.ClassNotFoundException: com.extjs.gxt.samples.mail.server.MailServiceImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName(Class.java:169)
at com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:952)
at com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:278)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

mjmsmith
3 Jun 2008, 7:32 AM
ok - so did you javac compile the mail have source into a directory called bin?

I'm sorry, I don't understand the question.

I've done a successful build with Mail-compile.sh. The server-side MailServerImpl.java file doesn't get compiled into a class file anywhere. The class file is present in the pre-existing mail.war, but perhaps I'm unclear on how to run the server. What would be the normal process for getting the mail sample up and running?

gslender
3 Jun 2008, 1:26 PM
there are two parts to a GWT hosted application (if you are using RPC)

1) the client side which is compiled from java source

2) the server side which is a native java application that needs to be compiled and launched by the tomcat web server - servlet container

you are doing 1 but not 2

war files contain both 1 and 2 but are used by 2 to publish 1 and launch 2

gwt compiler just does 1

javac can compile 2 for use by gwt hosted mode (which contains tomcat for 2 and a browser for 1)

gsmd
30 Sep 2008, 10:32 PM
same here.
unpacked, changed the paths in Mail-shell.cmd, run it. get exactly the same

[ERROR] Unable to instantiate 'com.extjs.gxt.samples.mail.server.MailServiceImpl'
winxp, ext 1.1, gwt 1.5.2.

mgallinucci
24 Feb 2009, 2:08 AM
I have the same problem: I changed GWT_HOME to my gwt install dir, and I get the same problem...

[ERROR] Unable to instantiate 'com.extjs.gxt.samples.mail.server.MailServiceImpl'

It seems that it doesn't compile src from resources project (MailServiceImpl has imports from that project). The Mail-shell.cmd include also resources/src folder, so it should compile also that classes.

I really don't understand how to work the example! :((

posta07
24 Feb 2009, 6:47 AM
You need to compile the server side classes yourself (using javac for example). The GWT compile (or hosted mode) script DOES NOT compile the server-side classes for you.

See grant's post:



there are two parts to a GWT hosted application (if you are using RPC)

1) the client side which is compiled from java source

2) the server side which is a native java application that needs to be compiled and launched by the tomcat web server - servlet container

you are doing 1 but not 2

war files contain both 1 and 2 but are used by 2 to publish 1 and launch 2

gwt compiler just does 1

javac can compile 2 for use by gwt hosted mode (which contains tomcat for 2 and a browser for 1)

mgallinucci
24 Feb 2009, 7:22 AM
I thought that executing *-shell.cmd was enough to run the example. I still don't understand why the script doesn't compile server classes, but I'll resign myself to this.
So, I just need to compile server classes; is there a way to use hosted browser (to use GWT's integrated Tomcat), or must I use an external Tomcat, deploy war file with server classes and use a common browser?

posta07
24 Feb 2009, 8:43 AM
The *-shell.cmd files do not compile anything. They launch the "Hosted mode" shell with the application.

The *-compile.cmd files do not compile java to classes. It only compiles Java to JavaScript.

You're responsible for compiling server-side resources (which makes sense, because you're free to use any kind of implementation on the server side, it's not GWT-specific necessarily).

I would suggest you look at using Eclipse to do you development with GWT/Ext-GWT, and look at this presentation for setting up your Eclipse environment:

http://extjs.com/helpcenter/index.jsp?topic=/com.extjs.gxt.help/html/gettingstarted/setup.html

mgallinucci
25 Feb 2009, 12:35 AM
Thank you Christian, now I understand what scripts do, you've been very clear.
I think that GWT's getting started (http://code.google.com/intl/it-IT/webtoolkit/gettingstarted.html) isn't so much clear too...



Running in Hosted Mode

To run the Mail sample in hosted mode, navigate to the samples/Mail/ directory and run the Mail-shell script. This will open the GWT browser with the Mail application running inside
Ok, it starts GWT browser, but tell me that the application is running only if you previously built server code and deployed to your web server... >:)