Resource Not Found

43 views
Skip to first unread message

kinnu_sathya

unread,
Jun 24, 2008, 5:19:25 PM6/24/08
to Google Web Toolkit
Hi,

I am new to GWT and i started trying a screen with a command button.
On click of the command button an email will be posted to my address.
I have created the EmailService.java and EmailServiceAsync.java in the
client package and the EmailServiceImpl.java in the server package.
I have also included the following snippet in the .gwt.xml file
<servlet path="/EmailService"
class="com.nwa.cargo.art.server.EmailServiceImpl"/>

I am not sure whether the above snippet is correct!!!!

When i execute the prog, the screen is displayed and on click of the
"Send EMail" button i am getting this error - "Resource not found:
com.nwa.cargo.art.client.EmailService; (could a file be missing from
the public path or a <servlet> tag misconfigured in module
com.nwa.cargo.art.MyFile.gwt.xml ?)".......

Can anybody help me how to configure the RPC?

Regards
Sathya

Isaac Truett

unread,
Jun 25, 2008, 7:28:08 AM6/25/08
to Google-We...@googlegroups.com
What URL are you setting for your service call on the client? It
should look something like this, based on your <servlet> tag:

((ServiceDefTarget)service).setServiceEntryPoint(GWT.getModuleBaseURL()
+ "EmailService");

walden

unread,
Jun 25, 2008, 8:06:54 AM6/25/08
to Google Web Toolkit
Hosted mode?



On Jun 24, 5:19 pm, kinnu_sathya <sathya.crocodilehun...@gmail.com>
wrote:

kinnu_sathya

unread,
Jun 25, 2008, 11:28:07 AM6/25/08
to Google Web Toolkit
Yes, i am used the same format and it is able to reach the Service
implementation. In that service implementation i have the code to send
email to few recipeints.

I am getting an error when accessing MimeMessage aMessage = new
MimeMessage(aSession); The snippet is shown below

Properties aProps =
System.getProperties();
aProps.put("mail.smtp.host", "smtp.nwa.com");
Session aSession = Session.getDefaultInstance(aProps,null);
MimeMessage aMime = new javax.mail.internet.MimeMessage(aSession);
The error is

[WARN] StandardContext[]Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract void
com.nwa.cargo.art.client.EmailService.sendEmail(java.lang.String,java.lang.String,java.lang.String)'
threw an unexpected exception: java.lang.NoClassDefFoundError: com/sun/
mail/util/SharedByteArrayInputStream
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
360)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
546)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
163)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
290)
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)
Caused by: java.lang.NoClassDefFoundError: com/sun/mail/util/
SharedByteArrayInputStream
at
com.nwa.cargo.art.server.EmailServiceImpl.sendEmail(EmailServiceImpl.java:
30)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
527)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
163)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
290)
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)

But the same code is working fine in Struts framework (an application
in production)

Can somebody figure out the reason...?

Regards
Sathya
> > Sathya- Hide quoted text -
>
> - Show quoted text -

walden

unread,
Jun 25, 2008, 2:54:02 PM6/25/08
to Google Web Toolkit
I have this crazy intuition about your problem. I think com/sun/mail/
util/SharedByteArrayInputStream.class is not loading on your server.
It could be because it's not on your classpath. And it could be that
it's on your classpath twice. Some loaders don't like that.

It seems completely unrelated to GWT, doesn't it?

On Jun 25, 11:28 am, kinnu_sathya <sathya.crocodilehun...@gmail.com>
wrote:
> Yes, i am used the same format and it is able to reach the Service
> implementation. In that service implementation i have the code to send
> email to few recipeints.
>
> I am getting an error when accessing MimeMessage aMessage = new
> MimeMessage(aSession); The snippet is shown below
>
>                                 Properties aProps =
> System.getProperties();
>                 aProps.put("mail.smtp.host", "smtp.nwa.com");
>                 Session aSession = Session.getDefaultInstance(aProps,null);
>                 MimeMessage aMime = new javax.mail.internet.MimeMessage(aSession);
> The error is
>
> [WARN] StandardContext[]Exception while dispatching incoming RPC call
> com.google.gwt.user.server.rpc.UnexpectedException: Service method
> 'public abstract void
> com.nwa.cargo.art.client.EmailService.sendEmail(java.lang.String,java.lang.­String,java.lang.String)'
> threw an unexpected exception: java.lang.NoClassDefFoundError: com/sun/
> mail/util/SharedByteArrayInputStream
>         at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
> 360)
>         at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> 546)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi­ceServlet.java:
> 163)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceSer­vlet.java:
> 85)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
> 290)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio­nFilterChain.java:
> 237)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC­hain.java:
> 157)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j­ava:
> 214)
> Caused by: java.lang.NoClassDefFoundError: com/sun/mail/util/
> SharedByteArrayInputStream
>         at
> com.nwa.cargo.art.server.EmailServiceImpl.sendEmail(EmailServiceImpl.java:
> 30)
>         at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> 527)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi­ceServlet.java:
> 163)
>         at
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceSer­vlet.java:
> 85)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
> 290)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio­nFilterChain.java:
> 237)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC­hain.java:
> 157)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j­ava:
> > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages