[JBoss Seam] - Update transactions occurring prematurely in Seam app
by asookazian
This may be a EntityManager flush issue but not sure...
I have the following xhtml for a Seam2.0.0.GA web app backed by 2 SFSB's (one conversation scoped and the other session scoped). The problem is when user clicks 'yes' for any radio button in any row of the form/dataTable, an update transaction is persisted to the database for that row/column. The update should only happen when user clicks submit in one of the rich:modalPanel forms.
I've ran this test case thru the debugger several times and the submit method is not being called. I'm thinking the EntityManager/PersistenceContext is being automatically flushed somehow but not sure if or when this is happening. I did remove the a4j:support tag for one of the columns and moved the js function call to onclick event handler. The table did not get updated like before. So somehow the a4j:support is causing this to happen I think...
Any hints? thx.
<h:form id="mainForm">
|
| <h:outputText value="No Direct Reports" rendered="#{myAuditList != null and myAuditList.rowCount==0}"/>
| <h:dataTable id="dataTable1" value="#{myAuditList}" var="myRow" rendered="#{myAuditList != null and myAuditList.rowCount > 0}"
| styleClass="dataTable" rowClasses="oddRow, evenRow" frame="hsides">
| <h:column>
| <f:facet name="header">Status</f:facet>
|
| <h:graphicImage id="statusImage" value="#{securityAuditAction.processGraphicImage(myRow[1].auditProgress)}"/>
| </h:column>
| <h:column>
| <f:facet name="header">Employee Name</f:facet>
|
| <!-- siteId and employeeNumber hidden fields are used for all radio buttons -->
| <h:outputText id="employeeName" value="#{myRow[0].id.employeeName}"/>
| <h:inputHidden id="employeeNameHidden" value="#{myRow[0].id.employeeName}"/>
| <h:inputHidden id="siteId" value="#{myRow[0].id.siteId}"/>
| <h:inputHidden id="employeeNumber" value="#{myRow[0].id.employeeNumber}"/>
| </h:column>
|
| <h:column>
| <f:facet name="header">SiteId</f:facet>
|
| <h:outputText value="#{myRow[0].id.siteId}"/>
| </h:column>
|
| <h:column>
| <f:facet name="header">EmployeeNumber</f:facet>
|
| <h:outputText value="#{myRow[0].id.employeeNumber}"/>
| </h:column>
|
| <h:column>
| <f:facet name="header">Adjustment Limit</f:facet>
|
| <h:outputText value="#{myRow[0].id.employeeNumber}"/>
| </h:column>
|
|
| <h:column>
| <f:facet name="header">Account Approved?</f:facet>
|
| <h:panelGrid columns="2">
| <h:selectOneRadio id="accountApprovedRB" value="#{myRow[1].icomsAccountApproved}">
|
| <a4j:support event="onclick"
| oncomplete="processNote(#{myAuditList.getRowIndex()}, 'accountApproved')"
| action="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'accountApproved', myAuditList)}"
| ajaxSingle="true"
| reRender="mainForm"/>
|
| <f:selectItems value="#{securityAuditAction.securityAuditRadioButtons}" />
| </h:selectOneRadio>
|
| <h:graphicImage id="acctGraphic" value="/img/icon_edit.gif"
| rendered="#{noteAction.getRenderNoteGraphic(myAuditList.getRowIndex(), 'accountApproved') ||
| securityAuditAction.getLoadedNote(myAuditList.getRowIndex(), 'accountApproved')}">
| <a4j:support event="onclick"
| onclick="editNote(#{myAuditList.getRowIndex()}, 'accountApproved')"
| actionListener="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'accountApproved', myAuditList)}"/>
| </h:graphicImage>
| </h:panelGrid>
| </h:column>
|
|
| <h:column>
| <f:facet name="header">Security Level Approved?</f:facet>
|
| <h:panelGrid columns="2">
| <h:selectOneRadio id="securityLevelApprovedRB" value="#{myRow[1].securityLevelApproved}"
| rendered="#{noteAction.getRenderRadioButtons(myAuditList.getRowIndex())}">
| <a4j:support event="onclick"
| oncomplete="processNote(#{myAuditList.getRowIndex()}, 'secLevelApproved')"
| action="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'secLevelApproved', myAuditList)}"/>
| <f:selectItems value="#{securityAuditAction.securityAuditRadioButtons}" />
| </h:selectOneRadio>
| <h:graphicImage id="securityLevelGraphic" value="/img/icon_edit.gif"
| rendered="#{noteAction.getRenderNoteGraphic(myAuditList.getRowIndex(), 'secLevelApproved') ||
| securityAuditAction.getLoadedNote(myAuditList.getRowIndex(), 'secLevelApproved')}">
| <a4j:support event="onclick"
| onclick="editNote(#{myAuditList.getRowIndex()}, 'secLevelApproved')"
| action="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'secLevelApproved', myAuditList)}"
| reRender="out3"
| />
| </h:graphicImage>
| </h:panelGrid>
| </h:column>
|
|
| <h:column>
| <f:facet name="header">Adjustment Limit Approved?</f:facet>
|
| <!-- <h:panelGrid columns="2"> -->
| <h:panelGrid columns="3">
| <h:selectOneRadio id="adjustmentLimitApprovedRB" value="#{myRow[1].adjustmentLimitApproved}"
| rendered="#{noteAction.getRenderRadioButtons(myAuditList.getRowIndex())}">
| <a4j:support event="onclick"
| oncomplete="processNote(#{myAuditList.getRowIndex()}, 'adjLimitApproved')"
| action="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'adjLimitApproved', myAuditList)}"/>
| <f:selectItems value="#{securityAuditAction.securityAuditRadioButtons}" />
| </h:selectOneRadio>
| <h:graphicImage id="adjLimitGraphic" value="/img/icon_edit.gif"
| rendered="#{noteAction.getRenderNoteGraphic(myAuditList.getRowIndex(), 'adjLimitApproved') ||
| securityAuditAction.getLoadedNote(myAuditList.getRowIndex(), 'adjLimitApproved')}">
| <a4j:support event="onclick"
| oncomplete="editNote(#{myAuditList.getRowIndex()}, 'adjLimitApproved')"
| actionListener="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'adjLimitApproved', myAuditList)}"
| reRender="mpNoteAndEmployeeSubmit"/>
| </h:graphicImage>
| <h:commandButton id="submitEmployee" value="Submit" actionListener="#{securityAuditAction.submit}" style="visibility:hidden"/>
| </h:panelGrid>
| </h:column>
|
| </h:dataTable>
|
| </h:form>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113870#4113870
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113870
18 years, 4 months
[Clustering/JBoss] - Re: Setting up multiple instances of JBoss in different mach
by viswanadhvk
HI shoeb,
Thanks for your reply.
Let me briefly explain you, what I did .
I am using windows XP , and JBoss 4.2.1.
(1) I changed DefaultPartition to TestPartition at " all\deploy\cluster-service.xml "
| <server>
|
| <!-- ==================================================================== -->
| <!-- Cluster Partition: defines cluster -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.ha.framework.server.ClusterPartition"
| name="jboss:service=${jboss.partition.name:TestPartition}">
|
| <!-- Name of the partition being built -->
| <attribute name="PartitionName">${jboss.partition.name:TestPartition}</attribute>
|
(2) Even though I am NOT using SFSB (Stateful Session Bean) .
I modified the below code at cluster-service.xml for "SFSB"
changed DefaultPartition to TestPartition
|
| <!-- ==================================================================== -->
| <!-- HA Session State Service for SFSB -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService"
| name="jboss:service=HASessionState">
| <depends>jboss:service=Naming</depends>
| <!-- We now inject the partition into the HAJNDI service instead
| of requiring that the partition name be passed -->
| <depends optional-attribute-name="ClusterPartition"
| proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends>
| <!-- JNDI name under which the service is bound -->
| <attribute name="JndiName">/HASessionState/Default</attribute>
| <!-- Max delay before cleaning unreclaimed state.
| Defaults to 30*60*1000 => 30 minutes -->
| <attribute name="BeanCleaningDelay">0</attribute>
| </mbean>
|
|
(3)I modified the "HA-JNDI" also at cluster-service.xml
changed DefaultPartition to TestPartition
| <!-- ==================================================================== -->
| <!-- HA JNDI -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.ha.jndi.HANamingService"
| name="jboss:service=HAJNDI">
| <!-- We now inject the partition into the HAJNDI service instead
| of requiring that the partition name be passed -->
| <depends optional-attribute-name="ClusterPartition"
| proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends>
| <!-- Bind address of bootstrap and HA-JNDI RMI endpoints -->
| <attribute name="BindAddress">${jboss.bind.address}</attribute>
| <!-- Port on which the HA-JNDI stub is made available -->
|
(4) I modified at the "HA-Invokers"
changed DefaultPartition to TestPartition
| <!-- ==================================================================== -->
| <!-- HA Invokers -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.invocation.unified.server.UnifiedInvokerHA"
| name="jboss:service=invoker,type=unifiedha">
| <depends>jboss:service=TransactionManager</depends>
| <depends optional-attribute-name="Connector"
| proxy-type="attribute">jboss.remoting:service=Connector,transport=socket</depends>
| <depends>jboss:service=${jboss.partition.name:TestPartition}</depends>
| </mbean>
|
(5) I changed at "Distributed cache invalidation"
| <!-- ==================================================================== -->
| <!-- Distributed cache invalidation -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.cache.invalidation.bridges.JGCacheInvalidationBridge"
| name="jboss.cache:service=InvalidationBridge,type=JavaGroups">
| <!-- We now inject the partition into the HAJNDI service instead
| of requiring that the partition name be passed -->
| <depends optional-attribute-name="ClusterPartition"
| proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends>
| <depends>jboss.cache:service=InvalidationManager</depends>
| <attribute name="InvalidationManager">jboss.cache:service=InvalidationManager</attribute>
| <attribute name="BridgeName">DefaultJGBridge</attribute>
| </mbean>
|
in all the above places I changed the name of the partition name. I changed from DefaultPartition to TestPartition, thats it. Other than that I haven't changed any thing.
(6) I changed another file called farm-service.xml
which is at "I changed all\deploy\deploy.last\farm-service.xml"
| <!-- ===================================================================== -->
| <!-- -->
| <!-- Sample Farming Service Configuration -->
| <!-- -->
| <!-- ===================================================================== -->
|
| <server>
|
| <mbean code="org.jboss.ha.framework.server.FarmMemberService"
| name="jboss:service=FarmMember,partition=${jboss.partition.name:TestPartition}" >
|
| <!-- We now inject the partition into the HAJNDI service instead
| of requiring that the partition name be passed -->
| <depends optional-attribute-name="ClusterPartition"
| proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends>
|
| <depends>jboss.web:service=WebServer</depends>
|
|
(7) I changed this file also
deploy-hasingleton-service.xml which is at all\deploy\
If I won't change this file , JBoss server showing error message as this Partition (defaultPartition)that it is not deployed yet in the server.So I need to change this.
| <server>
|
| <!--
| |
| | Use the deployer service on the singleton node.
| |
| -->
| <mbean code="org.jboss.ha.singleton.HASingletonController"
| name="jboss.ha:service=HASingletonDeployer">
| <!-- We now inject the partition into the HAJNDI service instead
| of requiring that the partition name be passed -->
| <depends optional-attribute-name="ClusterPartition"
| proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends>
|
|
In the above files also I changed only name of the 'partition' from 'DefaultPartition' to 'TestPartition'
I did the same changes in 2nd machine also.
Next I started both the machines (one after another, may be 30 secs gap)
with the below command.
|
| run.bat -g ,partition name -u <multicast address> -b <this machine IPaddress> -c all
|
| run.bat -g TestPartition -u 228.1.2.3 -b 166.35.136.77 -c all
|
Same I did for 2nd machine also, Of course IP address of that machine.
mcast-address and partition names both are same for both machines.
But both are not recognizing each other.
I also re-started the machines with different start up commands but in vain.
these are the start up commands
|
| run.bat -g TestPartition -u 228.1.2.3 -b CUSTXIRVMRWW5GG -c all
|
|
| run.bat -b 166.35.136.77 -c all --partition=TestPartition -u 228.1.2.3
|
|
Can any body suggest me , what I need to do more. Or please suggest me am I doing any mistake any where.
Thanks!
Viswanadh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113867#4113867
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113867
18 years, 4 months
[J2EE Design Patterns] - Re: Spawning threads in server process
by jimbrady
I have a similar request, and this thread seems to have died. I have started threads from a servlet and it works well (using a global maps and the rule one per user, one per task). My problem is how to manage the security aspect, and Scotts answer really answer that (nice to see there is a pool of threads - but how do you use it)? I have noticed that if the request is terminated the thread keeps running but the security environment has vanished. Ideally, I would like to spawn a servlet as a new independent background request within the same session. Is there a way to do this. Essentially TOMCAT is setting up the environment when a thread is started (Thread pool?) and this environment will change when TOMCAT moves on to something else. If I am just using unsecured reads I don't have a problem, but I am not keen of having database updates labelled "nobody".
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113864#4113864
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113864
18 years, 4 months
[Tomcat, HTTPD, Servlets & JSP] - Re: Unwaring web app - leaves some files in the war
by PeterJ
Regarding the contents of the war archive (whther file or directory), here is where my confusion comes in. This is your illustration:
deploy
| +myapp.war
| +conf
| +config.properties
| +WEB-INF
This tells me that there are two entities in the deploy directory: myapp.war and WEB-INF. Then in myapp.war there is a directory named conf. In other words, the WEB-INF directory is not located in the war archive but is outside of it. I am sure that is not what you meant, but whereas in this case I can assume you really meant that WEB-INF is within myapp.war (at least I hope you meant that), in other cases I have to take your word for the layout, and in many cases the layout has me confused because it cannot be correct.
Put it another way. Here are the contents of the war I am using to duplicate this problem, as produced by the jar utility:
$ jar -tf webapp.war
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/peter/
index.jsp
WEB-INF/classes/config.properties
WEB-INF/classes/peter/TheServlet.class
WEB-INF/web.xml
I would illustrate this as follows:
webapp.war
| + index.jsp
| + WEB-INF
| + classes
| + config.properties
| + peter
| + TheServlet.class
or alternatively as:
Contents of myapp.war: index.jsp
| WEB-INF/classes/config.properties
| WEB-INF/classes/peter/TheServlet.class
The code that you posted, can I assume that the code is located within the class ProjectRootClass, and that the class is not a servlet? Also, this code does not access the properties file. How is the properties file accessed?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113863#4113863
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113863
18 years, 4 months
[JBoss Seam] - Re: What is the timeline for 2.0.1?
by pete.muir@jboss.org
"cpopetz" wrote : Thanks for the information on the timeline. I'm running with the latest nightly snapshot, which allows me to continue load testing, though I'm reluctant to deploy to production with it.
We are also waiting on the release of JBoss AS 5.0.0.BETA3 before releasing the next GA of Seam. I hope we can do a release early in the new year. In the meantime, I think CVS is pretty stable atm with no big changes planned before the next release.
anonymous wrote : With regard to the mailing list, I'm not so much looking for development discussions. What I'm interested in is an announcements list for critical issues (security, crashing bugs, bugs that effect the entire framework, etc.) I think that discovering that seam isn't thread safe is a pretty big deal, and the only way I found out was by stumbling upon the JIRA issue for the above-mentioned bug. If I had already deployed seam to production, I'd need to know that bug exists as soon as possible, so that I could roll back. I can filter through seam-issues, but I might miss it, or not recognize the ramifications of a bug as well as someone versed in the code.
|
| If I buy Jboss support, does something like that exist? If the above-mentioned bug had been found in a released (not GA) version of seam, would someone at jboss have made a more concerted effort to get the word out, e.g. a sticky forum post?
There is no such facility for the community, I will check whether there is for customers.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113862#4113862
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113862
18 years, 4 months
[Beginners Corner] - Re: Call an ejb from Servlet in different application
by bpet36
Anyone out there, Hello.
Anyway, here is my latest progress, I have added the lookup code and the exception that I am now getting. The exception is encountered at
obj = ctx.lookup("ejb/UserAdmin/UserBean);
Is this a classloading issue?
Thanks in advance, hopefully someone has a clue as to what this problem is.
Bob
Lookup code
InitialContext ctx = new InitialContext();
Object obj = null;
try {
obj = ctx.lookup("ejb/UserAdmin/UserBean);
} catch (Exception e) {
logger.log(Level.ERROR, e.getMessage(), e);
} }
UserBeanHome home = (UserBeanHome)obj;
UserBean remote = (UserBean) home.create();
Exception
java.lang.ClassCastException: org.jboss.util.id.GUID cannot be cast to org.jboss
.util.id.GUID
at org.jboss.invocation.InvokerInterceptor.readExternal(InvokerInterceptor.java:358)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
at org.jboss.proxy.ejb.RetryInterceptor.readExternal(RetryInterceptor.java:291)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:156)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113860#4113860
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113860
18 years, 4 months