viktorthang / mgwt

Automatically exported from code.google.com/p/mgwt
Other
0 stars 0 forks source link

i18n cause HTML5 offline Linker exception #294

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add below properties to *.gwt.xml
    <!-- Simplified Chinese -->
    <extend-property name="locale" values="zh_CN"/>

    <!-- Traditional Chinese -->
    <extend-property name="locale" values="zh_TW"/>

    <!-- English language, independent of country -->
    <extend-property name="locale" values="en"/>

    <set-property-fallback name="locale" value="zh_TW"/>
2. Clean and build project
3. Deploy to tomcat

What is the expected output? What do you see instead?
Servlet.service() for servlet [ManifestServlet] in context with path [] threw 
exception [unkown device] with root cause
javax.servlet.ServletException: unkown device
    at com.googlecode.mgwt.linker.server.Html5ManifestServletBase.doGet(Html5ManifestServletBase.java:115)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)

What version of the product are you using? On what operating system?
1.2

Original issue reported on code.google.com by kevn.t...@gmail.com on 5 Feb 2013 at 7:17

GoogleCodeExporter commented 8 years ago
The problem is caused by GWT's permutation will add locale entry to 
permutationProvider. So the getPermutationStrongName cannot retrieve right 
strong name because of "value.size() == computedBindings.size()" is not match.

Original comment by kevn.t...@gmail.com on 21 Mar 2013 at 10:27

GoogleCodeExporter commented 8 years ago
If you change the default permutations you will need to build your own server 
(extends the base servlet) and provide the right property providers. There is 
no generic way to do this, since we can not guess in front which permutation 
providers you are going to need.

If you feel there is something we can do (maybe document this better) please 
let us know!

Original comment by kurka.da...@gmail.com on 30 Mar 2013 at 9:42

GoogleCodeExporter commented 8 years ago
Well, I agree that there is no generic way to do it for all possible 
permutation providers, but there is a way to do it for i18n: you get the Locale 
from the request, convert it to GwtLocale, and return the correct manifest file 
(according to the user agent and locale).

This is an example that creates a different manifest file for each agent and 
locale:
http://pastebin.com/JHi7NEuA
It is missing the server side servlet that will select the correct manifest 
file...

Original comment by Yoav.Zibin@gmail.com on 21 Apr 2013 at 4:12

GoogleCodeExporter commented 8 years ago
Same problem here!

Original comment by michael....@googlemail.com on 4 Mar 2014 at 11:35

GoogleCodeExporter commented 8 years ago
Daniel, more than a year ago you asked: 

>> If you feel there is something we can do (maybe document this better) please 
let us know!

To me, this part (adding your own property providers - and which default 
property providers to add or not) is not well documented yet. I guess adding an 
example in the wiki would also help a lot.

In my project I have a locale property in the gwt.xml file - but not the user 
agent property. I created a LocalePropertyProvider that I add in an extension 
of MGWTHtml5ManifestServlet. It feels that I should not add the 
UserAgentPropertyProvider, but I have tried all kind of ways to get this 
working - but always get the unkown device exception...

Original comment by pdalk...@gmail.com on 19 May 2014 at 10:17