[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4488) Datamodel: casting exception on @Destroy
by Jeff Wexler (JIRA)
Datamodel: casting exception on @Destroy
----------------------------------------
Key: JBSEAM-4488
URL: https://jira.jboss.org/jira/browse/JBSEAM-4488
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.2.GA
Environment: Windows Server 2003, Jboss AS 5.1.0.GA, PostgreSQL 8.4
Reporter: Jeff Wexler
Priority: Minor
Getting the following error for a datamodel when it is used to display an h:dataTable. The dataTable is displayed fine. However, in the log, I receive:
15:04:42,312 WARN [Component] Exception calling component @Destroy method: deliveryDeadlineOptionList
javax.ejb.EJBException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to javax.faces.model.DataModel
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
...
The bean for this is used for the following purposes:
1. Value of an s:selectItems
2. Value of an h:dataTable (i.e., as mentioned above)
3. Injected and used in another bean
The bean:
@Stateful
@Scope(CONVERSATION)
@Name("deliveryDeadlineOptionList")
@TransactionAttribute(REQUIRES_NEW)
public class DeliveryDeadlineOptionListAction implements DeliveryDeadlineOptionList, Serializable
{
@PersistenceContext(type=PersistenceContextType.EXTENDED)
@In(create=true)
private EntityManager entityManager;
@DataModel
private List<DeliveryDeadlineOption> deliveryDeadlineOptionsList;
@DataModelSelection
private DeliveryDeadlineOption deliveryDeadlineOption;
@Create
public void create() {getDeliveryDeadlineOptionsList();}
@Factory
public List<DeliveryDeadlineOption> getDeliveryDeadlineOptionsList(){
return (List<DeliveryDeadlineOption>) entityManager.createQuery("select c from DeliveryDeadlineOption c")
.getResultList();
}
public DeliveryDeadlineOption getDeliveryDeadlineOption(){return deliveryDeadlineOption;}
@Destroy
@Remove
public void destroy() {}
}
Relevant portions of the bean where deliveryDeadlineOptionList is injected and used:
@Stateful
@Name("quoteCalculate")
@Scope(ScopeType.CONVERSATION)
public class QuoteCalculatingAction implements QuoteCalculating
{
@PersistenceContext(type=PersistenceContextType.EXTENDED)
@In(create=true)
private EntityManager entityManager;
...
@In(value="deliveryDeadlineOptionsList", create=true)
private List<DeliveryDeadlineOption> deliveryDeadlineOptions;
@DataModel
private List<DeliveryDeadlineOption> selectedDeliveryDeadlineOptions;
...
(Standard getters and setters for above)
public void selectedDeliveryDeadlineOptionsChange(ValueChangeEvent valueChangeEvent) {
setSelectedDeliveryDeadlineOptions((List<DeliveryDeadlineOption>) valueChangeEvent.getNewValue());
...
}
...
@Destroy
@Remove
public void destroy() {}
}
--
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
14 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4400) SeleniumDateSelector cannot be compiled with JDK 5
by Ondrej Skutka (JIRA)
SeleniumDateSelector cannot be compiled with JDK 5
--------------------------------------------------
Key: JBSEAM-4400
URL: https://jira.jboss.org/jira/browse/JBSEAM-4400
Project: Seam
Issue Type: Bug
Components: Test Harness
Affects Versions: 2.2.1.CR1
Reporter: Ondrej Skutka
Assignee: Karel Piwko
Priority: Critical
Fix For: 2.2.1.CR1
src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeleniumDateSelector.java cannot be compiled using JDK 5:
[javac] /mnt/hudson_workspace/workspace/Seam-2.2.X-ftest-jboss5/jdk/java15/label/RHEL5_x86/seam/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeleniumDateSelector.java:181: cannot find symbol
[javac] symbol : method getInstance()
[javac] location: class java.text.DateFormatSymbols
[javac] final List<String> months = Arrays.asList(DateFormatSymbols.getInstance().getMonths());
[javac] ^
[javac] 1 error
--
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
14 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4401) Component locale-config (org.jboss.seam.international.localeConfig) does not set the locale things in JSF context if JSF is not initialized before Seam
by Denis Forveille (JIRA)
Component locale-config (org.jboss.seam.international.localeConfig) does not set the locale things in JSF context if JSF is not initialized before Seam
-------------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-4401
URL: https://jira.jboss.org/jira/browse/JBSEAM-4401
Project: Seam
Issue Type: Bug
Affects Versions: 2.2.0.GA, 2.2.1.CR1
Environment: WebSphere v7.0.0.5 (That is bundled with JSF-RI 1.2_07+)
Reporter: Denis Forveille
Using the localeConfig component by declaring <international:locale-config default-locale="fr" supported-locales="fr en" /> in component.xml does not work as-is.
It works if JSF is initialized BEFORE Seam by adding the lines
<listener><listener-class>com.sun.faces.config.ConfigureListener</listener-class></listener>
before
<listener><listener-class>org.jboss.seam.servlet.SeamListener</listener-class></listener>
in web.xml
If the JSF listener is not there, JSF is not initialized when Seam bootstraps its application scope components, and so the faces application context is not available
In the case of the localeConfig component, line 136 of org.jboss.seam.international.LocaleConfig throws an IllegalStateException that is silently swallowed (!) when JSF is not initialized
Doing so the the default locales and supported locales are not defined to JSF thanks to the test in line 58.
IMHO, at a minimum this should be stated in the doc that the component works only if JSF is initialized before seam, or somehting should be changed in the code to set the JSF locale things when JSF application context is initialized
org.jboss.seam.international.LocaleConfig lines around 136:
private Application getApplication()
{
try
{
ApplicationFactory factory = (ApplicationFactory) FactoryFinder
.getFactory(FactoryFinder.APPLICATION_FACTORY);
return factory.getApplication();
}
catch (IllegalStateException e)
{
// just in case, for units and the like
// if we can't do it, it just wan't meant to be
return null;
}
}
around line 58:
@Create
public void initLocaleConfig()
{
Application application = getApplication();
if (application == null)
{
return;
}
--
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
14 years, 11 months