Unable to instantiate 'com.mails.server.MailsBoxServiceImpl'

1 view
Skip to first unread message

iammadong

unread,
Aug 16, 2006, 11:02:51 PM8/16/06
to Google Web Toolkit
i'm using gwt1.1.0 to develop an application with rpc.

i've find all topics about this in gwt groups,but still can't make it
out. who can help me.

everytime i debug the project in eclipse ,the shell tell:

[ERROR] Unable to instantiate 'com.mails.server.MailsBoxServiceImpl'
java.lang.ClassNotFoundException: com.mails.server.MailsBoxServiceImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:279)
at java.lang.ClassLoader.loadClass(ClassLoader.java:236)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:303)
at java.lang.Class.forName(Class.java:164)
at
com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:660)
at
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:165)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

all related files are:

client:
MailsList.java
MailsBox.java
MailsBoxService.java
MailsBoxServiceAsync.java

server:
MailsBoxServiceImpl.java

in MailsList i have:

MailsBoxServiceAsync mailServiceAsync=
(MailsBoxServiceAsync)GWT.create(MailsBoxService.class);
ServiceDefTarget mailServiceDefTarget=
(ServiceDefTarget)mailServiceAsync;


MailList(){
String staticResponseURL = GWT.getModuleBaseURL();
staticResponseURL += "/list";
sd.setServiceEntryPoint(staticResponseURL);
......
......
fetchMail("getPage",startIndex);
}


private void fetchMail(String flag,int startIndex)
{
AsyncCallback callBack = new AsyncCallback(){
public void onSuccess(Object result){

pageArrayList = (ArrayList)result;

update();
}
public void onFailure(Throwable caught){


}

};
mailServiceAsync.getPage(flag,startIndex, callBack);
}


and in the MailsBox.gwt.xml i have

<module>

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>

<!-- Specify the app entry point class. -->
<entry-point class='com.mails.client.MailsBox'/>
<servlet path='/list' class='com.mails.server.MailsBoxServiceImpl'/>

</module>


so,what's wrong with it . i'm so pussel confused. can anyone help me.

Broussalo

unread,
Aug 17, 2006, 4:56:50 AM8/17/06
to Google Web Toolkit
Hi,

Does your server implementation stored in com.mails.server package as
specified into MailsBox.gwt.xml ?
Does the class are in your classpath ?

Broussalo

unread,
Aug 17, 2006, 5:04:16 AM8/17/06
to Google Web Toolkit
Hi,

Do you run your application in web version www not hosted mode with GWT
browser ?
If you do have a web context before www/.... url like
http://localhost:8080/MY_MAIL_CONTEXT/....

if it is the case you have to modify :
1 - you url to retrieve the service with /MY_MAIL_CONTEXT/list into
your MailsBox.gwt.xml config file
2 - the staticResponseURL with staticResponseURL +=
"/MY_MAIL_CONTEXT/list";
:)

Broussalo

iammadong

unread,
Aug 17, 2006, 11:09:15 PM8/17/06
to Google Web Toolkit
when i use debug of eclipse ,it has this problem.and when i click the
MailsBox-shenll.cmd,it has another problem:
[WARN] StandardWrapperValve[shell]: Servlet.service() for servlet shell
threw exception
java.lang.ArrayIndexOutOfBoundsException: 7
at
com.mails.server.MailsBoxServiceImpl.<init>(MailsBoxServiceImpl.java:71)
at
com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:661)

at
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:165)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

after i add /com.mails.MailsBox ,it still don't work,has the same
problem.

iammadong

unread,
Aug 17, 2006, 11:10:38 PM8/17/06
to Google Web Toolkit
yes i have it in my com.mails.server package .but what do you mean of
Reply all
Reply to author
Forward
0 new messages