[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2764) Factory method does not create objects properly
by Bogdan Minciu (JIRA)
Factory method does not create objects properly
-----------------------------------------------
Key: JBSEAM-2764
URL: http://jira.jboss.com/jira/browse/JBSEAM-2764
Project: JBoss Seam
Issue Type: Bug
Components: EJB3
Affects Versions: 2.0.1.GA
Reporter: Bogdan Minciu
Hello,
It seems that my @Factory method is recognizing the created objects only in its command block. I have this class:
@Stateful
@Name("xtw")
@Scope(ScopeType.SESSION)
@AutoCreate
public class XTextSessionWrapper implements LocalXTextSessionWrapper {
...
@In(required=false, create=true)
@Out
private XLanguage activeLanguage;
public String getText(String identifier) {
log.info("getText(1): identifier= #0, activeLanguage= #1", identifier, getActiveLanguage());
XTextEntry xte = xTextEntryDAO.findXTextEntry(identifier, getActiveLanguage());
log.info("getText(2): identifier= #0, activeLanguage= #1", identifier, getActiveLanguage());
xte.getXtext();
}
@Factory(value="activeLanguage", autoCreate=true)
public void initActiveLanguage() {
XLanguage xl = xLanguageDAO.findXLanguageByIdentifier("ro");
log.info("initActiveLanguage(1): activeLanguage initialized to #0", xl.getIdentifier());
setActiveLanguage(xl);
log.info("initActiveLanguage(1): activeLanguage initialized to #0", getActiveLanguage().getIdentifier());
}
public XLanguage getActiveLanguage() {
return activeLanguage;
}
public void setActiveLanguage(XLanguage activeLanguage) {
this.activeLanguage = activeLanguage;
}
...
}
And i am calling the getText() method. The method calling is as expected:
1. the injected activeLanguage is detecting that it has a null value,
2. the initActiveLanguage() factory method is called
3. then the getText() method is continuing its execution.
But, the problem is that when the application exists the @Factory method block, the created objects: activeLanguage is lost and reported again as null.
Here is the output:
12:43:48,203 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,203 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] initActiveLanguage(1): activeLanguage initialized to ro
12:43:48,703 INFO [XTextSessionWrapper] getText(1): identifier= com.brit.xcms.cms.Category.12.name, activeLanguage= null
12:43:49,234 INFO [XTextSessionWrapper] getText(2): identifier= com.brit.xcms.cms.Category.12.name, activeLanguage= null
Where did I went wrong? Why is the activeLanguage factoried value lost when i leave the initActiveLanguage() method?
--
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
12 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2697) Add attribute to s:link tag to make creation of magic dataModelSelection URL parameter optional
by Wolfgang Schwendt (JIRA)
Add attribute to s:link tag to make creation of magic dataModelSelection URL parameter optional
-----------------------------------------------------------------------------------------------
Key: JBSEAM-2697
URL: http://jira.jboss.com/jira/browse/JBSEAM-2697
Project: JBoss Seam
Issue Type: Feature Request
Components: JSF Controls
Affects Versions: 2.0.1.GA
Reporter: Wolfgang Schwendt
Priority: Minor
When an s:link component (org.jboss.seam.ui.component.UILink) is placed into a h:dataTable backed by a javax.faces.model.DataModel, the s:link automatically generates the magic token for the magic "dataModelSelection" parameter regardless of whether the latter is really needed or not.
This can generate ugly URLs. The following example is particulary ugly:
http://127.0.0.1:8080/seminaris/seminarDetails.seam?seminarId=2&dataModel...
Without the "dataModelSelection" parameter, the URL would look much cleaner:
http://127.0.0.1:8080/seminaris/seminarDetails.seam?semId=2
So my question: Couldn't we make the "dataModelSelection" parameter optional? (For example, by adding an attribute to the s:link tag).
Btw: I'm aware that org.jboss.seam.ui.component.UISeamCommandBase.getUrl() is the culprit that triggers inclusion of the the dataModelSelection parameter, so I know how to remove the dataModelSelection parameter generation, but it would be nice if also the officially released Seam version allowed the deactivation of the magic token generation.
Further, no magic token is generated if a UIDataTable is supplied by a normal List rather than a DataModel (cf. UISeamCommandBase.getSelection() ), but unfortunately there can be cases where it makes sense to supply the table data as DataModel rather than normal List.
--
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
12 years, 7 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3848) Seam fails to create and inject components when multiple ajax-requests are fired from a commandLink or commandButton, using ajax4jsf.
by etirk etirk (JIRA)
Seam fails to create and inject components when multiple ajax-requests are fired from a commandLink or commandButton, using ajax4jsf.
-------------------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-3848
URL: https://jira.jboss.org/jira/browse/JBSEAM-3848
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Environment: windows vista / rhel4
sun jdk5, jdk6 latest versions
jboss as 4.2.2 and 4.2.3
firefox2 and 3, ie 6 and 7.
Reporter: etirk etirk
Fix For: 2.1.2.GA
Seam fails to create and inject components when multiple ajax-requests are fired from a commandLink or commandButton, using ajax4jsf.
Replication found using seam-booking in examples, trunk as of 081216.
Rewrite the find-method in the HotelSearchAction-class, in the seam booking example application. It should look like this.
public void find() {
page = 0;
queryHotels();
try {
Thread.sleep(1000 * 5);
} catch (InterruptedException ignore) {
}
}
Now, start the application, register a user and enter main.html. Click multiple times on the search hotel button. Depending upon how fast your computer is, you might need to do more than a double-click. Sometimes you may need to klick fast up to 5-8 times. But it will occur.
You will end up with an exception that says:
Caused by javax.servlet.ServletException with message: javax.el.ELException: /main.xhtml @74,130 rendered=#{hotelSearch.nextPageAvailable}: Error reading nextPageAvailable on type org.javassist.tmp.java.lang.Object_$$_javassist_4
Which in turn comes from a synchronization problem.
Caused by org.jboss.seam.core.LockTimeoutException with message: could not acquire lock on @Synchronized component: hotelSearch
This is in a way funny, since the hotelSearch-component is not annotated with synchronized. Anyway, our application does not throw an exception like this, but we to have tried synchronizing our involved components, with no luck. Our exception is mostly this
Caused by javax.servlet.ServletException with message: javax.el.ELException: /layout/template.xhtml @18,59 rendered=#{authenticator.inSpecialMode}: Error reading inSpecialMode on type se.session.Authenticator_$$_javassist_4
Which in turn comes from the failed injections
Caused by org.jboss.seam.RequiredException with message: @In attribute requires non-null value: authenticator.entityManager
This problem occurs all over the application, always when an ajax request is double-clicked and seam tries to recreate seam components and runs out of time. In 99% of the case it is the first read property of our authenticator-component that fails, and most often it is that seam cannot create a entityManager to inject, and the system fails due to that the annotation is set to only inject, without create. Removing the entityManager from the component will only result in that seam cannot inject another component instead, until you have no injections left in authenticator, and it still fails!
Similar behaviour has been noticed using non-ajax calls, using standard h:commandButton/Link. This is however much more rare.
--
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
12 years, 10 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1279) use ExceptionFilter in Remoting
by Keith Naas (JIRA)
use ExceptionFilter in Remoting
-------------------------------
Key: JBSEAM-1279
URL: http://jira.jboss.com/jira/browse/JBSEAM-1279
Project: JBoss Seam
Issue Type: Feature Request
Components: Remoting
Affects Versions: 1.2.1.GA
Reporter: Keith Naas
Assigned To: Shane Bryzak
Currently, the Remoting resource class swallows all exceptions. Because of this, it is not possible to gracefully handle security restrictions in WebRemote methods from the client.
Two ideas:
# Simply bubble the Exception all the way up through the ResourceServlet. If the ResourceServlet throws the exception, the ExceptionFilter should pick up on it. The XHR would then receive the proper error code as defined in the pages.xml and could properly redirect the user to the correct login page.
# Have the ResourceServlet trap for NotLoggedInException's or NotAuthorizedException's and return the respective HTTP status code. The XHR would then receive the error code and be able to redirect the user to the correct login page.
--
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
13 years, 2 months