[JBoss Seam] - row input field "not posted"? when submitted from within a m
by koenhandekyn
in the first code snippet below the input variable (marked in bold) is not assigned or posted when comming from within a (rich:)modelPanel. [ snippet 1 ]
when posted directly from within the column the input variable is assigned well. [ snippet 2 ]
thanx for helping me understand.
snippet 1 : [ doesn't work ]
<rich:column>
<rich:modalPanel id="modelPanel" minHeight="200"
minWidth="450" height="200" width="500"
zindex="2000">
<f:facet name="header">
<h:outputText value="Approve Invoice"/>
</f:facet>
<f:facet name="controls">
<h:graphicImage
value="/images/modal/close.png"
style="cursor:pointer"
onclick="Richfaces.hideModalPanel('mp')"/>
</f:facet>
<h:inputText
value="#{task.variables['invoice'].approvedBy}"
style="width: 100px">
</h:inputText>
<s:button action="#{invoiceApproval.approve}"
taskInstance="#{task}" value="Approve"/>
</rich:modalPanel> <a
href="javascript:Richfaces.showModalPanel('modelPanel',{width:450, top:200})">
approve
</rich:column>
snippet 2 : [ works well ]
<rich:column>
<h:inputText
value="#{task.variables['invoice'].approvedBy}"
style="width: 100px">
</h:inputText>
<s:button action="#{invoiceApproval.approve}"
taskInstance="#{task}" value="Approve"/>
</rich:column>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051898#4051898
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051898
18Â years, 10Â months
[JBoss Seam] - Problem with @Transactional
by gustajz
Friends
I have the following situation.
I have an interface that implements a simple CRUD with the methods annotated with @Transactional(REQUIRED).
The class that implements this interface uses a session of the Hibernate with corresponding DAO interface. Until now, no mystery.
The problem occurs when I use the instance in backing bean. The transaction does not finish after method execution,
and I can't capture exceptions generated by the DataBase.
What kind of configuration do I need to do for application finish the transaction correctly, after method execution?
Thank's.
Below examples of the codes
GenericDAO
| public interface GenericDAO<T, PK extends Serializable> {
| @Transactional(TransactionPropagationType.MANDATORY)
| public T save(T o) throws Exception;
|
| @Transactional(TransactionPropagationType.MANDATORY)
| public void delete(T o) throws Exception;
| }
|
GenericDAOImpl
| public class GenericDAOImpl<T, PK extends Serializable> implements GenericDAO<T, PK> {
| public T save(T o) throws Exception {
| return o;
| }
|
| public void delete(T o) throws Exception {
| session.delete(o);
| }
| }
|
BusinessManager
| public interface BusinessManager<T, PK extends Serializable> {
| @Transactional(value = TransactionPropagationType.REQUIRED)
| public void save(T object) throws BusinessException;
|
| @Transactional(value = TransactionPropagationType.REQUIRED)
| public void remove(PK id) throws BusinessException;
| }
|
BusinessManagerImpl
| public class BusinessManagerImpl<T, PK extends Serializable> implements BusinessManager<T, PK> {
| public void save(T object) throws BusinessException {
| try {
| genericDAO.saveOrUpdate(object);
| } catch (Exception dae) {
| throw new BusinessException(dae);
| }
| }
|
| public void remove(PK id) throws BusinessException {
| try {
| genericDAO.remove(id);
| } catch (Exception dae) {
| throw new BusinessException(dae);
| }
| }
| }
|
spring-beans-dao.xml
| <bean id="projetoDAO" class="br.com.develop.fw.persistence.GenericDAOImpl">
| <property name="clazz" value="br.com.develop.ponto.model.Projeto" />
| <seam:component/>
| </bean>
|
spring-beans-business.xml
| <bean id="projetoManager" class="br.com.develop.fw.business.BusinessManagerImpl" scope="singleton">
| <property name="genericDAO" ref="projetoDAO"/>
| <seam:component/>
| </bean>
|
ProjetoAction (Backing Bean)
| @Name("projetoAction")
| @Scope(ScopeType.CONVERSATION)
| public class ProjetoAction extends AbstractBackingBean<Projeto> implements Serializable {
| @In("projetoManager")
| private BusinessManager<Projeto, Serializable> projetoManager;
|
| @Restrict
| public void delete() {
| try {
| log.debug("will be delete...");
| projetoManager.remove(selected.getId());
| log.debug("deleted??");
| FacesMessages.instance().add("{0} has been removed.", new Object[] { selected.getNome() });
| } catch (Throwable e) {
| addMessage("Faild to remove");
| }
| }
|
Exception
| 2007-06-06 17:03:43,312 DEBUG [br.com.develop.ponto.action.ProjetoAction:79:<delete>] - [admin] will be delete...
| 2007-06-06 17:03:43,312 DEBUG [br.com.develop.ponto.action.ProjetoAction:81:<delete>] - [admin] deleted??
| 2007-06-06 17:03:44,921 DEBUG [org.hibernate.SQL:401:<log>] - [admin] delete from PROJETOS where ID=?
| Hibernate: delete from PROJETOS where ID=?
| 2007-06-06 17:03:44,984 WARN [org.hibernate.util.JDBCExceptionReporter:77:<logExceptions>] - SQL Error: 0, SQLState: 23503
| 2007-06-06 17:03:44,984 ERROR [org.hibernate.util.JDBCExceptionReporter:78:<logExceptions>] - [admin] ERROR: update or delete on table "projetos" violates foreign key constraint "fk_projeto" on table "importacao_funcionario"
| Detalhe: Key (id)=(1) is still referenced from table "importacao_funcionario".
| 2007-06-06 17:03:45,000 ERROR [org.hibernate.event.def.AbstractFlushingEventListener:301:<performExecutions>] - [admin] Could not synchronize database state with session
| org.hibernate.exception.ConstraintViolationException: could not delete: [br.com.develop.ponto.model.Projeto#1]
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2541)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051896#4051896
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051896
18Â years, 10Â months
[JBoss Seam] - Conversation id is already in use?
by Delphi's Ghost
Hey all,
I keep getting this error message at various times as I navigate through my test bookstore app. Usually it appears when I change conversations on the switcher, but also during pageflow navigation. I'm using seam 1.2.1GA on JBoss 4.05
In pages.xml I define :
| <conversation name="bookConv" parameter-name="bookId"
| parameter-value="#{book.id}" />
|
|
| <page view-id="/bookEdit.xhtml" conversation="bookConv">
| <begin-conversation join="true" flush-mode="manual" pageflow="bookEditFlow"/>
| <description>Book Edit #{book.title}</description>
| </page>
|
|
This is the only conversation config (I am not using @Begin methods).
My understanding was this this is the (new?) correct way to define business conversation Ids and parameter names, with the idea being that if you tried to edit the same book twice, the conversation param name and value would match an existing conversation and pick that up instead? So rather than start editing the book from scratch, it would just pick up on the existing conversation (which BTW is awesome).
I don't know whether the problem is that I use bookId as a request parameter when initially editing the book. I pass bookId manually based on whichever book you want to edit. My book instance is obtained from a @factory based on the value in the bookId @RequestParameter. I don't know whether this is right or wrong, but I wanted to try RESTful urls. In essence, this works in that it gets the book from the bookId, and outjects it.
My links to edit the book (from the book search page) look like :
| <s:link view="/bookEdit.xhtml" value="#{vbook.title}" propagation="nested">
| <f:param name="bookId" value="#{vbook.id}" />
| </s:link>
|
I use a nested propagation on the link because I want the editing to take place in a nested conversation from the book search page.
The other part of the puzzle is from my top menu (I use the one from the default seam app) I have my home link as :
| <s:link view="/home.xhtml" value="Home" propagation="none"/>
|
The error seems to happen most when I go back home using this link and then try and switch to another conversation, but not always.
When I get the problem as part of a pageflow, I get it when I am returning to the bookEdit.xhtml view after selecting an author.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051895#4051895
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051895
18Â years, 10Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Unable to locate appropriate constructor
by jridgway
I am getting an "Unable to locate appropriate constructor" during the parsing of a named query. I am confused on why this is happening since this has worked for months until just a few days ago.
Here is part of my query:
SELECT new lema.entity.SimpleAggregateTotal (ps.recruiterId as recId ,count(*) as total)
FROM lema.entity.PersonSummary ps, lema.entity.AccInfo ai
The SimpleAggregateTotal constructors are setup with the following signatures:
SimpleAggregateTotal(String code, Long total)
SimpleAggregateTotal(Long id, Long total)
We use this class to total up various counts with the keys being either a Long or a String value.
Turning on debug level logging, I can see where the error is occuring during the parsing, but I can't seem to get a grasp on the root problem.
Does anyone know how can I tell what the constructor signature should be?
Thanks,
Jamie
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051893#4051893
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051893
18Â years, 10Â months
[Installation, Configuration & Deployment] - Re: mod_jk intermittently loosing connection to jboss 4.2
by modoc
More information:
This appears to be related to open connections.
mod_jk was holding connections open to the JBoss web server on 8009, and the number of ESTABLISHED connections kept growing until tomcat started rejecting new connections. Some of the connections would get reused, but not that many.
I set the connection_pool_timeout in the mod_jk config to 10 seconds. This keeps the number of established connections down around 50-60. However, the connections that have timed out of the pool, appear to persist forever.
The connection from the mod_jk TO JBossWeb sticks in FIN_WAIT1 or FIN_WAIT2:
10.10.77.194:57587 10.10.77.194:8009 FIN_WAIT1
The connection view from JBossWeb gets stuck in CLOSE_WAIT:
10.10.77.194:8009 10.10.77.194:57587 CLOSE_WAIT
Once the number of connections hits 1024 (or thereabouts) everything falls apart, of course, and I have to kill -9 jboss and start it up again.
This never happened with JBoss 4.0.5. Apache and mod_jk haven't changed at all, so this has to be a change between Tomcat 5.5 or JBossWeb. I can't be the only person to run into this.....
Ideas?
Devon
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051892#4051892
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051892
18Â years, 10Â months