[jboss-user] [JBoss Seam] - Re: Upgrading from 1.1.5 to 1.2

2007-03-04 Thread y_zl
I also got the exception.




  | 
  | javax.faces.el.EvaluationException: Exception while invoking expression 
#{authenticator.authenticate}
  | at 
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:165)
  | at 
org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
  | at 
org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
  | at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:106)
  | at 
org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:104)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
  | at 
javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
  | at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
  | at java.security.AccessController.doPrivileged(Native Method)
  | at 
javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
  | at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
  | at org.jboss.seam.security.Identity.authenticate(Identity.java:249)
  | at org.jboss.seam.security.Identity.authenticate(Identity.java:242)
  | at org.jboss.seam.security.Identity.login(Identity.java:172)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
  | at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
  | at 
com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
  | at 
com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
  | at 
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
  | at javax.faces.component.UICommand.broadcast(UICommand.java:106)
  | at 
org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
  | at 
org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
  | at 
org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
  | at 
org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
  | at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
  | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
  | at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | at 
org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
  | at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
  | at 
org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
  | at 
org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | at 
org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
  | at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
  | at 
org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
  | at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
  | 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 

[jboss-user] [JBoss Seam] - Re: Upgrading from 1.1.5 to 1.2

2007-03-01 Thread [EMAIL PROTECTED]
The new authenticate method should not accept any parameters.  Instead it can 
read the username/password from Identity (identity.getUsername() etc) and add 
roles via the identity api also (identity.addRole(admin)).

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4024128#4024128

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4024128
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Upgrading from 1.1.5 to 1.2

2007-03-01 Thread nekstrom
Thanks for your help.  I changed that function to be correct but I still get 
that error.  Any ideas?  Are there compatability issues with using Java 6.0?  I 
think the jars are all compiled with 5.0.  My program is compiled with 6.0.  I 
don't think it should be an issue but if some one knows different let me know.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4024322#4024322

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4024322
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Upgrading from 1.1.5 to 1.2

2007-03-01 Thread nekstrom
Here is my Authenticator Class:

  | package edu.byu.cs.csl.dogma.server;
  | 
  | import java.util.List;
  | import java.util.Set;
  | 
  | import javax.persistence.EntityManager;
  | 
  | import org.jboss.seam.annotations.In;
  | import org.jboss.seam.annotations.Logger;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.log.Log;
  | import org.jboss.seam.security.Identity;
  | 
  | import edu.byu.cs.csl.dogma.server.model.Permission;
  | import edu.byu.cs.csl.dogma.server.model.Users;
  | 
  | @Name(authenticator)
  | public class Authenticator {
  | @Logger
  | private Log log;
  | 
  | @In(value=entityManager) EntityManager em;
  | 
  | @SuppressWarnings(unchecked)
  | public boolean authenticate() {
  | log.info(authenticating #0, 
Identity.instance().getUsername());
  | if(em == null){log.error(Could not authenticate because 
EntityManager null.); return false;}
  | ListUsers users = em.createQuery(select u from Users u where 
username=:username and password=:password)
  | .setParameter(username, Identity.instance().getUsername())
  | .setParameter(password, Identity.instance().getPassword())
  | .getResultList();
  | if(users.size() == 0) {
  | return false;
  | } else {
  | Users user = users.get(0);
  | SetPermission permissions = user.getPermissions();
  | for(Permission perm: permissions) {
  | 
Identity.instance().addRole(perm.getDescription());
  | }
  | }
  | return true;
  | }
  | }
  | 
And here is my components.xml

  | ?xml version=1.0 encoding=UTF-8?
  | components xmlns=http://jboss.com/products/seam/components;
  | xmlns:core=http://jboss.com/products/seam/core;
  | xmlns:drools=http://jboss.com/products/seam/drools;
  | xmlns:security=http://jboss.com/products/seam/security;
  | xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  | xsi:schemaLocation=http://jboss.com/products/seam/core 
http://jboss.com/products/seam/core-1.2.xsd 
  |  http://jboss.com/products/seam/drools 
http://jboss.com/products/seam/drools-1.2.xsd
  |  http://jboss.com/products/seam/security 
http://jboss.com/products/seam/security-1.2.xsd
  |  http://jboss.com/products/seam/components 
http://jboss.com/products/seam/components-1.2.xsd;
  | 
  | core:init debug=true jndi-pattern=@jndiPattern@ /
  | 
  | core:manager concurrent-request-timeout=500
  | conversation-timeout=12 conversation-id-parameter=cid
  | conversation-is-long-running-parameter=clr /
  | 
  | core:pages no-conversation-view-id=/home.xhtml /
  | 
  | core:managed-persistence-context name=entityManager
  | auto-create=true
  | 
persistence-unit-jndi-name=java:/dogma-serverEntityManagerFactory /
  | 
  | !-- core:ejb installed=@embeddedEjb@/ --
  | 
  | drools:rule-base name=securityRules
  | drools:rule-files
  | value/security.drl/value
  | /drools:rule-files
  | /drools:rule-base
  | 
  | security:identity
  | authenticate-method=#{authenticator.authenticate} /
  | 
  | !-- For use with jBPM pageflow or process management --
  | !--  
  |core:jbpm
  |   core:process-definitions/core:process-definitions
  |   core:pageflow-definitions/core:pageflow-definitions
  | /core:jbpm
  | --
  | 
  | /components
  | 
Does any one see something wrong?  I recompiled the Seam jars with java 6 and 
am now using them so that isn't the issue.  Were there configuration file 
changes that would account for this?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4024329#4024329

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4024329
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Upgrading from 1.1.5 to 1.2

2007-03-01 Thread [EMAIL PROTECTED]
I use Java 6.0 and have no issues.  Looking at your code it all seems fine, so 
I'm not sure what's causing the exception.  All I can suggest is you compare 
your files with the Seam examples, which definitely all work.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4024529#4024529

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4024529
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user