[JBoss Seam] - Step-by-step localization guide
by nhpvti
You know, most of us in the world are natively speaking not English.
So I think that it would make sense to pre-configure Seam samples and seam-gen to produce ready-to-localize applications. I spent last Friday by figuring out how to fill this gap.
Here is my step-by-step localization guide compiled from different sources on net:
1) add new supported locale
in .../WEB-INF/faces-config.xml for example:
<locale-config>
| <default-locale>en</default-locale>
| <supported-locale>en</supported-locale>
| <supported-locale>de</supported-locale>
| <supported-locale>ru</supported-locale>
| </locale-config>
|
2) Create new messages files, in my example messages_de.properties and messages_ru.properties
The 1st obstacle that should be considered here: property files should be UTF-8 encoded and transformed into ASCII by escaping UTF-8 characters (mix of ISO char sets is not advisable in a multi-language web application).
Built-in Eclipse properties editor cannot handle this, so I've installed Resource Bundle editor from
http://sourceforge.net/projects/eclipse-rbe/ (thank you guys for excellent work!)
Alternatively you can use utility from JDK, e.g.:
native2ascii.exe -encoding utf-8 messages_ru.txt messages_ru.properties
3) Configure your code editors to use UTF-8.
For example in Eclipse 3.2 check settings under i. Window-Preferences-General-Workspace-Text and ii. Window-Preferences-Web and XML-CSS Files, HTML Files, JSP Files, XML Files
4) In order to enable UTF-8 in input fields (the 2nd big obstacle) you will need a phase listener (compensating bug in myfaces and(or) JSF components?) that re-sets request char set to UTF-8.
To do this follow instructions found in
https://facelets.dev.java.net/servlets/ReadMsg?list=users&msgNo=1403
(see also discussion here http://www.jboss.com/?module=bb&op=viewtopic&t=73369)
and activate the listener in the .../WEB-INF/faces-config.xml file, e.g.:
<lifecycle>
| <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
| <phase-listener>com.xxx.yyy.zzz.util.UTF8PhaseListener</phase-listener>
| </lifecycle>
5) Set char set in template(s) to UTF-8:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" pageEncoding="UTF-8" />
6) The last, MySQL specific, obstacle eaten much time to find out a solution: force JDBC driver to use UTF-8, otherwise only ? characters will be saved in the database. So extend JDBC url in a data source file, e.g.:
<jndi-name>myDatasource</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/mydb?useUnicode=true&characterEncoding=utf8&charactetrResultSets=utf8</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
7) Create database with default UTF-8 support, for example for MySQL:
CREATE DATABASE mydb DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
|
Note: probably you have to change default tables type to InnoDB for transactions support. You can do this by adding start parameter (or via MySQL configuration file). On SuSE 9.2 this can look so:
in /etc/init.d/mysql.server:
$bindir/mysqld_safe --datadir=$datadir --default-table-type=innodb --pid-file=$pid_file >/dev/null 2>&1 &
Ready, now you have your native language as static text, data input and database output.
I hope this small contribution will save you a couple of hours.
And I hope that others in this forum will follow my example and share their experience in more detail, not simply stating: "I've solved the problem XYZ!"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969180#3969180
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969180
19 years, 7 months
[JBoss Seam] - Re: Invitation to try new Seam authentication features
by msteiner
"sbryzak2" wrote :
|
| I've made some changes to allow it to now work with debug mode turned on.
Still doesnt work. Now i get NPE:
| 10:58:40,383 ERROR [ExceptionInterceptor] redirecting to debug page
| java.lang.NullPointerException
| at org.jboss.seam.security.adapter.jboss.JBossAuthenticationAdapter.endRequest(JBossAuthenticationAdapter.java:43)
| at org.jboss.seam.security.authenticator.Authenticator.endRequest(Authenticator.java:92)
| at org.jboss.seam.security.authenticator.ProviderAuthenticator$$EnhancerByCGLIB$$a5851025.CGLIB$endRequest$4(<generated>)
| at org.jboss.seam.security.authenticator.ProviderAuthenticator$$EnhancerByCGLIB$$a5851025$$FastClassByCGLIB$$c5a66c51.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
| at org.jboss.seam.interceptors.JavaBeanInterceptor$1.proceed(JavaBeanInterceptor.java:87)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:54)
| at org.jboss.seam.interceptors.ValidationInterceptor.validateTargetComponent(ValidationInterceptor.java:64)
| at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
| at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:30)
| at sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:39)
| at sun.reflect.GeneratedMethodAccessor173.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:58)
| at sun.reflect.GeneratedMethodAccessor172.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:58)
| at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:34)
| at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalInterceptor.java:80)
| at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
| at sun.reflect.GeneratedMethodAccessor168.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:44)
| at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
| at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:125)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:61)
| at org.jboss.seam.ejb.SeamInterceptor.invokeInContexts(SeamInterceptor.java:170)
| at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:143)
| at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:130)
| at org.jboss.seam.interceptors.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:58)
| at org.jboss.seam.interceptors.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:46)
| at org.jboss.seam.security.authenticator.ProviderAuthenticator$$EnhancerByCGLIB$$a5851025.endRequest(<generated>)
| at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:248)
| at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:112)
| at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.security.filter.SeamSecurityFilter.doFilter(SeamSecurityFilter.java:119)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamCharacterEncodingFilter.doFilter(SeamCharacterEncodingFilter.java:41)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969176#3969176
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969176
19 years, 7 months
[Installation, Configuration & Deployment] - Tomcat thread hangs
by maktub
Good day to all.
I have a problem with an application deployed under jboss 3.2.5, java 1.4.2_07, machine win2k server eng 4GB ram 4 processor, x86.
My application has a tree like this:
app.ear
|
|- app.sar
|- app.war
|- Meta-Inf
|- server
I can reach it by a context called "app" and launching it by a jnlp.
Jnlp is managed by javaws that first of all download some jar to the client.
It works well for minutes, hour ... but sometimes javaws hangs and cannot download nothing, apparentry without a cause.
In the jboss log i cannot see nothing (DEBUG trace active)
I enable the tomcat access_log (by server.xml) and i see all right (normal http head e get request) when i can download and nothing when i cannot download.
I go to tomcat status page and i can see thread are exhausted (all busy) and all download process are hanging.
So, i cannot reach any url under "app", but i can reach jmx-console
and web-console for a while.
I tried to change connectionTimeout, KeepAlives and other parameter
in server.xml, but nothing appens.
There is some other debugging that i can enable?
Any idea about?
Need more info?
I hope to be clear.
Excuse me for my english.
Maktub
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969172#3969172
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969172
19 years, 7 months