Thanks to Vitali for answering this so promptly, so in the effort of teamwork, I'll attempt to follow up and answer ds's inquiry.
Every modern programming language needs a "container" to run it's code in. Java has a container, .Net has a container, even old Visual Basic had a container. Not trying to be condescending here, just trying to be clear. Most modern software development is done using a high order language which at the end of the compilation process, what is produced by a compiler is native programming code. OK, so far? The application container that runs Javascript is also known as a web browser. GWT is a compiler that compiles high order Java code into the native language of the browser, Javascript. So the GWT compiler needs to know how to convert Java code into Javascript. And that's the power of GWT. But the container dictates what can be compiled, or said another way, if the container can't or won't allow something that perhaps you can do in the higher order language, it's the compiler's "job" to tell you that. The browser as an application container, has very strict rules placed upon it. No amount of Javascript running in a browser can directly access the file system of the client. Need to dig into the client system and get things like IP addresses and info like that? The browser can't allow code to do that. The browser is also single threaded so any threading access can't be done. All of these things (and many more) are very, very easy to do in Java. We've got the File class, System.IO, all of those libraries out there. And even though it is very simple to do in Java, since Javascript can't do it, GWT can't compile the resulting Javascript code out. And that's what these errors mean. In so many words, these errors are saying "you are trying to get me to create Javascript from Java code that the browser will not allow." The GWT guys have done and continue to do an amazing job of creating a compiler that turns Java into Javascript. Virtually everything you can do in a browser, in Javascript is available to you in the GWT Java development process. But there are literally thousands of libraries that you won't be able to use in the browser, that they are not going to move into GWT or more appropriately, that they *can't* move into GWT. Not a Google/GWT problem, but a Javascript/Browser "problem". If you take a look at http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=RefJreEmulation you'll see everything that GWT can do. The basic rule is that if you can do it in Javascript, GWT can do it. Hopefully this helps. If you do a search in these forums, you'll see these error messages and this discussion repeated throughout. Good luck! Later, Shaffer On Mar 9, 3:21 am, ds <[email protected]> wrote: > Hi, > Would be nice if you could please explain it in detail. I am also > facing the same probem. How can I overcome the same. I have added a > crimson-1.1.3.jar in order to import javax.xml.parsers,org.w3c.dom and > org.xml.sax packages in a GWt-Ext app. But when I run my app, I get > "Line 31: No source code is available for type > javax.xml.parsers.DocumentBuilderFactory; did you forget to inherit a > required module?" > "Line 32: No source code is available for type > javax.xml.parsers.DocumentBuilder; did you forget to inherit a > required module?" > "Line 33: No source code is available for type org.w3c.dom.Document; > did you forget to inherit a required module?" > > Thanks > ds > > On Mar 9, 10:51 am, Vitali Lovich <[email protected]> wrote: > > > GWT only implements a very small portion of the JRE (a lot of stuff is not > > available from a browser context anyways). So what you're trying to do > > apparently is use a Java library within your client code which more likely > > than not will not work. > > > GWT has two parts to it. Client code that is java translated into > > javascript run on the browser & server code which is regular java code > > running on a traditional app server. > > > Hope this helps > > > On Mon, Mar 9, 2009 at 12:48 AM, jonathan <[email protected]> wrote: > > > > my gwt app relies on external libraries such as > > > java.beans.PropertyChangeEvent and my own custom classes from another > > > eclipse project. > > > what's the best way of incorporating them? > > > I added these libs to gwt compiler classpath, but I get > > > [ERROR] Line 70: No source code is available for type > > > java.beans.PropertyC > > > hangeEvent; did you forget to inherit a required module? > > > > Do I have to make all external dependencies into a module? please > > > help. > > > thanks!- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
