resty gwt:Deferred binding failed for 'com.gwt.demo.client.PersonResourceAsync - resty-gwt

Hi i want to do project in gwt which is at client side and rest services at the server side,for this i am using resty gwt but i am getting an error:
com.google.gwt.event.shared.UmbrellaException: Exception caught: Deferred binding failed for 'com.gwt.demo.client.PersonResourceAsync' (did you forget to inherit a required module?).
Project description:-
ide:- eclipse
I am using resty gwt jar and i have included that jar from add external jar.I have also included in the gwt.xml as (<inherits name='org.fusesource.restygwt.RestyGWT'/>).I have also added that jar in war file lib folder. I have used one interface which extends restservice,in this interface while debugging i found that in the line i am getting nullpointerexception.
instance = GWT.create(PersonResourceAsync.class);
Please help me why i am getting this error?

Are you sure restyGWT jar is in your classpath ?
Can you post the code of your PersonResourceAsync ? Does it extends the RestService interface ?
Maybe you can have a look this tutorial

Related

include gwt-graphics into a Eclipse WebApp-Project

I try to include the gwt-graphics library into a WebApp-Project made with Eclipse.
This is the description: https://code.google.com/archive/p/gwt-graphics/wikis/Manual.wiki
"Download gwt-graphics.jar and add it to the class path of your GWT project. In addition, you have to add the following line to the GWT module file: After these two steps, you are ready to use GWT Graphics in your GWT project!"
I have done this and after I start the app in super-dev-mode, I got an error from the compiler:
"[ERROR] Unable to find 'org/vaadin/gwtgraphics/GWTGraphics.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?"
I am not sure how I can solve this.
Did you add it to the class path? If not, you can right click to the jar file and do Add to Classpath

How to Correctly use com.mattbertolini.hermes.Hermes to manage Constants at Server side (GWT)?

Ok, I want to manage Constants at Server level, so com.mattbertolini.hermes.Hermes is a solution.
Please see all my steps:
1- I downloaded hermes-1.2.0.jar & import into correct Library of eclipse (no problem)
2- Create MyConstantsWithLookup.java at client package
import com.google.gwt.i18n.client.ConstantsWithLookup;
public interface MyConstantsWithLookup extends ConstantsWithLookup {
String myMsg();
}
3- create MyConstantsWithLookup.properties file in the same client package. The file has this line:
myMsg=Deleted
4- In ServerData.java in Server package
MyConstantsWithLookup my = Hermes.get(MyConstantsWithLookup.class, "");
String extra=my.myMsg();
When tested in eclipse it works fine but I got Warnign message in eclipse:
[WARN] Server class 'com.ibm.icu.util.ULocale' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.0.v201212122042-rel-r42/gwt-2.5.0/gwt-dev.jar' to the web app classpath for this session
For additional info see: file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.0.v201212122042-rel-r42/gwt-2.5.0/doc/helpInfo/webAppClassPath.html
I am not sure what this warning's about? is it serious?
The code was running ok but why eclipse generated this warning?
This class (com.ibm.icu.util.ULocale) is a replacement for java.util.Locale, so it seems Hermes has a dependency on it.
Download the ICU4J jar from http://site.icu-project.org/download and add it to your project's build path.
Source: Matt Bertolini at https://github.com/mattbertolini/Hermes/issues/3
You need to add the ICU4j jar located at http://site.icu-project.org/
to your classpath. The reason you have the ICU classes inside the
gwt-dev.jar is because GWT includes them for its Java to JavaScript
compiler. This is regrettable since it often times falsely reports the
files on your classpath.

NoClassDefFoundError: in Google App Engine app while creating Gson instance

Is there something tricky about using Gson in Google App Engine App? I placed gson jar in war/lib and included it in the build path. I'm using Eclipse.
Code compiles however app keeps failing at line:
Gson gson = new Gson();
with:
java.lang.NoClassDefFoundError: com/google/gson/Gson
A NoClassDefFoundError specifies that you have a particular class available at compile time but missing or not initialized during runtime. In your case com/google/gson/Gson class is found at compile time as gson jar is in your lib. But during runtime it is either not present or not initialized. Check for a conflict of gson jar or if there is an ExceptionInInitializerError in the stacktrace. You may further understand it here - Debugging a NoClassDefFoundError
I know GAE by name only, but I have that kind of error in Eclipse when I have a dynamic web project and I forget to deploy libs I used to build.
So, maybe you can solve by going into Deployment Assembly section of your project and add libs that you have in your build path.
The problem was that I placed library under war/libs and not under war/WEB-INF/lib

Unable to create editor ID org.eclipse.jst.pagedesigner.PageDesignerEditor: An unexpected exception was thrown

when i added JSF support to my project, following this tutorial
http://www.mkyong.com/jsf2/how-to-make-eclipse-ide-supports-jsf-2-0/
after restarting the eclipse, i am getting the error:
Unable to create editor ID org.eclipse.jst.pagedesigner.PageDesignerEditor: An unexpected exception was thrown.
any ideas why, and how to solve it ?
UPDATE:
when i tried to select java server faces again from the project facets, i found that it says on the right:
Conflicts with the following facets:
Application Client module
Dynamic Web Module
EAR
EJB Module
JCA Module
Static Web Module
Utility Module
Web Fragment Module
i was having JSF and ICEFaces dependencies in my pom, and i was having their libraries too in the classpath, fixed the error by removing them, and adding JSF,icefaces capabilities to my project, everything works fine now.

Only a type can be imported. org.apache.poi.hssf.usermodel.HSSFWorkbook resolves to a package

Trying to use Apache POI in a Eclipse JSP project. The POI jar is in the project's Java Resources Library list.
<%# page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
at run the following error occurs:
An error occurred at line: 7 in the
generated java file Only a type can be
imported.
org.apache.poi.hssf.usermodel.HSSFWorkbook
resolves to a package
Any ideas? Thanks
Don Lawton
The message indicates that the class could not be found on the classpath of your deployed application. Did you make sure that the POI jar is in your WEB-INF/lib folder?
Same happened to me, even when the needed jars were indeed in the WEB-INF folder.
I was using the provided server in SpringSource ToolSuite (STS). It took me several attempts to clean, republish, etc... before it finally worked.