[JBoss Seam] - Re: Problems using ajax validation in seam-gen
by knaas
I'm a bit late to this party, but we have been experiencing this for months. We originally tried the same technique Pete suggested using - a4j eventqueues with requestDelays - but it didn't go far enough.
What we wanted was if a user was typing or clicking, to send one request to the queue requestDelay milliseconds after the final generated event on that queue. This would allow a user to click a button repeatedly, but only the very last button click would be processed. Or if a user went trigger happy on the keyboard in an input field with a keypress event, it would only react on the last keypress event. Or we could send an input field onchange and a button click through the queue to send only the last event. There is a chance for lost javascript events, but since 99.9% of our pages simply submit the form and kick off an action, ignoring the original events didn't really hurt anything.
In order to do this we implemented a special JavaScript event queue widget that enforced this behavior. It worked pretty well. However, we still get the "Conversation ended, timed out or was processing another request" message so often that our users consistently bring it up as a problem. We would still love to see JBSEAM-1832 implemented since it helps to address the double click problem as well as the ""The conversation ended, timed out or was processing another request" problem.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081464#4081464
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081464
18 years, 7 months
[JBoss Seam] - Re: renew the @Factory
by srpantano
ok, here go!
in my add.xhtml page I put:
| #{messages['Name']}:
| <h:inputText id="name" size="30" value="#{license.name}">
| <s:validate />
| <a4j:support event="onblur" reRender="outMessageLicensee" />
| </h:inputText>
|
| <s:link action="#{licenseHome.persistAndContinue}">
| <h:outputText value="#{messages['Tosavecont']}"/>
| </s:link>
|
the add.page.xml:
| <page no-conversation-view-id="list.xhtml">
|
| <begin-conversation join="true"/>
|
| <navigation from-action="#{licenseHome.persistAndContinue}">
| <end-conversation/>
| <redirect view-id="add.xhtml"/>
| </navigation>
|
| </page>
|
and the class:
| @Name(value = "licenseHome")
| public class LicenseHome extends EntityHome<License> {
|
| @Override
| protected License createInstance() {
| license = new License();
| return license;
| }
|
| @Override
| @Factory(value = "license")
| public License work() {
| return getInstance();
| }
|
| public String persistAndContinue() {
| super.persist();
| Contexts.getSessionContext().remove("license") ;
| setInstance(new License());
|
| return "";
| }
|
| public void setLicenseId(Long id) {
| setId(id);
| }
|
| public Long getLicenseId() {
| return (Long) getId();
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081456#4081456
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081456
18 years, 7 months
[EJB 3.0] - Re: Why is my jdbc/database not in the local ENC?
by waynebaylor
Use the ejb-jar.xml to specify what is in your ENC and jboss.xml to map it to the JNDI name.
For example, to have access to the default datasource, java:/DefaultDS, you would use the following:
| <ejb-jar ...>
| <enterprise-beans>
| <session>
| <ejb-name>MySessionBean</ejb-name>
| <local>my.local.MySessionLocal</local>
| <ejb-class>my.bean.MySessionBean</ejb-class>
|
| <resource-ref>
| <res-ref-name>jdbc/MyDataSource</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| </resource-ref>
| </session>
| </enterprise-beans>
| </ejb-jar>
|
and
| <jboss ...>
| <enterprise-beans>
| <session>
| <ejb-name>MySessionBean</ejb-name>
| <resource-ref>
| <res-ref-name>jdbc/MyDataSource</res-ref-name>
| <resource-name>DefaultDS</resource-name>
| </resource-ref>
| </session>
| </enterprise-beans>
| </jboss>
|
and perform the lookup within MySessionBean as:
DataSource ds = (DataSource)new InitialContext().lookup("java:comp/env/jdbc/MyDataSource");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081454#4081454
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081454
18 years, 7 months
[JBoss Seam] - does seam ignore generics in lists?
by binabik
hi all,
following _very_ strange behaviour:
in a SFSB i have 3 lists defined as follows:
| [...]
| @Out (required=false)
| private List<TimetableItem> bscLectures;
| @Out (required=false)
| private List<TimetableItem> bscPracticals;
| private List<TimetableItem> selectedBscLectures;
| [...]
|
in a .xhtml file:
| <h:selectManyCheckbox id="lectureBscList"
| value="#{timetable.selectedBscLectures}" layout="pageDirection">
| <s:selectItems value="#{timetable.bscLectures}" var="lecture"
| label="#{lecture.title} (#{lecture.type}): #{lecture.times}" />
| </h:selectManyCheckbox>
| [...]
| <h:dataTable id="bscPracticalList" var="bscPr"
| value="#{timetable.bscPracticals}"
| rendered="#{not empty timetable.bscPracticals}">
| <h:column>
| #{bscPr.title}
| </h:column>
| <h:column>
| <h:selectOneMenu value="#{bscPr.selected}">
| <s:selectItems value="#{bscPr.times}" var="n"
| label="#{n.toShortString()}"
| noSelectionLabel="Please select..."/>
| </h:selectOneMenu>
| </h:column>
| </h:dataTable>
|
TimetableItem is not an Entity Bean, it's a helper class i've mashed together, with the following fields:
| private String title;
| private String type;
| private List<TimetableItemTime> times;
| private Object selected; // this should be a TimetableItem as well
|
i realised that i've got some problems somewhere when i tried the following:
| for (TimetableItem t : this.selectedBscLectures)
| System.out.println(t.toString())); // changed for ease of reading
|
and it was giving me ClassCastExceptions. The SelectOneMenu's were doing the same thing on TimetableItem.selected, which is why i changed that to an Object. After investigating further, i found out that my List selectedBscLectures is actually populated with Strings.
2 questions:
1.) why strings?
2.) why isn't the JVM screaming loudly about violations of the Generics?
[i may have an answer for 2.):]
constructs like this aren't caught by the java compiler, but do cause ClassCastExceptions at runtime.
| import java.util.*;
|
| public class Test {
| public static void main(String args[]) {
| ArrayList<Integer> integerList = new ArrayList<Integer>();
| integerList.add(1);
| Object o = new String("Simon!");
| integerList.add((Integer)o);
| }
| }
|
now the interesting question is, where are the ClassCastExceptions which should be happening going? they're not in my server log...
[possible answer to 1.): i'm assuming because my beans aren't @Entity's, they have no @Id, which means that the JVM is using the toString() to identify them (the value of checkbox is a string representation of the object), and passing this into the Lists. but how do i avoid this?]
regards,
sb
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081451#4081451
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081451
18 years, 7 months
[JBoss Messaging] - org.jboss.jms.util.MessagingNetworkFailureException: Failed
by gsoing
Hello !
I have a client on JBoss 4.0.1sp1 App Server with JBoss Messaging 1.2. I have a server on JBoss 4.2.1GA App Server with JBoss Messaging 1.2. My client sends messages to a clustered queue on the server. I can get the remote ConnectionFactory but when I call the method createQueueConnection on my QueueConnectionFactory, I have the following error :
| org.jboss.jms.util.MessagingNetworkFailureException: Failed to connect client
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:288)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$getClientAOPStack$aop(ClientConnectionFactoryDelegate.java:222)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPStack(ClientConnectionFactoryDelegate.java)
| at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientClusteredConnectionFactoryDelegate$getClientAOPStack$aop(ClientClusteredConnectionFactoryDelegate.java:98)
| at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.getClientAOPStack(ClientClusteredConnectionFactoryDelegate.java)
| at org.jboss.jms.client.ClientAOPStackLoader.load(ClientAOPStackLoader.java:67)
| at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:199)
| at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:102)
| at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:96)
| at com.capgemini.sdp.cae.utils.TestReportingQueue.doGet(Unknown Source)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| at com.capgemini.sdp.cae.sas.filter.SASFilter.doFilter(Unknown Source)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| at com.vodafone.sdp.global.logging.logtrace.LogTraceFilter.doFilter(Unknown Source)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| at com.capgemini.sdp.cae.reporting.filter.ReportingFilter.doFilter(Unknown Source)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| at com.vodafone.sdp.global.logging.logtrace.LogTraceFilter.doFilter(Unknown Source)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
| at org.apache.catalina.valves.ExtendedAccessLogValve.invoke(ExtendedAccessLogValve.java:535)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
| at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:534)
| Caused by: java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:324)
| at org.jboss.remoting.InvokerRegistry.loadClientInvoker(InvokerRegistry.java:419)
| at org.jboss.remoting.InvokerRegistry.createClientInvoker(InvokerRegistry.java:320)
| at org.jboss.remoting.Client.connect(Client.java:438)
| at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:284)
| ... 59 more
| Caused by: java.lang.NoSuchMethodError: org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(Ljava/lang/Object;Ljava/util/Properties;Z)V
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.setup(MicroSocketClientInvoker.java:360)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.<init>(MicroSocketClientInvoker.java:234)
| at org.jboss.remoting.transport.socket.SocketClientInvoker.<init>(SocketClientInvoker.java:72)
| at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.<init>(BisocketClientInvoker.java:133)
| at org.jboss.remoting.transport.bisocket.TransportClientFactory.createClientInvoker(TransportClientFactory.java:44)
| ... 67 more
|
Thanks !
Delphine
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081444#4081444
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081444
18 years, 7 months