[JBoss Seam] - JPDL in Seam 2.0
by hamtho2
Hi,
I´m just migrating my application from Seam 1.2.2 to 2.0.0 together with Trinidad 1.2.2 and wondering if anything might have changed using JPDL between these versions. When trying to use the jpdl in Seam 2.0 I get the following Exception after clicking the link. Any ideas what might have changed or might be the cause?
| javax.el.ELException: javax.ejb.EJBTransactionRolledbackException
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:332)
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
| at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
| at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
| at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
| at org.jboss.seam.navigation.Pages.callAction(Pages.java:636)
| at org.jboss.seam.navigation.Pages.preRender(Pages.java:289)
| at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:544)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:455)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
| at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
| at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
| at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:150)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: javax.ejb.EJBTransactionRolledbackException
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
| at $Proxy245.startRegisterUser(Unknown Source)
| 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:597)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
| at org.javassist.tmp.java.lang.Object_$$_javassist_1.startRegisterUser(Object_$$_javassist_1.java)
| 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:597)
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
| ... 56 more
| Caused by: java.lang.NullPointerException
| at org.jboss.seam.core.ConversationInterceptor.beginNavigation(ConversationInterceptor.java:243)
| at org.jboss.seam.core.ConversationInterceptor.beginConversation(ConversationInterceptor.java:230)
| at org.jboss.seam.core.ConversationInterceptor.beginConversationIfNecessary(ConversationInterceptor.java:166)
| at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:57)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
| 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:597)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| ... 90 more
|
I´ve kept all jpdl-definition untouched in components.xml like this
| <core:jbpm>
| <core:pageflow-definitions>
| <value>registerUser.jpdl.xml</value>
| <value>createItem.jpdl.xml</value>
| </core:pageflow-definitions>
| </core:jbpm>
|
jpdl-xmls are included at root level in the ear, as it was with 1.2.2.
Invokation of pageflow is done through anontation
@Begin(pageflow="registerUser", join=true)
| public String startRegisterUser() {
| .....
| }
|
As I already said - this worked all perfectly with 1.2.2 - so the basics should be correct, but are there any changes in 2.0.0?
Any input would be highly appriciated.
Thanks a lot
Thomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098565#4098565
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098565
18Â years, 6Â months
[JBoss Seam] - Re: @in(create=true) not working !
by mickknutson
Sorry, but I am a bit confused as to the @Name, and variable name solutions proposed.
I have a UserServiceAction (SFSB), and a User (EB).
Here is my UserServiceACtionL
| package com.baselogic.yoursos.user;
|
| import org.hibernate.validator.InvalidStateException;
| import org.hibernate.validator.InvalidValue;
|
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.bpm.Actor;
| import org.jboss.seam.contexts.Context;
| import org.jboss.seam.faces.FacesMessages;
| import org.jboss.seam.security.Identity;
|
| import javax.annotation.Resource;
|
| import javax.ejb.Remove;
| import javax.ejb.SessionContext;
| import javax.ejb.Stateful;
|
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
|
| /**
| * User Service Bean.
| */
| @Stateful
| @Name("userService")
| public class UserServiceAction implements UserService {
|
| /** variable. */
| @PersistenceContext EntityManager em;
|
| /** variable. */
| @Resource SessionContext ctx;
|
| /** variable. */
| @In Context sessionContext;
|
| /** variable. */
| @In(create=true)
| @Out
| User user;
|
| /** variable. */
| @In FacesMessages facesMessages;
|
| /** variable. */
| @In Identity identity;
|
| /** variable. */
| String password = null;
|
| /**
| * todo DOCUMENT ME!
| *
| * @param password todo DOCUMENT ME!
| */
| public void setPasswordVerify(String password) {
| this.password = password;
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| public String getPasswordVerify() {
| return password;
| }
|
|
| /**
| * todo DOCUMENT ME!
| */
| @Begin(
| nested = true,
| pageflow = "registration"
| )
| public void startRegistration() {
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| public boolean isValidNamePassword() {
| boolean ok = true;
|
| if (!isUniqueName()) {
| facesMessages.add("userName", "This name is already in use");
| ok = false;
| }
|
| if (!isPasswordsMatch()) {
| facesMessages.add("passwordVerify", "Must match password field");
| ok = false;
| }
|
| return ok;
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| @SuppressWarnings("unchecked")
| private boolean isUniqueName() {
| String name = user.getUsername();
|
| /*if (name == null) return true;
|
| List<User> results = em.createQuery("select u from User u where u.userName = :name")
| .setParameter("name", name)
| .getResultList();
|
| return results.size() == 0;*/
| return true;
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| private boolean isPasswordsMatch() {
| String customerpass = user.getPassword();
|
| return (password != null) && (customerpass != null)
| && (customerpass.equals(password));
| }
|
| /**
| * todo DOCUMENT ME!
| *
| * @return todo DOCUMENT ME!
| */
| public String saveUser() {
|
| if (!isValidNamePassword()) {
| /////facesMessages.add("User name #{customer.userName} is not unique");
|
| return null;
| }
|
| try {
| em.persist(user);
| sessionContext.set("currentUser", user);
| Actor.instance().setId(user.getUsername());
|
| identity.setUsername(user.getUsername());
| identity.setPassword(user.getPassword());
| identity.login();
|
| facesMessages.addFromResourceBundle("createCustomerSuccess");
|
| return "success";
| } catch (InvalidStateException e) {
| InvalidValue[] vals = e.getInvalidValues();
|
| for (InvalidValue val : vals) {
| facesMessages.add(val);
| }
|
| return null;
| } catch (RuntimeException e) {
| ctx.setRollbackOnly();
|
| facesMessages.addFromResourceBundle("createCustomerError");
|
| return null;
| }
| }
|
| /*public Map<String, Integer> getCreditCardTypes() {
| Map<String, Integer> map = new TreeMap<String, Integer>();
| for (int i = 1; i <= 5; i++) {
| map.put(Customer.cctypes[i - 1], i);
| }
| return map;
| }*/
|
| /**
| * todo DOCUMENT ME!
| */
| @Remove public void destroy() {
| }
|
| } // The End...
|
Here is my User:
| package com.baselogic.yoursos.user;
|
| import com.baselogic.yoursos.BaseEntity;
| import com.baselogic.yoursos.Contact;
|
| import org.hibernate.validator.Length;
| import org.hibernate.validator.NotNull;
|
| import java.io.Serializable;
|
| import java.util.ArrayList;
| import java.util.List;
|
| import javax.persistence.*;
|
|
| /**
| * Main User.
| */
| @Entity
| @Table(name = "USERS")
| public class User extends BaseEntity implements Serializable {
|
| ...//more details omitted for clarity //
|
My error seems to be from the User object in my UserServiceAction and is identical to this.
How do I fix this? Make my User Object name be "User userService" to match @Name("userService") ???
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098564#4098564
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098564
18Â years, 6Â months