[JBoss JIRA] Created: (SEAMFACES-185) Add support for activating beans based on the JSF project stage
by Christian Kaltepoth (JIRA)
Add support for activating beans based on the JSF project stage
---------------------------------------------------------------
Key: SEAMFACES-185
URL: https://issues.jboss.org/browse/SEAMFACES-185
Project: Seam Faces
Issue Type: Feature Request
Affects Versions: 3.0.2
Reporter: Christian Kaltepoth
Hey all,
I think it would be a great enhancement if Seam Faces could support activation of beans only in specific JSF project stages. MyFaces CODI supports a similar feature with the {{@ProjectStageActivated}} annotation.
Examples:
{code}
@ProductionStage
@ApplicationScoped
public class ProductionEntityManagerProducer {
...
}
@DevelopmentStage
@ApplicationScoped
public class DevelopmentEntityManagerProducer {
...
}
{code}
Another very interesting usecase would be to enable specific interceptors/decorators only in development stage. This could be used for debugging stuff that is only interesting during development.
I think this could be easily implenented using an CDI extension that vetos beans that do not match the active project stage. The only problem I'm seeing is that we will need the JSF project stage in an very early stage during application startup (actually before JSF started up). This means that we would have to determine the project stage JSF will use ourselves.
The JSF spec describes that the project stage can either be set with a servlet context parameter or using JNDI. If the latter one is uses, we could simply do a JNDI lookup in the extension. No problem here. If the developer uses a servlet context parameter the situation will become more problematic, because we will need a reference to the ServletContext in the extension.
What do you think of this feature? Would it be useful? Any further ideas for the implementation?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 12 months
[JBoss JIRA] Created: (SEAMFACES-191) PrettyFaces cannot find ApplicationFactory
by xylocore (JIRA)
PrettyFaces cannot find ApplicationFactory
------------------------------------------
Key: SEAMFACES-191
URL: https://issues.jboss.org/browse/SEAMFACES-191
Project: Seam Faces
Issue Type: Bug
Components: URL Rewriting
Affects Versions: 3.0.2
Environment: Windows 7, JBoss AS Head, prettyfaces-jsf2 3.3.0
Reporter: xylocore
After deploying a webapp, the first access to a page throws the following exception:
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)
javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)
com.ocpsoft.pretty.faces.util.FacesFactory.getApplication(FacesFactory.java:30)
com.ocpsoft.pretty.faces.config.PrettyConfigListener.requestInitialized(PrettyConfigListener.java:47)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)
java.lang.Thread.run(Thread.java:662)
This exception is not consistent. If I restart the server, the exception may or may not occur again. I created a stripped down webapp and tested with that. The problem occurs there too.
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>a1</groupId>
<artifactId>a1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<seam.faces.version>3.0.2.Final</seam.faces.version>
<seam.catch.version>3.0.0.Final</seam.catch.version>
</properties>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam.persistence</groupId>
<artifactId>seam-persistence</artifactId>
<version>3.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.seam.faces</groupId>
<artifactId>seam-faces-api</artifactId>
<version>${seam.faces.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam.faces</groupId>
<artifactId>seam-faces-impl</artifactId>
<version>${seam.faces.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam.catch</groupId>
<artifactId>seam-catch-api</artifactId>
<version>${seam.catch.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.seam.catch</groupId>
<artifactId>seam-catch-impl</artifactId>
<version>${seam.catch.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>1.6.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.ocpsoft</groupId>
<artifactId>prettyfaces-jsf2</artifactId>
<version>3.3.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>JBOSS_NEXUS</id>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories>
<build>
<finalName>a1</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
ViewPersonalityBean.java:
package com.xylocore.ebco.web.model;
import java.io.Serializable;
import java.util.UUID;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
@Named( "viewPersonality" )
@RequestScoped
public class ViewPersonalityBean
implements
Serializable
{
private static final long serialVersionUID = 2493114173508560424L;
private String personalityUuid;
public String getPersonalityUuid() {
return personalityUuid;
}
public void setPersonalityUuid( String aPersonalityUuid ) {
personalityUuid = aPersonalityUuid;
}
public String getFullName() {
return "Bob Johnson";
}
public void loadPersonality() {
}
}
viewPersonality:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.org/seam/faces">
<f:view>
<f:metadata>
<f:viewParam name="id" value="#{viewPersonality.personalityUuid}"/>
<s:viewAction action="#{viewPersonality.loadPersonality}"/>
</f:metadata>
<h:head>
<title>Welcome</title>
</h:head>
<h:body>
<h:form>
<h3>#{viewPersonality.fullName}!</h3>
</h:form>
</h:body>
</f:view>
</html>
beans.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<interceptors>
<class>org.jboss.seam.transaction.TransactionInterceptor</class>
</interceptors>
</beans>
faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
</faces-config>
web.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="3.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>a1</display-name>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/index.html</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
</web-app>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 12 months
[JBoss JIRA] Created: (JBSEAM-4639) In JSF2, Seam sets JSF view Id to null for postback requests
by Alex Savitsky (JIRA)
In JSF2, Seam sets JSF view Id to null for postback requests
------------------------------------------------------------
Key: JBSEAM-4639
URL: https://jira.jboss.org/jira/browse/JBSEAM-4639
Project: Seam
Issue Type: Bug
Components: JSF Integration
Affects Versions: 2.2.0.GA
Environment: JSF 2 RI (Mojarra) v.2.0.2.FCS
Reporter: Alex Savitsky
Priority: Critical
Run attached test-bug-2.2.1.war (I've been using Tomcat 6.0, but any web container will do). Access index.jsf in the context root (usually http://localhost:your-startup-port/your-context-root/index.jsf) and click the "Add" button. Note the exception, and also note the debug output in the system console:
Before phase RESTORE_VIEW 1, view id = N/A (no root)
After phase RESTORE_VIEW 1, view id = /index.xhtml
Before phase RENDER_RESPONSE 6, view id = /index.xhtml
TestBean created
After phase RENDER_RESPONSE 6, view id = /index.xhtml
Before phase RESTORE_VIEW 1, view id = N/A (no root)
After phase RESTORE_VIEW 1, view id = null
Before phase APPLY_REQUEST_VALUES 2, view id = null
After phase APPLY_REQUEST_VALUES 2, view id = null
Before phase PROCESS_VALIDATIONS 3, view id = null
After phase PROCESS_VALIDATIONS 3, view id = null
Before phase UPDATE_MODEL_VALUES 4, view id = null
After phase UPDATE_MODEL_VALUES 4, view id = null
Before phase INVOKE_APPLICATION 5, view id = null
After phase INVOKE_APPLICATION 5, view id = null
The very same setup without Seam (test-bug-clean.war, with no Seam JAR in WEB-INF/lib, and with Seam commented out in web.xml) has the button working (validation messages appear) as well as different debug output:
Before phase RESTORE_VIEW 1, view id = N/A (no root)
After phase RESTORE_VIEW 1, view id = /index.xhtml
Before phase RENDER_RESPONSE 6, view id = /index.xhtml
TestBean created
After phase RENDER_RESPONSE 6, view id = /index.xhtml
Before phase RESTORE_VIEW 1, view id = N/A (no root)
After phase RESTORE_VIEW 1, view id = /index.xhtml
Before phase APPLY_REQUEST_VALUES 2, view id = /index.xhtml
After phase APPLY_REQUEST_VALUES 2, view id = /index.xhtml
Before phase PROCESS_VALIDATIONS 3, view id = /index.xhtml
After phase PROCESS_VALIDATIONS 3, view id = /index.xhtml
Before phase RENDER_RESPONSE 6, view id = /index.xhtml
After phase RENDER_RESPONSE 6, view id = /index.xhtml
The debug phase listener source can be found in /WEB-INF/classes/test/TestListener.java
--
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
13 years
[JBoss JIRA] Created: (JBSEAM-4652) Using JSF 2 And Seam
by browny browny (JIRA)
Using JSF 2 And Seam
--------------------
Key: JBSEAM-4652
URL: https://jira.jboss.org/browse/JBSEAM-4652
Project: Seam
Issue Type: Bug
Components: JSF Integration
Affects Versions: 2.2.1.CR1, 2.2.0.GA
Environment: JBoss-5.1.0 AS , Seam 2.2.0 & Seam 2.2.1 CR1, JSF 2(Mojarro - 2.0.2)
Reporter: browny browny
When using PageFlow with JSF 2.0 during transition from one page to another i get an excption ::
javax.servlet.ServletException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.lang.NullPointerException
org.jboss.seam.document.DocumentStorePhaseListener.beforePhase(DocumentStorePhaseListener.java:38)
com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
The same example works fine with JSF 1.2.But with JSF 2.0 i get the same exception for Seam 2.2.0 and 2.2.1
Anyhow i get the seam variables resolved and application succeefuly deployed with JSF 2.0 but this error during page transition occurs. I use pageflow (jbpm-jpdl.jar) for stateful navigation.
Any clues??
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[JBoss JIRA] Created: (JBSEAM-4528) static pages don't work at all with database down and XA datasource used
by deanhiller (JIRA)
static pages don't work at all with database down and XA datasource used
------------------------------------------------------------------------
Key: JBSEAM-4528
URL: https://jira.jboss.org/jira/browse/JBSEAM-4528
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.2.0.GA
Environment: postgres or oracle with postgres or oracle XADatasource. postgres jdbc driver is fine while oracle driver is not
Reporter: deanhiller
Priority: Critical
If this is a hibernate bug, please report hibernate issue and ticket here as other seam users will run into this problem and it looks like a seam framework problem(or at least could be solved in seam but it may be possible to solve in hibernate too and could be solved in each and every driver datasource as well).
Steps to reproduce
1. start up the jboss 5.1.0 with latest seam
2. pull your internet connection so the db is gone
3. have all your customers go to a static page like /web/error.xhtml
RESULT: jboss goes to it's knees as users in IE end up in infinite redirects to your server causing more and more load on the server. The drivers talk to the database when they should not be. I have a work around proxy driver for oracle's jdbc driver. I do not however have a fix for oracle's datasource or postgres datasource.
I imagine someone could write a proxy datasource that would solve this problem for all people, hibernate, seam and all xa drivers. I will attach logs of postgres xa driver and oracle one but basically they are trying to open a connection to database when ANY http request comes in until waiting to see if we actually do any select statements or updates or inserts. For some reason, the postgres driver and oracle driver where fine here...they did not make db requests when an http request came in. The oracle driver however did make a request to the db when commit is called even if no sql was done against the db where postgres driver ignored the commit since no sql was done. I will try to attach files or more comments here. PLEASE if you report a tic in hibernate put it in here for others to find when they hit this issue.
keyphrases:
seam doesn't work when database goes down
seam infinite redirect on db outage
database failure causes seam to not work
--
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
13 years