[JBoss Seam] - Re: Bind Map to h:inputText value
by umk
"matt.drees" wrote : Are you using a s:validate or s:validateAll on that h:inputText? If so, I'm fairly certain you can't do that.
Nope. Not using either. I've posted the complete page code below. Any other ideas? Thanks.
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| template="layout/template.xhtml">
|
| <ui:define name="body">
|
| <h:messages globalOnly="true" styleClass="message" />
|
| <h:form id="dataEntryForm">
|
| <rich:panel>
| <f:facet name="header">dataEntry</f:facet>
| <p>Welcome #{appUser.username}</p>
|
| <s:decorate id="valueDecoration1" template="layout/edit.xhtml">
| <ui:define name="label">Map Binding</ui:define>
| <h:inputText id="asdf" required="true"
| value="#{biomarkers['waist']}" />
| </s:decorate>
|
| <s:decorate id="eventdateDecoration" template="layout/edit.xhtml">
| <ui:define name="label">eventdate</ui:define>
| <h:inputText id="eventdate" maxlength="10" size="10"
| required="true" value="#{record.eventdate}">
| <s:convertDateTime type="date" dateStyle="short"
| pattern="MM/dd/yyyy" />
| <a:support event="onblur" reRender="eventdateDecoration" />
| </h:inputText>
| <s:selectDate for="eventdate">
| <h:graphicImage url="img/dtpick.gif" style="margin-left:5px" />
| </s:selectDate>
| </s:decorate>
|
| <div style="clear:both" />
|
| <h:dataTable value="#{recordDatas}" var="recordData">
| <h:column>
| <f:facet name="header">Name</f:facet>
| <h:selectOneMenu value="#{recordData.value}">
| <f:selectItem itemLabel="-" itemValue="" />
| <f:selectItem itemLabel="Yes" itemValue="1" />
| <f:selectItem itemLabel="No" itemValue="0" />
| </h:selectOneMenu>
| </h:column>
| </h:dataTable>
|
| </rich:panel>
|
| <div class="actionButtons"><h:commandButton id="dataEntry"
| value="dataEntry" action="#{enroll.thankYou}" /></div>
|
| </h:form>
|
| </ui:define>
|
| </ui:composition>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048921#4048921
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048921
18 years, 11 months
[JBossCache] - Recommended way of locking to avoid many threads filling cac
by mkotsbak
I have this case as this pseudocode shows:
getObject()
{
1: if ( jbc.get( "someobj" ) == null || cache error ) {
2: obj = getSomeObjFromDB();
3: jbc.put("someojb).
}
4: return obj;
}
and typically have many threads accessing that method from JBoss at the same time. The problem is that line 2 can be time consuming and thus both:
- causing write locks in JBC for all but the first thread that got the write lock at line 3. This is probably similar to the Hibernate case and thus can probably avoided using the new "putFromExternalRead()" method?
- cause n number of threads simultaniously trying to get the same value from database (line 2) that both slows down the first one that has the write lock and all other.
What I want to solve those problems are some kind of lock that ensures that only the first thread that finds the cache miss fetches the object from the database and the others wait for that first thread to finish its fetching and then getting the value from JBC.
Since this is running inside JBoss I'm not sure what locking is safe to use. In a standalone program I would think of using a mutex or synchcronized keyword, but is this safe in this case?
I also think about a little hacky solution to use an extra node in JBC that you write to before fetching stuff from DB and the other threads lock on trying to write to and after the lock is freed check again if the content is still missing and if so (it in fact was the first thread) go fetch it from DB.
Maybe the API of JBC should be added with some support for this to do in it a clean way.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048916#4048916
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048916
18 years, 11 months
[Messaging, JMS & JBossMQ] - javax.ejb.EJBException: Could not instantiate bean
by bbeloff
Hi
I'm attempting to use my first MDB. My code and deployment descriptors are based on examples 6.6 to 6.9 in The JBoss 4 Application Server Guide. I'm running jboss 4.0.2 / MySQL.
The problem: my sender sends the message okay (confirmed by querying MySQL) but the message driven bean causes:
| 15:19:40,563 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message), causedBy:
| javax.ejb.EJBException: Could not instantiate bean
| at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:180)
| at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:67)
| at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
| at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
| at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
| at org.jboss.ejb.Container.invoke(Container.java:873)
| at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1090)
| at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
| at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
| at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:904)
| at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:160)
| at org.jboss.mq.SpySession.run(SpySession.java:333)
| at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
| at java.lang.Thread.run(Thread.java:613)
| 15:19:40,572 ERROR [JMSContainerInvoker] Exception in JMSCI message listener
| javax.ejb.TransactionRolledbackLocalException: Could not instantiate bean; CausedByException is:
| Could not instantiate bean
| ...
|
The jboss.xml entry (generated by XDoclet) looks like:
| <message-driven>
| <ejb-name>DispatchAgent</ejb-name>
| <destination-jndi-name>queue/B</destination-jndi-name>
| <resource-ref>
| <res-ref-name>jms/QCF</res-ref-name>
| <jndi-name>ConnectionFactory</jndi-name>
| </resource-ref>
| </message-driven>
|
The ejb-jar.xml entry looks like:
| <message-driven >
| <description><![CDATA[Product Dispatcher]]></description>
| <ejb-name>DispatchAgent</ejb-name>
| <ejb-class>biz.classcalendar.core.agent.dispatch.DispatchAgent</ejb-class>
| <transaction-type>Container</transaction-type>
| <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
| <message-driven-destination>
| <destination-type>javax.jms.Queue</destination-type>
| </message-driven-destination>
| <resource-ref >
| <res-ref-name>jms/QCF</res-ref-name>
| <res-type>javax.jms.QueueConnectionFactory</res-type>
| <res-auth>Container</res-auth>
| </resource-ref>
| </message-driven>
|
I'm stuck, because the log contains no debugging information that's useful to me, given my (lack of) knowledge of the jboss code.
Is this a authentication issue?
Please help!
Bruno.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048914#4048914
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048914
18 years, 11 months