开发者

GWT Module inheritance and NO source code available on application running time

I am starting to use GWT for a c开发者_C百科lass project and wanted to know real use cases for RPC. So, I found this example on this same website: Stack Overflow - Simple RPC Use Case Problem (Code Included)

Why I did this example? because I was getting the same errors that the user posted on my own project and I decided to try and follow his code on my computer to see if I could really face my own mistakes.

So the point is that after copying the files on an Eclipse GWT project and deploy the app, I got this two errors on running time:

1st Error

12:14:07.874 [ERROR] [test] Line 17: No source code is available for type com.google.gwt.user.server.rpc.RemoteServiceServlet; did you forget to inherit a required module?

2nd Error

12:42:54.547 [ERROR] [test] Unable to find type 'org.redboffin.worldhug.client.test.Test'

12:14:09.341 [ERROR] [test] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

So I tried to correct Test.gwt.xml as Craig suggested on the post. Unfortunately, that solution is not working to me because still I am getting the same errors.

1st error: I don't know what is happening because, for example, in the file it is depicted, RemoteServiceServlet is imported some rows before (despite it is not seen). This file is on package "org.redboffin.worldhug.server.test;"

2nd error: If user who posted initial thread did not need to "inherit" a new package in his project, I can't understand why do I need them. Anyway, I put a new inherit line one the .gwt.xml file:

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

And that is what I got:

 Loading inherited module 'org.redboffin.worldhug.client.test.Test'
     [ERROR] Unable to find 'org/redboffin/worldhug/client/test/Test.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

(of course, it didn't compile)

So, I really don't know what is going on. Please, can someone bring some light to this issue? Why is this not working? What I am doing bad? What is this type that it is needed on the 2nd error?


Hello Irene and other Web-Wanderers,

Maybe this is a double post on a already answered post or let me say it is a try to clarify about includes of Java Source code in the xml file. I got stuck at the same point, but I couldn't point out what Adrian meant. The last two source tags will tell what packages and trailed source files shall be compiled. That is why you should name each package in the attribute called "path".

The file below was auto-generated in Eclipse Indigo in Framework version: appengine-java-sdk-1.6.4.1. It is bereft of unnecessary comments.

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='wk_cms'>
  <!-- Inherit the core Web Toolkit stuff. -->
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.json.JSON'/>
  <inherits name='com.google.gwt.http.HTTP'/>

   <inherits name='com.google.gwt.user.theme.chrome.Chrome'/>

  <!-- Other module inherits -->

  <!-- Specify the app entry point class. -->
  <entry-point class='de.someproject.wkcms.client.Wk_cms'/>

  <!-- Specify the paths for translatable code -->
  <source path='client'/>         <<-- my code (package client)
  <source path='communication'/>  <<-- my code (package communication)
</module>

I hope this keeps everyone afar from probing and testing before having success... =)

Best regards, Semo

PS. The file edited was not web.xml but PROJECTNAME.gwt.xml.


Think I see it:

Test.java should be in the client.test package not just client, or everything should point to client.Test rather than client.test.Test.


Your server class seems to be under the package server.test, rather than just server, which is probably wrong. Check the mapping in web.xml correctly points to this class.

I suspect the real error is probably somewhere else though - I would have expected it still to compile.


(Not sure if I have to "answer your question" or not, first try on Stack Overflow site!)

Thanks for your comment, Adrian!

This is the content of "web.xml" file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<!-- Servlets -->

<servlet>
    <servlet-name>testServlet</servlet-name>
    <servlet-class>org.redboffin.worldhug.server.test.TestServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>testServlet</servlet-name>
    <url-pattern>/worldhug/test/testService</url-pattern>
</servlet-mapping>

<!-- Default page to serve -->
<welcome-file-list>
    <welcome-file>test.html</welcome-file>
</welcome-file-list>
</web-app>

It seems that the servlet tag is pointing to the right place to my eyes: TestServiceImpl.java is inside package "org.redboffin.worldhug.server.test" Did you mean that?

Any other idea?

Thank you again! :)


You will have to include the following

<source path='client.test'/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜