Hi Karan, Thanks for looking into this. Can you tell me the value of the moduleBaseURL parameter coming into the doGetSerializationPolicy() method, or more importantly, the value of the serializationPolicyFilePath at the line declaring an assigning the InputStream is object to null?
In GWT 1.6, using the new Compiler class, the serialization policy file is generated in a directory following the new war style directory structure. Thus, the gwt-servlet JAR would be look at that new location, but should also handle the case where you compiled with the deprecated GWTCompiler, in which case the serialization policy file would be generated directly in the -out directory. The moduleBaseURL passed in should be set accordingly to make this work, but I wonder if somehow the wrong value is being passed in because of the version conflict in the location of the generated serialization policy file. Cheers, -Sumit Chandel On Thu, Aug 20, 2009 at 6:23 PM, karan sardana <[email protected]>wrote: > Hi Sumit, > > Seems like our code is not able to fetch the Serialization policy. This is > how it looks like - > > This is how doGetSerializationPolicy() iin RemoteServiceServlet looks like > - > > ************************************ > > rotected SerializationPolicy doGetSerializationPolicy( > HttpServletRequest request, String moduleBaseURL, String strongName) > { > // The request can tell you the path of the web app relative to the > // container root. > String contextPath = request.getContextPath(); > > String modulePath = null; > if (moduleBaseURL != null) { > try { > modulePath = new URL(moduleBaseURL).getPath(); > } catch (MalformedURLException ex) { > // log the information, we will default > log("Malformed moduleBaseURL: " + moduleBaseURL, ex); > } > } > > SerializationPolicy serializationPolicy = null; > > /* > * Check that the module path must be in the same web app as the > servlet > * itself. If you need to implement a scheme different than this, > override > * this method. > */ > if (modulePath == null || !modulePath.startsWith(contextPath)) { > String message = "ERROR: The module path requested, " > + modulePath > + ", is not in the same web application as this servlet, " > + contextPath > + ". Your module may not be properly configured or your client > and server code maybe out of date."; > log(message, null); > } else { > // Strip off the context path from the module base URL. It should be > a > // strict prefix. > String contextRelativePath = > modulePath.substring(contextPath.length()); > > String serializationPolicyFilePath = > SerializationPolicyLoader.getSerializationPolicyFileName(contextRelativePath > + strongName); > > // Open the RPC resource file read its contents. > * InputStream is = getServletContext().getResourceAsStream( > serializationPolicyFilePath);* this is where the code breaks - > 'is' comes out as NULL, however, it shouldn't have happened > As module is in > in the same web app as the servlet itself. > > > try { > if (is != null) { > try { > serializationPolicy = > SerializationPolicyLoader.loadFromStream(is, > null); > } catch (ParseException e) { > log("ERROR: Failed to parse the policy file '" > + serializationPolicyFilePath + "'", e); > } catch (IOException e) { > log("ERROR: Could not read the policy file '" > + serializationPolicyFilePath + "'", e); > } > } else { > String message = "ERROR: The serialization policy file '" > + serializationPolicyFilePath > + "' was not found; did you forget to include it in this > deployment?"; > log(message, null); - this causes the log method to blow up; > null causes a NULLpointerException > } > } finally { > if (is != null) { > try { > is.close(); > } catch (IOException e) { > // Ignore this error > } > } > } > } > > return serializationPolicy; > } > > ***************************************************** > > Way around this was to override the method in our local Class; we did that, > and have got it working. Though I would liek to know the exact > problem...would appreciate if you could help. > > thanks, > Karan > > > On Fri, Aug 21, 2009 at 9:13 AM, Sumit Chandel <[email protected]>wrote: > >> Hi Karan, >> How are the GWT RPC calls no longer working? Are you receiving any error >> messages or exceptions when the RPC calls are made? Did you remember to >> update the gwt-servlet.jar for your deployed application on the server-side? >> >> Regards, >> -Sumit Chandel >> >> >> On Tue, Aug 18, 2009 at 1:34 AM, Karan Sardana <[email protected]>wrote: >> >>> >>> Hi, >>> >>> We have upgraded GWT 1.5 to 1.7, and have gotten everything to get >>> compiled properly. However, we didn't create a war file as we are not >>> running pur application in the hosted mode; so we did away with that. >>> Moreover, neither did we rename the module as we didn't think renaming >>> would make any difference, and the reason we didn't do any renaming as >>> it would have affected all our existing pages. >>> >>> What we actually did is- >>> >>> 1.) Included the latest jars i.e. replaced the old ones with the new >>> ones. >>> >>> 2.) Used Compiler instead of GWTCompiler >>> >>> Issue - None of the callbacks seem to be working i.e. RPC - >>> Asynchronous callbacks >>> >>> I would appreciate if I could get any help out of this. >>> >>> Thanks, >>> Karan >>> >>> >>> >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
