[JBoss Seam] - Re: no page context active exception when use seam pdf
by jiyuan_wang
After debugging, find out the problem located in org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(PhaseEvent event).
there is a fix for a bug in MyFaces prior to 1.1.3 (I don't know what exactly is the bug though).
------------------------------------------------------------
//workaround for a bug in MyFaces prior to 1.1.3
if ( Init.instance().isMyFacesLifecycleBug() )
{
Lifecycle.endRequest( facesContext.getExternalContext() );
}
------------------------------------------------------------
And in Lifecycle.endRequest(), it will clear all the Threadlocals.
------------------------------------------------------------
Contexts.eventContext.set(null);
Contexts.pageContext.set(null);
Contexts.sessionContext.set(null);
Contexts.conversationContext.set(null);
Contexts.businessProcessContext.set(null);
Contexts.applicationContext.set(null);
------------------------------------------------------------
After clearing all the contexts, AbstractSeamPhaseListener tries to get an instance of the FacesPage and store the conversation and page flow.
------------------------------------------------------------
FacesPage.instance().storeConversation();
FacesPage.instance().storePageflow();
------------------------------------------------------------
And here comes the exceptions, which are swallowed by SEAM though (but shows in the server/app log). In the method of getting an instance of FacesPage, it will check if the page context is active or not. if not, then throws an exception.
------------------------------------------------------------
public static FacesPage instance()
{
if ( !Contexts.isPageContextActive() )
{
throw new IllegalStateException("No page context active");
}
return (FacesPage) Component.getInstance(FacesPage.class, ScopeType.PAGE);
}
------------------------------------------------------------
I guess I will try to upgrade MyFaces lib to a newer version to see if I can remove this annoying error message in the log.
or anybody knows how to solve this problem and let me know, I'll really appreciate it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101097#4101097
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101097
18 years, 5 months
[JBoss Seam] - identity authenticator method runs twice
by jgreene
My app uses Seam, JSF, oc4j, and JSPs. I'm using the Identity feature in Seam to define my login authentication method. The funny problem I'm having is that when authentication fails (due to invalid password, for example), the login method actually executes twice. If I remove the line in components.xml that points to my login() method as the login authenticator, and simply use action="#{loginManager.login}" in my login page command button, the method executes only once as expected. As a sanity check, I reduced my login method to a single System.out.println, and returned false. My test string printed twice to the console until I modified the components.xml. Has anyone else seen this? Is there some configuration setting that pertains to this...?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101094#4101094
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101094
18 years, 5 months
[JBossCache] - Re: JDBCCacheLoader problem in java application
by gmeroz
The code to produce this error:
| import org.jboss.cache.pojo.PojoCache;
| import org.jboss.cache.pojo.PojoCacheFactory;
| import org.jboss.cache.Fqn;
|
| public class JDBCCacheTest {
|
| public static final String CONF_FILE = "jboss-cache.xml";
| public static void main(String[] args) {
| PojoCache cache = PojoCacheFactory.createCache(CONF_FILE, true);
| cache.getCache().removeNode(Fqn.fromString("C"));
| for (int i = 0; i < 100; i++) {
| cache.attach("C/"+ Integer.toString(i), Integer.toString(i));
| System.out.println("added "+i+" dummy node to Jboss cache.");
| }
| }
| }
|
| and jbosscache config file:
|
| | <?xml version="1.0" encoding="UTF-8"?>
| |
| | <server>
| |
| | <classpath codebase="./lib/jboss" archives="jbosscache.jar,jboss-cache.jar, jgroups.jar,jboss-aop-jdk50.jar,javassist.jar,jboss-common-core.jar,jboss-serialization.jar,pojocache.jar"/>
| |
| | <mbean code="org.jboss.cache.TreeCache"
| | name="jboss.cache:service=EngineServerTreeCache">
| |
| | <depends>jboss:service=Naming</depends>
| | <depends>jboss:service=TransactionManager</depends>
| | <depends>jboss.jca:service=DataSourceBinding,name=beDS</depends>
| | <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.DummyTransactionManagerLookup</attribute>
| |
| | <attribute name="CacheMode">LOCAL</attribute>
| | <attribute name="CacheLoaderConfiguration">
| | <config>
| | <passivation>false</passivation>
| | <!--<preload>/</preload>-->
| | <shared>true</shared>
| |
| | <cacheloader>
| | <class>com.bevents.infra.service.cache.JDBCCacheLoader</class>
| | <properties>
| | cache.jdbc.table.name=jbosscache_engine_cache
| | cache.jdbc.table.create=true
| | cache.jdbc.table.drop=true
| | cache.jdbc.table.primarykey=jbosscache_engine_cache_pk
| | cache.jdbc.fqn.column=fqn
| | cache.jdbc.fqn.type=varchar(255)
| | cache.jdbc.node.column=node
| | cache.jdbc.node.type=blob
| | cache.jdbc.parent.column=parent
| | cache.jdbc.driver=oracle.jdbc.driver.OracleDriver
| | cache.jdbc.url=jdbc:oracle:thin:@dbms01:1521:besapp
| | cache.jdbc.user=some_db
| | cache.jdbc.password=some_db
| | </properties>
| |
| | <async>false</async>
| | <fetchPersistentState>false</fetchPersistentState>
| | <ignoreModifications>false</ignoreModifications>
| | <purgeOnStartup>false</purgeOnStartup>
| | </cacheloader>
| | </config>
| | </attribute>
| | </mbean>
| |
| | </server>
| |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101088#4101088
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101088
18 years, 5 months