[Security & JAAS/JBoss] - Re: can username be UTF-8
by goldfrog
My Solution:
I am a chinese and I am writing a website for chinese. every page in my web site is of utf-8. I use form-based authentication and org.jboss.security.auth.spi.DatabaseServerLoginModule to authenticate my users. When some of my users create their accounts with chinese characters in their login id, they can't login because DatabaseServerLoginModule can't get the correctly-encoded username. So I debug into jboss authentication module. I tried to filter all request to use UTF-8 ,but I failed because authectiation request can't be filtered by the filters defined in /WEB-INF/web.xml. I find that the DatabaseServerLoginModule can't get the encoded username corretly only because the username can't be correctly fechted from request by org.apache.catalina.authenticator.FormAuthenticator. So I need to configure org.apache.catalina.authenticator.FormAuthenticator in order to get utf-8 encoded username.
i find the configuration here:
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
I add a context.xml to /WEB-INF/ and deploy to my jboss server. Now the username can be fetched correctly now and my users can use chinese characters in their login id;
my context.xml:
my jboss is 4.20.GA
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054811#4054811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054811
18Â years, 10Â months
[JBoss Portal] - ClassNotFoundException when class is present in WEB-INF/lib
by advaittrivedi
Hi,
This is wierdest CNFE I have ever encountered. I am using JBoss Portal 2.6, JBoss AS 4.0.5 GA.
I have a war file which contains acegi-security-1.0.1.jar in WEB-INF/lib
This file has a class: org.acegisecurity.userdetails.UsernameNotFoundException. But still I get ClassNotFoundException: org.acegisecurity.userdetails.UsernameNotFoundException when portlet is initialized at server startup
I have enabled logging of class loading in log4j. This is UsernameNotFoundException related logs from ucl.log:
[82033,RepositoryClassLoader,main] loadClass org.jboss.mx.loading.UnifiedClassLoader3@12c5bfc{ url=file:/D:/jboss-cas-2.6/server/default/tmp/deploy/tmp61177pebble-mframe-exp.war/ ,addedOrder=54} name=org.acegisecurity.userdetails.UsernameNotFoundException, loadClassDepth=0
[82033,RepositoryClassLoader,main] loadClassImpl, name=org.acegisecurity.userdetails.UsernameNotFoundException, resolve=false
[82033,LoadMgr3,main] Begin beginLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@f1156e{classname: org.acegisecurity.userdetails.UsernameNotFoundException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@12c5bfc{ url=file:/D:/jboss-cas-2.6/server/default/tmp/deploy/tmp61177pebble-mframe-exp.war/ ,addedOrder=54}, loadedClass: nullnull, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0, #CCE: 0}
[82033,RepositoryClassLoader,main] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@27e353{ url=file:/D:/jboss-cas-2.6/server/default/conf/ ,addedOrder=1}), name=org/acegisecurity/userdetails/UsernameNotFoundException.class, resURL:null
[82033,RepositoryClassLoader,main] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@16752c9{ url=file:/D:/jboss-cas-2.6/server/default/deploy/jboss-portal.sar/ ,addedOrder=9}), name=org/acegisecurity/userdetails/UsernameNotFoundException.class, resURL:null
[82033,RepositoryClassLoader,main] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@18eb00c{ url=file:/D:/jboss-cas-2.6/server/default/deploy/jbossweb-tomcat55.sar/ ,addedOrder=10}), name=org/acegisecurity/userdetails/UsernameNotFoundException.class, resURL:null
[82033,RepositoryClassLoader,main] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@b48230{ url=file:/D:/jboss-cas-2.6/server/default/deploy/jbossws14.sar/ ,addedOrder=11}), name=org/acegisecurity/userdetails/UsernameNotFoundException.class, resURL:null
[82033,RepositoryClassLoader,main] loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@12c5bfc{ url=file:/D:/jboss-cas-2.6/server/default/tmp/deploy/tmp61177pebble-mframe-exp.war/ ,addedOrder=54} name=org.acegisecurity.userdetails.UsernameNotFoundException
[82049,RepositoryClassLoader,main] findClass, name=org.acegisecurity.userdetails.UsernameNotFoundException
[82049,RepositoryClassLoader,main] CFNE: Adding to blacklist: org.acegisecurity.userdetails.UsernameNotFoundException
[82049,RepositoryClassLoader,main] CFNE: Adding to blacklist: org.acegisecurity.userdetails.UsernameNotFoundException
[82049,RepositoryClassLoader,main] loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@12c5bfc{ url=file:/D:/jboss-cas-2.6/server/default/tmp/deploy/tmp61177pebble-mframe-exp.war/ ,addedOrder=54} name=org.acegisecurity.userdetails.UsernameNotFoundException not found
[82049,LoadMgr3,main] Begin endLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@f1156e{classname: org.acegisecurity.userdetails.UsernameNotFoundException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@12c5bfc{ url=file:/D:/jboss-cas-2.6/server/default/tmp/deploy/tmp61177pebble-mframe-exp.war/ ,addedOrder=54}, loadedClass: nullnull, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0, #CCE: 0}
[82049,RepositoryClassLoader,main] loadClass org.jboss.mx.loading.UnifiedClassLoader3@12c5bfc{ url=file:/D:/jboss-cas-2.6/server/default/tmp/deploy/tmp61177pebble-mframe-exp.war/ ,addedOrder=54} name=org.acegisecurity.userdetails.UsernameNotFoundException not found
Any idea, whats going on?
Thanks & Regards
Advait Trivedi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054805#4054805
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054805
18Â years, 10Â months
[JBoss jBPM] - Re: Combo Box in Form
by Riket44
Hello,
Well, I will put all my code, because I have an error I can't found (since 2 days !!! )
First, here is my form :
| <jbpm:datacell>
|
| <f:facet name="header">
| <h:outputText value="Produit desire: "/>
| </f:facet>
|
| <h:selectOneMenu value="#{genList.value}">
| <f:selectItems value="#{genList.items}" />
| </h:selectOneMenu>
|
| </jbpm:datacell>
|
Here is my genList.java :
| public class genList {
|
| private String value="";
| private Connection conn;
|
| public genList() {}
|
| public String getValue() {
| return value;
| }
| public void setValue(String value) {
| this.value = value;
| }
|
| public Collection getItems() {
|
| Collection items = new ArrayList();
| SelectItem si = null;
|
| try{
| //-- Connexion
| Class.forName("com.mysql.jdbc.Driver");
| conn = DriverManager.getConnection ("jdbc:mysql://localhost:3306/databaseName", "root", " ");
|
| //-- Creation du statement et de la requete
| Statement stmt = conn.createStatement();
| String requete = null;
| requete = "SELECT ID_,NOM_ FROM materiel";
|
| //-- Execution de la requete
| ResultSet rs = stmt.executeQuery(requete);
|
| //-- Lecture des donnees
| while (rs.next())
| {
| si = new SelectItem (String.valueOf(rs.getInt(1)), rs.getString(2));
| items.add(si);
| }
|
| //-- Deconnexion
| conn.close();
| } catch(Exception e){
| System.out.println("\n\n\nCONNEXION ECHOUEE: "+e+"\n\n\n");
| System.exit(-1);
| }
|
| return items;
| }
| }
|
And finally here is my Face Config :
| <managed-bean>
| <managed-bean-name>genList</managed-bean-name>
| <managed-bean-class>com.demande.action.genList</managed-bean-class>
| <managed-bean-scope>request</managed-bean-scope>
| </managed-bean>
|
When I want to start my process I always have this error :
Argument Error: An option for component j_id48 was not an instance of javax.faces.model.SelectItem. Type found: java.util.ArrayList.
(j_id48 is the name given automatically to the combo box)
I tried a lot of things to repair that error, but nothing works... I can't see where is the problem, if you could help me, I will be very happy !
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054804#4054804
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054804
18Â years, 10Â months