[JBoss Seam] - Re: ajax4jsf and outjecting to conversations
by baz
More information:
For both versions i do:
I start my app and navigate to the page containing my button then clearing the console and pressing the button
The generated debug output was compared:
*** C:\TEMP\filenonajax.txt Wed Feb 21 09:32:52 2007
| --- C:\TEMP\fileajax.txt Wed Feb 21 09:33:21 2007
| ***************
| *** 0 ****
| --- 1,3 ----
| + DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter: Filter start request processing at 21.02.07 09:24 for uri: /baz/faces/pages/showExperiment.xhtml
| + DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter: Incoming request has Content-Type header without character encoding: application/x-www-form-urlencoded
| + DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter: Filter request output to XML
| ***************
| *** 14 ****
| ! DEBUG org.jboss.seam.jsf.AbstractSeamPhaseListener: After restoring conversation context: ConversationContext(6)
| --- 17 ----
| ! DEBUG org.jboss.seam.jsf.AbstractSeamPhaseListener: After restoring conversation context: ConversationContext(20)
| ***************
| *** 21 ****
| ! DEBUG org.ajax4jsf.framework.renderer.AjaxContainerRenderer: Request parameters map org.apache.myfaces.context.servlet.RequestParameterMap@dea215
| --- 24 ----
| ! DEBUG org.ajax4jsf.framework.renderer.AjaxContainerRenderer: Request parameters map org.apache.myfaces.context.servlet.RequestParameterMap@c2e526
| ***************
| *** 552 ****
| ! DEBUG org.jboss.seam.core.Manager: Storing conversation state: 6
| --- 555 ----
| ! DEBUG org.jboss.seam.core.Manager: Storing conversation state: 20
| ***************
| *** 576 ****
| --- 580,582 ----
| + DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter: Finished request processing total time 141ms for uri: /baz/faces/pages/showExperiment.xhtml
| + DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter: Filter start request processing at 21.02.07 09:24 for uri: /baz/faces/managePages/experiment/createAnalysis.xhtml
| + DEBUG org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter: Filter request output to XML
| ***************
| *** 587,589 ****
| ! DEBUG org.jboss.seam.core.Manager: Found conversation id in request parameter: 6
| ! DEBUG org.jboss.seam.core.Manager: Restoring conversation with id: 6
| ! DEBUG org.jboss.seam.jsf.AbstractSeamPhaseListener: After restoring conversation context: ConversationContext(6)
| --- 593,597 ----
| ! DEBUG org.jboss.seam.core.Events: Processing event:org.jboss.seam.preSetVariable.org.jboss.seam.core.facesPage
| ! DEBUG org.jboss.seam.core.Events: Processing event:org.jboss.seam.postSetVariable.org.jboss.seam.core.facesPage
| ! DEBUG org.jboss.seam.core.Events: Processing event:org.jboss.seam.postCreate.org.jboss.seam.core.facesPage
| ! DEBUG org.jboss.seam.core.Manager: No stored conversation, or concurrent call to the stored conversation
| ! DEBUG org.jboss.seam.jsf.AbstractSeamPhaseListener: After restoring conversation context: ConversationContext(21)
| ***************
|
I have detected that the ajax version stores conversation context 20 but cannot restore it.
Whereas the nonajax version stores context 6 and was able to restore it.
For this output i set the option in log4j as this:
| log4j.rootLogger=debug, stdout
|
| log4j.logger.de.bafz=debug
| log4j.logger.org.jboss.seam=debug
| log4j.logger.org.jboss.seam.jsf.SeamVariableResolver=error
| log4j.logger.org.jboss.seam.Component=error
| log4j.logger.org.jboss.seam.contexts.Contexts=error
| log4j.logger.org.jboss.seam.util.Naming=error
| log4j.logger.org.jboss.resource.connectionmanager.IdleRemover=error
|
When setting Component,Contexts and SeamVariableResolver i get a very different logging output. I am currently examining this diffs. Will report later
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019791#4019791
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019791
19Â years, 2Â months
[Security & JAAS/JBoss] - How can I get a realm under a different security domain?
by snelson
Hi,
I have an requirement for a login process not supported by FORM authentication and JAAS out of the box. I need to have two roles within an app - one which enables access to a 2nd stage logon and one which allows access to protected resources.
With this use case I've created two login modules to process the login. The first login module is used as normal form authentication and works fine. However I would like to mimic some of the same behaviour in a custom valve to process authentication.
As I have two login modules I have them assigned against separate application policies. The second policy is not immediately available to the webapp as I believe the jboss-web.xml file allows a single security domain. I've managed to get the LoginContext to lookup and find the login to process it manually. However there is of course some additional function that JBoss provides through the realm with form-based authentication which I require in order for a user to correctly logon to the system.
Sorry for this long rambling post but if any of the JBoss developers have some hints on what I should be looking at that would be most useful.
Cheers,
Stephen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019784#4019784
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019784
19Â years, 2Â months
[EJB 3.0] - One PersistenceUnit, multiple DataSources
by 7rond
Hi
I'm currently working on a EJB3-based application where I have the following project layout of my EAR:
| -> myproject.ear
| -> api.jar
| -> dao interfaces and ejb entities
| -> ejb.jar
| -> ejb3 implementation of the dao interfaces
| -> persistence.jar
| -> contains persistence.xml and such
|
This is deployed standalone to JBoss-4.0.5-GA and works as intended. Now, the plan was to have several self-contained webapps (deployed in .wars, or optionally separate .ear's - whatever works), like this:
| -> webapp1.war
| -> webapp2.war
| -> (...)
|
The wish is that every webapp uses the persistence-manager configured in persistence.xml in persistence.jar, but that each webapp has a separate DataSource so I can let every webapp use the same schema structure and same entity beans, but separate databases. My current persistence.xml looks like this;
| <?xml version="1.0" encoding="UTF-8"?>
| <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
| <persistence-unit name="em" transaction-type="JTA">
| <jta-data-source>java:/TestDataSource</jta-data-source>
| <jar-file>../api.jar</jar-file>
| <properties>
| <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
| <property name="hibernate.show_sql" value="true" />
| <property name="hibernate.hbm2ddl.auto" value="update" />
| <property name="jboss.entity.manager.jndi.name" value="java:/TestEM" />
| </properties>
| </persistence-unit>
| </persistence>
|
My DAOs get a hold of their entitymanager like this:
| @Resource(mappedName = "java:/TestEM")
| private EntityManager em;
|
What I'm trying to achieve is to more or less set up a new web application with the minimal amount of hassle. One possible way of doing it would perhaps be setting up a new persistence-context in persistence.xml for each new website, but that would require rebuilding and redeploying the entire EAR, which I'd really like to avoid.
I guess one way of getting around this is to deploy the webapp with a "overriding" persistence.xml in a ejb-jar and package it together with the webapp in a separate .ear (though I don't know if this will work either, I haven't tested this yet), but this has some drawbacks as well;
- I would have to duplicate the persistence-unit-properties and jar-file-properties for each webapp, making maintenance hard if there's a change in the properties there. It would require that each and every webapp is rebuilt and redeployed - not just the EAR.
- It's a more complex deployment than just dropping in a .war in the deployment folder - though this I can live with.
There will be a -ds.xml in the deploy/ folder for each webapp, containing information about each application's data source. If there would be some way of "overriding" the jta-data-source for the EntityManager on a site-basis, or injecting a new DataSource into the EntityManager, I guess that would be a way of getting this to work.
I'm kind of new to JBoss and EJB3 in general, and I'm trying to work out the "best practice" way of doing things to avoid clutter later down the road. If any of the above is a shitty way of solving what I intend to do, do say so.
Anyways, this separate-db-per-webapp-thing is a requirement for this app, and it's also a requirement that it involves as little work as possible to get a new webapp up and running - e.g. too much rebuilding and redeployment of the application core is out of the question.
Any pointers on which direction I should go in would be very appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019781#4019781
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019781
19Â years, 2Â months
[JBoss Seam] - Re: what is concurrent-request-timeout
by quilleashm
To the first question
Seam serialises access to a conversation to stop concurrent requests (usually AJAX) interfering which each other. The timeout is how long a request will wait for the conversation to be "unlocked" by the conversation currently using it. It the timeout expires the request will not reacquire the conversation and just create a temporary one instead.
Making the timeout smaller increases the chance of a request timing out while waiting for the conversation but it reduces the time it will block for. Making the timeout bigger makes it less likely that the request will time out while waiting but may block for longer waiting.
Depends on your situation whether avoiding request blocks or avoiding "missing" the conversation is more important to you.
HTH.
Mike.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019766#4019766
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019766
19Â years, 2Â months