[JBoss JIRA] Created: (SEAMFACES-82) injection of managed beans in face converter always null if multiple seam 3 components present in the web-inf/lib
by yangju (JIRA)
injection of managed beans in face converter always null if multiple seam 3 components present in the web-inf/lib
-----------------------------------------------------------------------------------------------------------------
Key: SEAMFACES-82
URL: https://issues.jboss.org/browse/SEAMFACES-82
Project: Seam Faces
Issue Type: Bug
Components: CDI Integration
Affects Versions: 3.0.0.Beta2
Environment: jboss AS 6 final, windows, war deployment
Reporter: yangju
Priority: Critical
I have a big war with seam 3 faces, persistence, internationalization, xml config, solder modules in the web-inf/lib.
I have tried to inject managed beans into the jsf converter, but it does not matter it is my own bean or seam's bean or weld's bean, the bean is always null. It seems that the injection fails silently. The converter code is as follows:
package com.pearson.epen.managedBean.converter;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import org.slf4j.Logger;
import com.pearson.epen.account.model.api.TestAdmin;
import com.pearson.epen.cdi.qualifier.CentralRepo;
import com.pearson.epen.cdi.qualifier.StaticData;
@SessionScoped
@FacesConverter("convert.TestAdmin")
public class TestAdminConverter implements Converter, Serializable {
private static final long serialVersionUID = 1L;
@Inject
@StaticData
private List<TestAdmin> admins;
@Inject
private FacesContext context;
@Inject
@CentralRepo
private EntityManager em;
@Inject
private Logger log;
@PostConstruct
public void init() {
log.info("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%init");
}
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
try {
Long id = Long.valueOf(value);
for (TestAdmin admin : admins) {
if (admin.getId().longValue() == id.longValue()) {
return admin;
}
}
} catch (Throwable t) {
log.error("got exception", t);
}
return null;
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
TestAdmin testAdmin = (TestAdmin) value;
return Long.toString(testAdmin.getId());
}
}
In above code, all injections are null and the @PostConstruct method is never called. However, getAsObject(FacesContext context, UIComponent component, String value) and getAsString(FacesContext context, UIComponent component, Object value) did get called.
According to some other users, the injection works for them. But I am not sure they have multiple seam modules being used in the same war.
Our war is big and it is difficult to isolate our application to just use seam faces, not others. So I am not creating a sample war. But it should be easy for seam faces developer to test this.
I ended up doing bean lookup in my converter and it seems working and the bean is found in my converter.
public List<T> findBeanRef(FacesContext context, String beanELName) {
BeanManager bm = (BeanManager) (((ServletContext) context.getExternalContext().getContext())
.getAttribute("org.jboss.seam.faces.javax.enterprise.spi.BeanManager"));
Bean bean = bm.getBeans(beanELName).iterator().next();
CreationalContext ctx = bm.createCreationalContext(bean);
List<T> list = (List<T>) bm.getReference(bean, bean.getClass(), ctx);
return list;
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (SEAMCATCH-45) Misc documentation issues
by Jozef Hartinger (JIRA)
Misc documentation issues
-------------------------
Key: SEAMCATCH-45
URL: https://issues.jboss.org/browse/SEAMCATCH-45
Project: Seam Catch
Issue Type: Bug
Components: Documentation
Affects Versions: 3.0.0.Beta1
Reporter: Jozef Hartinger
Assignee: Jason Porter
Priority: Minor
Fix For: 3.0.0.Beta2
* Chapter 1 - "Catchs" typo
* Section 3.2.1 Note - missing space - "done bySeam Solder."
* Example in Section 3.2.2
** "evt.proceed();" - the proceed method is no longer part of the API
*** also mentioned in the fourth bullet point
** second bullet point - missing space - "typeCaughtException<T extends Throwable>"
* Section 3.2.2
** "Handler methods are similar to CDI observers and, as such, follow the same principals and guidelines as observers" - should be "s/principals/principles" IMHO
** "unMute()" instead of "unmute()" is mentioned
* Section 3.3 - missingspaces
** "such asConstraintViolationException."
** "If there's a handler forPersistenceException"
** "Catch is handling theSocketException"
* Section 3.4.2 "To make specifying precendence values more convenience" - "s/convenience/convenient"
* Section 3.5.2 Tip
** meaningless sucsh asEJBException
** likeSQLException
* Section 4.2.2 "
** qualifiers for theCaughtException"
** "To add a qualifier to be used when firing handlers they must be add to the ExceptionToCatch via the constructor (please see API docs for more info)"
*** they must be added
*** since they probably references the qualifiers, it should probably go something like this: "To add qualifiers to be used when firing handlers, the qualifiers must be added to the ExceptionToCatch via the constructor (please see API docs for more info)"
* Section 4.3 - "ServiceHandlers make for a very easy and concise way to define exception handlers take the following example comes from the jaxrs example in the distribution:" - this IMHO looks like two or more sentences accidentally put together
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (SEAMINTL-29) bundles messages doesnt return proper values
by Sebastian Sachtleben (JIRA)
bundles messages doesnt return proper values
--------------------------------------------
Key: SEAMINTL-29
URL: https://issues.jboss.org/browse/SEAMINTL-29
Project: Seam International
Issue Type: Bug
Components: Locales
Reporter: Sebastian Sachtleben
Priority: Critical
#{bundles.messages.MyKey} doesnt return the correct properties file after firing locale event and changed the locale of user. @Inject @Client Locale locale returns proper value after changing locale but bundles messages returns values from jdk locale. I will add non working example and I working example with helper class later once the repository is up again.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (SEAMINTL-27) ClassNotFoundException for org.joda.time.DateTimeZone
by Aaron Siri (JIRA)
ClassNotFoundException for org.joda.time.DateTimeZone
-----------------------------------------------------
Key: SEAMINTL-27
URL: https://issues.jboss.org/browse/SEAMINTL-27
Project: Seam International
Issue Type: Bug
Components: Time zones
Affects Versions: 3.0.0.Beta2
Environment: OS X, Glassfish v3.2b42, Java 1.6
Reporter: Aaron Siri
When attempting to use Seam 3 Security beta 2 on a stock Glassfish v3 environment I get an CNF for org.joda.time.DateTimeZone
SEVERE: Class [ org/joda/time/DateTimeZone ] not found. Error while loading [ class org.jboss.seam.international.datetimezone.DefaultDateTimeZoneProducer ]
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1620) "java.lang.IllegalStateException: No application context active" thrown on legacy components.xml declaration
by Przemyslaw Jaskierski (JIRA)
"java.lang.IllegalStateException: No application context active" thrown on legacy components.xml declaration
------------------------------------------------------------------------------------------------------------
Key: JBSEAM-1620
URL: http://jira.jboss.com/jira/browse/JBSEAM-1620
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.0.BETA1
Environment: Tomcat 6.0.13
Reporter: Przemyslaw Jaskierski
Fix For: 2.0.0.CR1
Reporting on Gavin's demand. After migrating from 1.3.0 ALPHA to latest 2.0.0 cvs snapshot I got this exception because on my classpath was an alternate components.xml with core:microcontainer. Please see forum topic for complete description. Posting only stacktrace here.
java.lang.IllegalStateException: No application context active
at org.jboss.seam.Component.forName(Component.java:1707)
at org.jboss.seam.Component.getInstance(Component.java:1757)
at org.jboss.seam.Component.getInstance(Component.java:1740)
at org.jboss.seam.Component.getInstance(Component.java:1719)
at org.jboss.seam.core.ResourceBundle.instance(ResourceBundle.java:209)
at org.jboss.seam.jsf.SeamApplicationMessageBundle.handleGetObject(SeamApplicationMessageBundle.jav
a:28)
at java.util.ResourceBundle.getObject(ResourceBundle.java:380)
at java.util.ResourceBundle.getString(ResourceBundle.java:346)
at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:151)
at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:122)
at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:277)
at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:828)
at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:486)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:381)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jul 7, 2007 7:21:43 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.conf
ig.ConfigureListener
javax.faces.FacesException: java.lang.IllegalStateException: No application context active
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:387)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.IllegalStateException: No application context active
at org.jboss.seam.Component.forName(Component.java:1707)
at org.jboss.seam.Component.getInstance(Component.java:1757)
at org.jboss.seam.Component.getInstance(Component.java:1740)
at org.jboss.seam.Component.getInstance(Component.java:1719)
at org.jboss.seam.core.ResourceBundle.instance(ResourceBundle.java:209)
at org.jboss.seam.jsf.SeamApplicationMessageBundle.handleGetObject(SeamApplicationMessageBundle.jav
a:28)
at java.util.ResourceBundle.getObject(ResourceBundle.java:380)
at java.util.ResourceBundle.getString(ResourceBundle.java:346)
at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:151)
at com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:122)
at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:277)
at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:828)
at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:486)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:381)
... 15 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years