[JBoss Seam] - SelectOneMenu not Updated
by nemya
Hi,
I'm using Jboss Seam 2.0.0.CR1 + JBoss AS 4.2.1.GA
I have a
<h:form>
| <h:selectOneMenu id="id1" value="#{MyBean.selectedItem}">
| <s:selectItems value="#{MyBean.availableItems}" var="var" label="#{var.label}" id="id2" />
| <s:convertEntity />
| </h:selectOneMenu>
| <h:commandLink action="#{MyBean.removeSelectedItem}">
| <s:conversationId/>
| </h:commandLink>
| </h:form>
My availableItems is a List
My MyBean.removeSelectedItem() method looks like :
if(this.getSelectedItem() != null){
| this.availableItems.remove(this.getSelectedItem());
| ...
| }
|
When I call this method everything on the page is updated. Only my SelectOneMenu keeps the same(the item is not removed)
The availableItems List's size is also updated.
PS: I have just migrated my project from Seam 1.2.1.GA + JBoss AS 4.0.5.GA and this was working fine.
Thnak you
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091531#4091531
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091531
18Â years, 6Â months
[EJB/JBoss] - Problems using Extended Persistence Context
by daniel.celentano
I'm using EXTENDED Persistence Context with a SFSB, expecting that "the lifecycle of the persistence context is binded to the lifecycle of the Stateful Session Bean" but this dont work.
I'm get org.hibernate.LazyInitializationException in the second lap, this is the same method invocation with different results. May by a Bug?
This is my code:
CLIENT
public class Client
{
public static void main(String[] args) throws Exception
{
InitialContext ctx = new InitialContext();
IProceso proceso = (IProceso) ctx.lookup("cine/ProcesoBean/remote");
List peliculas = null;
// lap 1
proceso.crearDatos();
peliculas = proceso.listarPeliculas();
showPeliculas(peliculas);
proceso.grabar();
System.out.println("Lap 1 OK!");
// lap 2
proceso = (IProceso) ctx.lookup("cine/ProcesoBean/remote");
peliculas = proceso.listarPeliculas();
showPeliculas(peliculas);
proceso.grabar();
System.out.println("Lap 2 OK!");
}
SERVER
@Stateful
public class ProcesoBean implements IProceso{
@PersistenceContext(type=PersistenceContextType.EXTENDED)
private EntityManager em;
public void crearDatos(){
System.out.println("crearDatos");
System.out.println("EM: " + em.hashCode());
// make data insert on DB
....
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List listarPeliculas() {
List pelis = null;
pelis = em.createQuery("from Movie p where p.salaCompleta is false").getResultList();
return pelis;
}
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void salaCompleta(Long idpelicula) {
Movie pelicula = em.find(Movie.class, idpelicula);
pelicula.setSalaCompleta(Boolean.TRUE);
}
@Remove
public void grabar() {
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091530#4091530
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091530
18Â years, 6Â months
[JBossWS] - "
by viniciuscarvalho
Sure :)
Here's the code:
| public SOAPMessage invoke(SOAPMessage message) {
| SOAPMessage returnMessage = null;
| try {
| MessageFactory mf = MessageFactory.newInstance();
| returnMessage = mf.createMessage();
| SOAPFactory f = SOAPFactory.newInstance();
| SOAPElement test = f.createElement("processResponse","ns1", "http://www.acme.com/sys/schemas");
| test.addNamespaceDeclaration("ns2","http://www.acme.com/sys/definitions");
| test.appendChild(createResponseContent());
| SOAPBody body = returnMessage.getSOAPBody();
|
| body.addChildElement(test);
| } catch (SOAPException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| } catch (Exception e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
| return returnMessage;
| }
|
| private Element createResponseContent() throws Exception{
| DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
| dbf.setNamespaceAware(true);
| DocumentBuilder db = dbf.newDocumentBuilder();
| Document doc = db.newDocument();
| Element ret = doc.createElement("return");
| Element id = doc.createElement("id");
| id.appendChild(doc.createTextNode("1"));
| Element message = doc.createElement("message");
| message.appendChild(doc.createTextNode("comando recebido"));
| ret.appendChild(id);
| ret.appendChild(message);
| return ret;
| }
|
What I'd like to return is :
<ns1:processResponse xmlns:ns1="http://www.acme.com/sys/schemas">
</ns1:processResponse>
Here's the stack trace:
| 10:45:12,569 ERROR [STDERR] org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
| 10:45:12,570 ERROR [STDERR] at org.apache.xerces.dom.ElementNSImpl.setName(Unknown Source)
| 10:45:12,570 ERROR [STDERR] at org.apache.xerces.dom.ElementNSImpl.<init>(Unknown Source)
| 10:45:12,570 ERROR [STDERR] at org.apache.xerces.dom.CoreDocumentImpl.createElementNS(Unknown Source)
| 10:45:12,570 ERROR [STDERR] at org.jboss.wsf.common.DOMUtils.createElement(DOMUtils.java:202)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPElementImpl.<init>(SOAPElementImpl.java:84)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPFactoryImpl.createElement(SOAPFactoryImpl.java:95)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPFactoryImpl.createElement(SOAPFactoryImpl.java:122)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPFactoryImpl.createElement(SOAPFactoryImpl.java:101)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ws.core.soap.NodeImpl.convertDOMNode(NodeImpl.java:563)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ws.core.soap.NodeImpl.appendChild(NodeImpl.java:459)
| 10:45:12,571 ERROR [STDERR] at com.acme.sys.services.provider.CommandProcessorMessage.invoke(CommandProcessorMessage.java:38)
| 10:45:12,571 ERROR [STDERR] at com.acme.sys.services.provider.CommandProcessorMessage.invoke(CommandProcessorMessage.java:1)
| 10:45:12,571 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 10:45:12,571 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 10:45:12,571 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 10:45:12,571 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,571 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,571 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 10:45:12,572 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,572 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| 10:45:12,572 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,572 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| 10:45:12,572 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| 10:45:12,572 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,572 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| 10:45:12,572 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,572 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 10:45:12,572 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 10:45:12,572 ERROR [STDERR] at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:103)
| 10:45:12,572 ERROR [STDERR] at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:220)
| 10:45:12,572 ERROR [STDERR] at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
| 10:45:12,572 ERROR [STDERR] at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
| 10:45:12,572 ERROR [STDERR] at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
| 10:45:12,572 ERROR [STDERR] at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
| 10:45:12,572 ERROR [STDERR] at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| 10:45:12,572 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| 10:45:12,572 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| 10:45:12,572 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 10:45:12,572 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 10:45:12,572 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 10:45:12,572 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 10:45:12,573 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| 10:45:12,573 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| 10:45:12,573 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| 10:45:12,573 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 10:45:12,573 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| 10:45:12,573 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 10:45:12,573 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| 10:45:12,573 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| 10:45:12,573 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| 10:45:12,573 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| 10:45:12,574 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| 10:45:12,574 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| 10:45:12,574 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
|
|
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091521#4091521
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091521
18Â years, 6Â months