[jboss-user] [JBoss Seam] - Re: DataModel changes not reflected in view [possible newbie
Yes clicking a letter (A-Z) on the repeat performs the search and then each row of the search results has an edit link which invokes editSite() on a conversation-scoped bean 'siteManager'. @Stateful | @Name("siteManager") | public class WebsiteManagerBean implements WebsiteManager { | | @In(required = false) | @Out(required = false) | private Website website; | | @In | private EntityManager entityManager; | | private boolean editMode; | | private boolean siteFound; | | @RequestParameter | Integer id; | | public WebsiteManagerBean() { | } | | @Begin | public void editSite() { | this.editMode = true; | if (!findSite()) { | facesMessages.addFromResourceBundle("website.not-found"); | log.error("Website not found for id " + id); | } | } | | private boolean findSite() { | if (id == null) { | return false; | } | this.website = entityManager.find(Website.class, id); | siteFound = (null != website) ? true : false; | return siteFound; | } | | | //@RaiseEvent("websiteUpdated") | public void updateSite() { | facesMessages.addFromResourceBundle("website.updated"); | log.info("Updated website details #{website.id}"); | } I'm not doing anything particular to persist the changes, clicking 'save' on the edit page invokes updateSite() and the modifications are flushed to the database. I then click a link to return to the search results. Initially the search results do not contain the modifications as they are held in the session-scoped bean and I'm not yet updating that when updateSite() is invoked (hence the @RaiseEvent being commented out). The thing perplexing me is that when I invoke the original search again it seems to query the database but the changes to the entity do not appear in the search results, even though they are present in the DataModel. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119461#4119461 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119461 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - DataModel changes not reflected in view [possible newbie ign
I'm using a session-scope stateful session bean to hold search results in a DataModel - in a similar manner to the booking example. I first populate the DataModel by performing an entity query, if I then modify and persist one of the entities from the search results, return to the search page and perform the same search again the changes to the entity are not reflected in the view, my dataTable still displays the original values even though logging shows that the DataModel has been correctly updated. @Stateful | @Name("websiteSearch") | @Scope(ScopeType.SESSION) | | @DataModel("websites") | private List websites; | | @RequestParameter | String letter; | | public void findDomainByLetter() { | websites = entityManager.createNamedQuery("Website.findByDomainLetter") | .setParameter("domainName", letter.toLowerCase() + "%") | .setMaxResults(pageSize) | .setFirstResult(page * pageSize) | .getResultList(); | } | | | ÃÂ ÃÂÃÂ | | | | | | | | | | | ..snip | If I then perform a different search and subsequently repeat the original search the changes are then reflected in the view. Could this be some kind of view caching issue or maybe a poor grasp of the jsf lifecycle ..? I'd appreciate some suggestions. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119044#4119044 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119044 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Custom hibernate validator causes InvalidStateException
Newbie question - if class level validators are not supported what would be the recommended way to validate between 2 properties as in the example given? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104639#4104639 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104639 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Seam-managed persistence contexts and Glassfish
Still unable to get SMPCs working with an enterprise app and PostgreSQL, although the jpa example app works fine. Anyone got any ideas why I'm receiving the following ClassCastException? anonymous wrote : Caused by: java.lang.ClassCastException: java.lang.Long | at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:169) anonymous wrote : [#|2007-03-16T14:43:58.503+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=17;_ThreadName=httpWorkerThread-8181-1;CommonLookupBean;|EJB5018: An exception was thrown during an ejb invocation on [CommonLookupBean]|#] | | [#|2007-03-16T14:43:58.504+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=17;_ThreadName=httpWorkerThread-8181-1;| | javax.ejb.EJBException | at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730) | at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630) | at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431) | at com.sun.ejb.containers.StatefulSessionContainer.postInvokeTx(StatefulSessionContainer.java:1292) | at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247) | at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192) | at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:71) | at $Proxy70.loadPersonTitles(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:585) | at org.jboss.seam.util.Reflections.invoke(Reflections.java:20) | at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31) | at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72) | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57) | at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:40) | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69) | at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31) | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69) | at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103) | at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50) | at org.javassist.tmp.java.lang.Object_$$_javassist_0.loadPersonTitles(Object_$$_javassist_0.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:585) | at org.jboss.seam.util.Reflections.invoke(Reflections.java:20) | at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123) | at org.jboss.seam.Component.callComponentMethod(Component.java:1834) | at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1696) | at org.jboss.seam.Component.getInstance(Component.java:1633) | at org.jboss.seam.Component.getInstance(Component.java:1610) | at org.jboss.seam.Component.getInstance(Component.java:1604) | at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49) | at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143) | at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:58) | at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65) | at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192) | at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) | at javax.faces.component.UISelectItems.getValue(UISelectItems.java:132) | at org.jboss.seam.ui.UISelectItems.getValue(UISelectItems.java:188) | at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:308) | at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:506) | at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:482) | at com.sun.faces.
[jboss-user] [Beginners Corner] - Help understanding 'No ClassLoaders found for ...'
I'm trying to load up some configuration data in a web app from an xml file using Commons Digester and I get the following exception. I'm a bit perplexed as the class is present in my war and it works fine under another application server. anonymous wrote : java.lang.ClassNotFoundException: No ClassLoaders found for: com.orpello.security.JsfApplication | at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306) | at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511) | at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405) | at java.lang.ClassLoader.loadClass(ClassLoader.java:251) | at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:204) | at org.apache.commons.digester.Rule.begin(Rule.java:152) | at org.apache.commons.digester.Digester.startElement(Digester.java:1286) | at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) | at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) | at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) | at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) | at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) | at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) | at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) | at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) | at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) | at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) | at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) | at org.apache.commons.digester.Digester.parse(Digester.java:1591) | at com.orpello.security.SecurityConfiguration.parseSecurityXMLFile(SecurityConfiguration.java:70) | at com.orpello.security.SecurityConfiguration.(SecurityConfiguration.java:55) | at com.orpello.view.components.component.FormBasedLoginComponent.encodeEnd(FormBasedLoginComponent.java:48) | at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242) | at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239) | at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580) | at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384) | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) | at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) | at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) | at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) | at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) | at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315) | at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243) | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) | at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) | at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156) | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) | at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) | at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) | at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) | at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) | at java.lang.Thread.run(Thread.java:613) | Any suggestions much appreciated. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopi
[jboss-user] [JBoss Seam] - Re: Seam-managed persistence contexts and Glassfish
Thanks I'm modifying the jpa example to work with my app but I now get an exception at startup. anonymous wrote : org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect persistence.xml | http://java.sun.com/xml/ns/persistence"; | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; | xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";> | | org.hibernate.ejb.HibernatePersistence | jdbc/orpello | | | | | | | | | | components.xml | http://jboss.com/products/seam/components"; | xmlns:core="http://jboss.com/products/seam/core"; | xmlns:security="http://jboss.com/products/seam/security"; | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; | xsi:schemaLocation= | "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd | http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.2.xsd | http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd";> | | | | | | | anonymous wrote : [#|2007-03-13T06:45:53.771+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=11;_ThreadName=httpWorkerThread-4848-0;_RequestID=eccb6a64-1a7e-4cf6-a27f-155f4ccab5e7;|WebModule[/Orpello-war]Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener | javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not instantiate dialect class | at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217) | at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) | at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83) | at org.jboss.seam.core.EntityManagerFactory.startup(EntityManagerFactory.java:74) | 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:589) | at org.jboss.seam.util.Reflections.invoke(Reflections.java:20) | at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123) | at org.jboss.seam.Component.callComponentMethod(Component.java:1842) | at org.jboss.seam.Component.callCreateMethod(Component.java:1757) | at org.jboss.seam.Component.newInstance(Component.java:1746) | at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175) | at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:145) | at org.jboss.seam.init.Initialization.init(Initialization.java:506) | at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33) | at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4236) | at org.apache.catalina.core.StandardContext.start(StandardContext.java:4760) | at com.sun.enterprise.web.WebModule.start(WebModule.java:292) | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:833) | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:817) | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:659) | at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1468) | at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1133) | at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1058) | at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:128) | at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:322) | at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:196) | at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:633) | at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:908) | at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:892) | at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:445) | at com.sun.enterpris
[jboss-user] [JBoss Seam] - Seam-managed persistence contexts and Glassfish
Has anyone had any success using SMPCs and Glassfish? All the Glassfish examples I have come accross use a standard JPA persistence context rather than seam-managed i.e. @PersistenceContext | EntityManager entityManager; instead of.. @In | EntityManager entityManager; In the Seam documentation for SMPC it says to make sure the EntityManagerFactory is bound into JNDI, which under JBoss is done with a persistence unit property. I can't seem to find any way to do this globally under Glassfish and the only solutions I have come accross is to bind the EntityManagerFactory on an individual ejb basis in ejb-jar.xml | | MyBean | | persistence/My-PU | My-PU | | | This approach works fine fine for session beans but doesn't cater for non-ejb components such as the seam EntityConverter. When I try to use in a select list it fails to find the Persistence Unit in JNDI. anonymous wrote : Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/persistence/My-PU | at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:751) | at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:156) | at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307) | at javax.naming.InitialContext.lookup(InitialContext.java:392) | at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:160) | ... 65 more | Any suggestions as to how to overcome this problem would be much appreciated. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027068#4027068 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027068 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: SeamEntityConverter - Cannot access entityManager
Thanks, after trying to inject EntityManager with "@In EntityManager entityManager" I can see it's a problem with the JNDI binding. I'm running on Glassfish and I've tried the following: components.xml - in web.xml - persistence/Orpello-PU Orpello-PU persistence.xml - .. and i get Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/persistence/Orpello-PU at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:751) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:156) at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:160) ... 115 more Maybe getting a bit off-topic here but can anyone help on how I should bind the entity manager into JNDI in Glassfish? >From what I have read the in web.xml should do it. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026197#4026197 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026197 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - SeamEntityConverter - Cannot access entityManager
Just starting out with EJB3 and Seam I have followed the Wiki instructions for using s:selectItems with the SeamEntityConverter to populate a select menu, the menu is populated correctly but when I sumbit the form I get a Faces Message: "Cannot access entityManager; Either use the default name (entityManager) for your entity manager or specify it in components.xml" I do have the entity manager specified in components.xml: Seam version: 1.2.0.PATCH1 Not sure where to go next and I'd appreciate it if someone could point me in the right direction. Thanks View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025726#4025726 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025726 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user