The service interface is implemented by a servlet. It is not exclusively a client side class.
On Thu, Feb 19, 2009 at 8:33 AM, scarlson <[email protected]> wrote: > > I caught this just a minute ago, I didn't realize there were compiled > class on the client side, I assumed all of that turned into > javascript? Interesting.. So any client side RPC code gets compiled > into java class?? > > Thanks. > Scarlson > > On Feb 18, 3:51 pm, Isaac Truett <[email protected]> wrote: >> > java.lang.ClassNotFoundException: com.i2s.webMonster.client.MsgService >> >> You didn't deploy this class. >> >> On Wed, Feb 18, 2009 at 3:08 PM, scarlson <[email protected]> wrote: >> >> > Hello All -- I've been to the Tomcat forums already originally >> > thinking it was a servlet container issue. I don't think this is the >> > case anymore. >> >> > I have made a simple generic gwt rpc module.. When I run in hosted >> > mode, everything is great. When I deploy my WAR file, the client side >> > stuff works, but no servlet. Does anything jump out?? I've been >> > fighting this for a couple of days.. I keep coming back to the >> > conclusion that my container is configured wrong. >> >> > A bit more info about container.. I'm running Ubuntu 8.10 / Apache2 / >> > tomcat6 / mod-proxy >> > Apache and Tomcat appear fully functional.. I have also successfully >> > added a proxy to take me to port 8080 when calling my webapp. I've >> > posted similar data to TomCat forum, and judging from responses, I >> > have the container properly configured? >> >> > I've also tried re-arranging my WEB-INF/ structure... >> > It was original WEB-INF/classes/MsgServiceImpl.class >> > not it is WEB-INF/classes/com/i2s/webMonster/server/ >> > MsgServiceImpl.class >> >> > I don't think I have a clue at this point... >> >> > Thanks in Advance, Attached below are my code/logs >> >> > -Scarlson >> >> > --- Tomcat localhost log file output --------- >> > SEVERE: Allocate exception for servlet MsgService >> > java.lang.ClassNotFoundException: com.i2s.webMonster.client.MsgService >> > at org.apache.catalina.loader.WebappClassLoader.loadClass >> > (WebappClassLoader.java:1387) >> > at org.apache.catalina.loader.WebappClassLoader.loadClass >> > (WebappClassLoader.java:1233) >> > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) >> > at java.lang.ClassLoader.defineClass1(Native Method) >> > at java.lang.ClassLoader.defineClass(ClassLoader.java:621) >> > at >> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java: >> > 124) >> > at org.apache.catalina.loader.WebappClassLoader.findClassInternal >> > (WebappClassLoader.java:1847) >> > at org.apache.catalina.loader.WebappClassLoader.findClass >> > (WebappClassLoader.java:890) >> > at org.apache.catalina.loader.WebappClassLoader.loadClass >> > (WebappClassLoader.java:1354) >> > at org.apache.catalina.loader.WebappClassLoader.loadClass >> > (WebappClassLoader.java:1233) >> > at org.apache.catalina.core.StandardWrapper$1.run >> > (StandardWrapper.java:1077) >> > at java.security.AccessController.doPrivileged(Native Method) >> > at org.apache.catalina.core.StandardWrapper.loadServlet >> > (StandardWrapper.java:1073) >> > at org.apache.catalina.core.StandardWrapper.allocate >> > (StandardWrapper.java:808) >> > at org.apache.catalina.core.StandardWrapperValve.invoke >> > (StandardWrapperValve.java:129) >> > at org.apache.catalina.core.StandardContextValve.invoke >> > (StandardContextValve.java:191) >> > at org.apache.catalina.core.StandardHostValve.invoke >> > (StandardHostValve.java:128) >> > at org.apache.catalina.valves.ErrorReportValve.invoke >> > (ErrorReportValve.java:102) >> > at org.apache.catalina.core.StandardEngineValve.invoke >> > (StandardEngineValve.java:109) >> > at org.apache.catalina.valves.AccessLogValve.invoke >> > (AccessLogValve.java:568) >> > at org.apache.catalina.connector.CoyoteAdapter.service >> > (CoyoteAdapter.java:286) >> > at org.apache.coyote.http11.Http11Processor.process >> > (Http11Processor.java:845) >> > at org.apache.coyote.http11.Http11Protocol >> > $Http11ConnectionHandler.process(Http11Protocol.java:583) >> > at >> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: >> > 447) >> > at java.lang.Thread.run(Thread.java:619) >> > ---------------------snip >> >> > ----------- web.xml ----------------- >> > <?xml version="1.0" encoding="UTF-8"?> >> > <web-app> >> >> > <!-- Standard Action Servlet Configuration --> >> > <servlet> >> > <servlet-name>MsgService</servlet-name> >> > <servlet-class>com.i2s.webMonster.server.MsgServiceImpl</servlet- >> > class> >> > </servlet> >> >> > <!-- Standard Action Servlet Mapping --> >> > <servlet-mapping> >> > <servlet-name>MsgService</servlet-name> >> > <url-pattern>/MsgService</url-pattern> >> > </servlet-mapping> >> >> > </web-app> >> > ------------------------ snip -------------------- >> >> > ----------- MsgService.java -------------------------- >> > package com.i2s.webMonster.client; >> >> > import com.google.gwt.core.client.GWT; >> > import com.google.gwt.user.client.rpc.RemoteService; >> > import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; >> >> > @RemoteServiceRelativePath("MsgService") >> > public interface MsgService extends RemoteService { >> > /** >> > * Utility class for simplifying access to the instance of async >> > service. >> > */ >> > public String getMsg(); >> >> > public static class Util { >> > private static MsgServiceAsync instance; >> > public static MsgServiceAsync getInstance(){ >> > if (instance == null) { >> > instance = GWT.create(MsgService.class); >> > } >> > return instance; >> > } >> > } >> > } >> >> > -------------------- snip >> >> > ----------- MsgServiceAsync.java -------------------------- >> > package com.i2s.webMonster.client; >> >> > import com.google.gwt.user.client.rpc.AsyncCallback; >> >> > public interface MsgServiceAsync { >> > /** >> > * Utility class for simplifying access to the instance of async >> > service. >> > */ >> > public void getMsg(AsyncCallback<String> callback); >> > } >> >> > ------------------ snip >> >> > ----------- MsgServiceImpl.java -------------------------- >> > package com.i2s.webMonster.server; >> >> > import com.i2s.webMonster.client.MsgService; >> >> > public class MsgServiceImpl extends RemoteServiceServlet implements >> > MsgService { >> >> > @Override >> > public String getMsg() { >> >> > // TODO Auto-generated method stub >> > return "Gotcha!"; >> > } >> > } >> >> > --------------snip >> >> > ----------- Here is what the call to the servlet looks like >> > private void getServerMsg() { >> > MsgServiceAsync msgService = MsgService.Util.getInstance(); >> > ServiceDefTarget endpoint = (ServiceDefTarget)msgService; >> > endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + >> > "MsgService"); >> >> > AsyncCallback callback = new AsyncCallback() { >> > public void onSuccess(Object result) { >> > Window.alert((String) result); >> > } >> > public void onFailure(Throwable caught) { >> > Window.alert("Server request falure."); >> > } >> > }; >> > msgService.getMsg(callback); >> > } >> > ---------------- snip > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
