[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3285) Seam Email session integration into jBPM
by Boretti Mathieu (JIRA)
Seam Email session integration into jBPM
----------------------------------------
Key: JBSEAM-3285
URL: https://jira.jboss.org/jira/browse/JBSEAM-3285
Project: Seam
Issue Type: Feature Request
Components: BPM
Affects Versions: 2.0.2.GA
Environment: N/A
Reporter: Boretti Mathieu
The goal is to use the MailSession from seam (provided by DataSource or not), when using jBPM task-node.
The idea is to provide a class that extend org.jbpm.mail.Mail and use the MailSession from Seam, instance of the MailSession from jBPM.
It is then possible to reference this class in the jbpm config file (<string name='jbpm.mail.class.name' value='XXXX' />
I wrote a small "example class", by copy-paste from jBPM (see below):
This implementation use the jBPM variable config jbpm.mail.ignoreError to throw, or not, an error in case of error in sending of email.
The MailSession is retrieved with
org.jboss.seam.mail.MailSession.instance();
package org.domain.HardWareStore.actions;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.seam.contexts.Context;
import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.mail.MailSession;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmException;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.jpdl.el.ELException;
import org.jbpm.jpdl.el.VariableResolver;
import org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator;
import org.jbpm.mail.AddressResolver;
import org.jbpm.mail.Mail;
import org.jbpm.util.XmlUtil;
public class MailHandler extends Mail {
private static final long serialVersionUID = 1L;
String template = null;
String actors = null;
String to = null;
String bcc = null;
String bccActors = null;
String subject = null;
String text = null;
ExecutionContext executionContext = null;
public MailHandler() {
}
public MailHandler(String template, String actors, String to,
String subject, String text) {
this.template = template;
this.actors = actors;
this.to = to;
this.subject = subject;
this.text = text;
}
public MailHandler(String template, String actors, String to,
String bccActors, String bcc, String subject, String text) {
this.template = template;
this.actors = actors;
this.to = to;
this.bccActors = bccActors;
this.bcc = bcc;
this.subject = subject;
this.text = text;
}
public void execute(ExecutionContext executionContext) {
this.executionContext = executionContext;
send();
}
public List getRecipients() {
List recipients = new ArrayList();
if (actors != null) {
String evaluatedActors = evaluate(actors);
List tokenizedActors = tokenize(evaluatedActors);
if (tokenizedActors != null) {
recipients.addAll(resolveAddresses(tokenizedActors));
}
}
if (to != null) {
String resolvedTo = evaluate(to);
recipients.addAll(tokenize(resolvedTo));
}
return recipients;
}
public List getBccRecipients() {
List recipients = new ArrayList();
if (bccActors != null) {
String evaluatedActors = evaluate(bccActors);
List tokenizedActors = tokenize(evaluatedActors);
if (tokenizedActors != null) {
recipients.addAll(resolveAddresses(tokenizedActors));
}
}
if (bcc != null) {
String resolvedTo = evaluate(to);
recipients.addAll(tokenize(resolvedTo));
}
if (JbpmConfiguration.Configs.hasObject("jbpm.mail.bcc.address")) {
recipients.addAll(tokenize(JbpmConfiguration.Configs
.getString("jbpm.mail.bcc.address")));
}
return recipients;
}
public String getSubject() {
if (subject == null)
return null;
return evaluate(subject);
}
public String getText() {
if (text == null)
return null;
return evaluate(text);
}
public String getFromAddress() {
if (JbpmConfiguration.Configs.hasObject("jbpm.mail.from.address")) {
return JbpmConfiguration.Configs
.getString("jbpm.mail.from.address");
}
return "jbpm@noreply";
}
public void send() {
if (template != null) {
Properties properties = getMailTemplateProperties(template);
if (actors == null) {
actors = properties.getProperty("actors");
}
if (to == null) {
to = properties.getProperty("to");
}
if (subject == null) {
subject = properties.getProperty("subject");
}
if (text == null) {
text = properties.getProperty("text");
}
if (bcc == null) {
bcc = properties.getProperty("bcc");
}
if (bccActors == null) {
bccActors = properties.getProperty("bccActors");
}
}
send(getFromAddress(), getRecipients(), getBccRecipients(),
getSubject(), getText());
}
public static void send(String fromAddress, List recipients,
String subject, String text) {
send(fromAddress, recipients, null, subject, text);
}
public static void send(String fromAddress, List recipients,
List bccRecipients, String subject, String text) {
if ((recipients == null) || (recipients.isEmpty())) {
log.info("skipping mail because there are no recipients");
return;
}
log.info("sending email to '" + recipients + "' about '" + subject
+ "'");
log.info("BeginCall");
Context context = Lifecycle.beginMethod();
try {
log.info("GetSession");
Session session = MailSession.instance();
log.info("Create msg for "+session);
MimeMessage message = new MimeMessage(session);
if (fromAddress != null) {
message.setFrom(new InternetAddress(fromAddress));
}
Iterator iter = recipients.iterator();
while (iter.hasNext()) {
InternetAddress recipient = new InternetAddress((String) iter
.next());
message.addRecipient(Message.RecipientType.TO, recipient);
}
if (bccRecipients != null) {
iter = bccRecipients.iterator();
while (iter.hasNext()) {
InternetAddress recipient = new InternetAddress(
(String) iter.next());
message.addRecipient(Message.RecipientType.BCC, recipient);
}
}
if (subject != null) {
message.setSubject(subject);
}
if (text != null) {
message.setText(text);
}
message.setSentDate(new Date());
Transport.send(message);
} catch (Exception e) {
log.error("couldn't send email",e);
boolean ignore=false;
if (JbpmConfiguration.Configs.hasObject("jbpm.mail.ignoreError")) {
ignore=JbpmConfiguration.Configs.getBoolean("jbpm.mail.ignoreError");
}
if (!ignore) throw new JbpmException("couldn't send email", e);
} finally {
Lifecycle.endMethod(context);
}
}
protected List tokenize(String text) {
if (text == null) {
return null;
}
List list = new ArrayList();
StringTokenizer tokenizer = new StringTokenizer(text, ";:");
while (tokenizer.hasMoreTokens()) {
list.add(tokenizer.nextToken());
}
return list;
}
protected Collection resolveAddresses(List actorIds) {
List emailAddresses = new ArrayList();
Iterator iter = actorIds.iterator();
while (iter.hasNext()) {
String actorId = (String) iter.next();
AddressResolver addressResolver = (AddressResolver) JbpmConfiguration.Configs
.getObject("jbpm.mail.address.resolver");
Object resolvedAddresses = addressResolver.resolveAddress(actorId);
if (resolvedAddresses != null) {
if (resolvedAddresses instanceof String) {
emailAddresses.add((String) resolvedAddresses);
} else if (resolvedAddresses instanceof Collection) {
emailAddresses.addAll((Collection) resolvedAddresses);
} else if (resolvedAddresses instanceof String[]) {
emailAddresses.addAll(Arrays
.asList((String[]) resolvedAddresses));
} else {
throw new JbpmException(
"Address resolver '"
+ addressResolver
+ "' returned '"
+ resolvedAddresses.getClass().getName()
+ "' instead of a String, Collection or String-array: "
+ resolvedAddresses);
}
}
}
return emailAddresses;
}
static Map templates = null;
static Map templateVariables = null;
synchronized Properties getMailTemplateProperties(String templateName) {
if (templates == null) {
templates = new HashMap();
String mailTemplatesResource = JbpmConfiguration.Configs
.getString("resource.mail.templates");
org.w3c.dom.Element mailTemplatesElement = XmlUtil
.parseXmlResource(mailTemplatesResource)
.getDocumentElement();
List mailTemplateElements = XmlUtil.elements(mailTemplatesElement,
"mail-template");
Iterator iter = mailTemplateElements.iterator();
while (iter.hasNext()) {
org.w3c.dom.Element mailTemplateElement = (org.w3c.dom.Element) iter
.next();
Properties templateProperties = new Properties();
addTemplateProperty(mailTemplateElement, "actors",
templateProperties);
addTemplateProperty(mailTemplateElement, "to",
templateProperties);
addTemplateProperty(mailTemplateElement, "subject",
templateProperties);
addTemplateProperty(mailTemplateElement, "text",
templateProperties);
addTemplateProperty(mailTemplateElement, "bcc",
templateProperties);
addTemplateProperty(mailTemplateElement, "bccActors",
templateProperties);
templates.put(mailTemplateElement.getAttribute("name"),
templateProperties);
}
templateVariables = new HashMap();
List variableElements = XmlUtil.elements(mailTemplatesElement,
"variable");
iter = variableElements.iterator();
while (iter.hasNext()) {
org.w3c.dom.Element variableElement = (org.w3c.dom.Element) iter
.next();
templateVariables.put(variableElement.getAttribute("name"),
variableElement.getAttribute("value"));
}
}
return (Properties) templates.get(templateName);
}
void addTemplateProperty(org.w3c.dom.Element mailTemplateElement,
String property, Properties templateProperties) {
org.w3c.dom.Element element = XmlUtil.element(mailTemplateElement,
property);
if (element != null) {
templateProperties.put(property, XmlUtil.getContentText(element));
}
}
String evaluate(String expression) {
if (expression == null) {
return null;
}
VariableResolver variableResolver = JbpmExpressionEvaluator
.getUsedVariableResolver();
if (variableResolver != null) {
variableResolver = new MailVariableResolver(templateVariables,
variableResolver);
}
return (String) JbpmExpressionEvaluator.evaluate(expression,
executionContext, variableResolver, null);
}
class MailVariableResolver implements VariableResolver, Serializable {
private static final long serialVersionUID = 1L;
Map templateVariables = null;
VariableResolver variableResolver = null;
public MailVariableResolver(Map templateVariables,
VariableResolver variableResolver) {
this.templateVariables = templateVariables;
this.variableResolver = variableResolver;
}
public Object resolveVariable(String pName) throws ELException {
if ((templateVariables != null)
&& (templateVariables.containsKey(pName))) {
return templateVariables.get(pName);
}
return variableResolver.resolveVariable(pName);
}
}
private static Log log = LogFactory.getLog(Mail.class);
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4395) Endless loop when an exception occurs during commit inside a long running conversation, and there is an <exception> clause to handle it in page.xml
by Denis Forveille (JIRA)
Endless loop when an exception occurs during commit inside a long running conversation, and there is an <exception> clause to handle it in page.xml
---------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-4395
URL: https://jira.jboss.org/jira/browse/JBSEAM-4395
Project: Seam
Issue Type: Bug
Components: Exception Handling
Affects Versions: 2.2.0.GA, 2.2.1.CR1
Environment: WebSphere v7.0.0.5, Seam 2.2.1-SNAPSHOT
Reporter: Denis Forveille
Scenario:
- process is in a long running conversation
- a persistence exception occurs (e.g. OptimisticLockingException), during either a call to flush() or during the automatic commit() of the transaction
- a clause <exception> is declared in pages.xml to handle the exception and redirect to a generic error page (e.g. <exception> that will handle all exceptions..) like this:
<exception>
<end-conversation/>
<redirect view-id="/erreur_exception.xhtml" />
</exception>
During the commit, the exception occurs, Seam catch it and pass it to the exception handler.
The exception handler sees that the user has to be redirected to the error page.
The long running conversation is still active, handling the "dirty" objects that cause the persistence failure
The request to process the error page starts. During the "RESTORE_VIEW", the dirty object that are in the conversation are then flushed again to the database, causing again the persistence exception, triggering the seam exception handling mechanism, that will redirect to the error handling page, causing an endless loop
A workaround to this is to add an observer on "org.jboss.seam.exceptionHandled" that will kill the current conversation and so remove the dirty objects from the session and the error page is display (see the forum reference)
Some thoughts:
- the documentation gives an example on how to handle OptimisticLockingException, but in our case, the way it is, this causes an infinite loop
- is the <end-conversation/> clause working correctly? At what time during exception handling is the end-conversation supposed to occur?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (JBSEAM-4847) jee5-booking example - cannot login
by Tomáš Remeš (Created) (JIRA)
jee5-booking example - cannot login
-----------------------------------
Key: JBSEAM-4847
URL: https://issues.jboss.org/browse/JBSEAM-4847
Project: Seam 2
Issue Type: Bug
Components: Examples
Affects Versions: 2.3.0.ALPHA
Environment: jboss-5.1.0.GA, seam-2.3.0.Alpha
Reporter: Tomáš Remeš
after filling login/password values and clicking on "Account Login" page displays "Login failed" and "Transaction failed" info and user is not logged in. Following exception is thrown in server console:
javax.el.ELException: javax.ejb.EJBTransactionRolledbackException: The user must supply a JDBC connection
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.jboss.seam.core.Expressions$2.invoke(org.jboss.seam.core.Expressions:222)
at org.jboss.seam.security.jaas.SeamLoginModule.login(org.jboss.seam.security.jaas.SeamLoginModule:109)
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:597)
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(org.jboss.seam.security.Identity:344)
at org.jboss.seam.security.Identity.authenticate(org.jboss.seam.security.Identity:332)
at org.jboss.seam.security.Identity.login(org.jboss.seam.security.Identity:259)
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:597)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:83)
at org.jboss.seam.web.IdentityFilter.doFilter(org.jboss.seam.web.IdentityFilter:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:69)
at org.jboss.seam.web.MultipartFilter.doFilter(org.jboss.seam.web.MultipartFilter:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(org.jboss.seam.web.ExceptionFilter:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:69)
at org.jboss.seam.web.RedirectFilter.doFilter(org.jboss.seam.web.RedirectFilter:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(org.jboss.seam.web.Ajax4jsfFilter:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:69)
at org.jboss.seam.web.LoggingFilter.doFilter(org.jboss.seam.web.LoggingFilter:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:69)
at org.jboss.seam.web.HotDeployFilter.doFilter(org.jboss.seam.web.HotDeployFilter:53)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(org.jboss.seam.servlet.SeamFilter:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(org.jboss.seam.servlet.SeamFilter:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] Created: (SEAMJCR-5) EntityListeners
by John Ament (JIRA)
EntityListeners
---------------
Key: SEAMJCR-5
URL: https://issues.jboss.org/browse/SEAMJCR-5
Project: Seam JCR
Issue Type: Feature Request
Components: Injection API
Reporter: John Ament
Fix For: 3.0.0.Alpha1
We should provide JPA 2 compliant entity listeners. We should provide a PostLoad implementation that can bind Nodes to properties that contain UUIDs for node id's. These should be represented by a Seam JCR created annotation denoting that the field is actually a UUID, and it should denote the field that will receive the underlying javax.jcr.Node.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] Created: (SEAMSECURITY-98) JaasAuthenticator AuthenticationException: Authenticator must provide a non-null User after successful authentication
by Hendy Irawan (JIRA)
JaasAuthenticator AuthenticationException: Authenticator must provide a non-null User after successful authentication
---------------------------------------------------------------------------------------------------------------------
Key: SEAMSECURITY-98
URL: https://issues.jboss.org/browse/SEAMSECURITY-98
Project: Seam Security
Issue Type: Bug
Affects Versions: 3.1.0.Beta1
Environment: Seam Security 3.1.0.Beta2, Ubuntu 11.04 64-bit, JBoss AS 7.0.1 everything
Reporter: Hendy Irawan
I use JaasAuthenticator with the following config:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:ee"
xmlns:security="urn:java:org.jboss.seam.security"
xmlns:jaas="urn:java:org.jboss.seam.security.jaas"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.jboss.org/schema/cdi/beans_1_0.xsd">
<security:IdentityImpl>
<s:modifies/>
<security:authenticatorClass>org.jboss.seam.security.jaas.JaasAuthenticator</security:authenticatorClass>
</security:IdentityImpl>
<jaas:JaasAuthenticator>
<s:modifies/>
<jaas:jaasConfigName>other</jaas:jaasConfigName>
</jaas:JaasAuthenticator>
<interceptors>
<!-- <class>org.jboss.seam.transaction.TransactionInterceptor</class> -->
</interceptors>
</beans>
In JBoss I configure 'other' to use UsersRoles, and I also put users.properties and roles.properties in my project's src/main/resources.
However, even if I put the right username/password, it gives this error:
03:10:14,534 ERROR [org.jboss.seam.security.IdentityImpl] (http--127.0.0.1-8080-6) Login failed: org.jboss.seam.security.AuthenticationException: Authenticator must provide a non-null User after successful authentication
at org.jboss.seam.security.IdentityImpl.postAuthenticate(IdentityImpl.java:281) [seam-security-3.1.0.Beta2.jar:]
at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:233) [seam-security-3.1.0.Beta2.jar:]
at org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:164) [seam-security-3.1.0.Beta2.jar:]
at org.jboss.seam.security.IdentityImpl$Proxy$_$$_WeldClientProxy.login(IdentityImpl$Proxy$_$$_WeldClientProxy.java) [seam-security-3.1.0.Beta2.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_22]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_22]
at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_22]
at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.3.0.jar:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2054) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
at java.lang.Thread.run(Thread.java:679) [:1.6.0_22]
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month