[JBoss Seam] - Re: @in(create=true) not working !
by _polly
right... i'm having another try at upgrading to seam 2.0.0CR1!
I've narrowed the problem down to being something to with the RichFaces integration. Specifically, the RichFaces tab panel doesn't seem to be able to access Seam components through the EL. I've changed the RichFaces jar files to the 3.1.1 snapshot release and it is displaying the RichFaces tab panel correctly - it's just getting hold of seam components that is failing. This is giving the 'In attribute requires non-null value' error.
The xhtml file snippet is:
| <h:form class="homepage" id="homepageform" enctype="multipart/form-data">
|
| <h:inputText value="#{userView.selectedTab}" id="selectedTab"/>
|
| <rich:tabPanel switchType="client" selectedTab="#{userView.selectedTab}">
|
| ...
|
The standard jsf inputText component above the tab panel picks up the #{userView.selectedTab} fine, and if I put debug output in the selectedTab getter for the userView bean I can see it is being called without any problems by the jsf widget. But with the richfaces tab panel i get this stack trace:
| 15:28:18,282 admin WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@8bfd35) threw exception
| javax.faces.FacesException: javax.el.ELException: /admin/adminhome.xhtml @25,78 selectedTab="#{userView.selectedTab}": Error reading 'selectedTab' on type org.javassist.tmp.java.lang.Object_$$_javassist_3
| at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
| at org.richfaces.component.UITabPanel.getValue(UITabPanel.java:70)
| at org.richfaces.component.UITabPanel.getRenderedValue(UITabPanel.java:96)
| at org.richfaces.component.UITabPanel.restoreState(UITabPanel.java:119)
| at org.richfaces.component.html.HtmlTabPanel.restoreState(HtmlTabPanel.java:985)
| at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1138)
| at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1154)
| at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1154)
| at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1154)
| at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:245)
| at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:287)
| at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:93)
| at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
| at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
| at org.ajax4jsf.application.AjaxViewHandler.restoreView(AjaxViewHandler.java:159)
| at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:141)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| 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.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)
|
| <snip>
|
| Caused by: org.jboss.seam.RequiredException: In attribute requires non-null value: userView.entityController
| at org.jboss.seam.Component.getValueToInject(Component.java:2169)
| at org.jboss.seam.Component.injectAttributes(Component.java:1599)
| at org.jboss.seam.Component.inject(Component.java:1417)
| at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
| 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.GeneratedMethodAccessor1494.invoke(Unknown Source)
| 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)
| ... 96 more
|
|
|
It seems to be complaining about the injected EntityController object, which gets created fine everywhere else it is accessed apart from in this tabpanel. This is how i inject it:
| @In(create=true)
| private EntityController ec;
|
Do I need to change anything in my web.xml maybe for this release? I currently have:
| <!-- Ajax4jsf -->
| <context-param>
| <param-name>org.richfaces.SKIN</param-name>
| <param-value>blueSky</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
| <param-value>com.sun.facelets.FaceletViewHandler</param-value>
| </context-param>
|
| <!-- Seam -->
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| ...
|
|
I looked at the seam-examples for seamdiscs, which has richfaces integrated, and there is no richfaces filter defined in the web.xml - just a comment to say it is now handled by the seam filter, so I took the richfaces filter part out.
The tab panel renders ok if I put a static value in like
<rich:tabPanel switchType="client" selectedTab="homePage">
and I can access seam components through other widgets, it's just the two things together that don't seem to play nicely!
so has anyone got any bright ideas about this one? any help at all would be greatly appreciated! :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088888#4088888
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088888
18 years, 7 months
[JBoss Seam] - Re: How can I pass parameters to action methods
by cupdike
Ok, so I'm not insane (at least not due to this ;-) )
But I'm doing it just like it's done (famous last words) in the booking demo. That is:
| @Stateful
| @Name("passSearch")
| public class PassSearchAction implements PassSearchFacade {
| ...
| @DataModel
| private List<Pass> passList;
|
| ------------------------------------------------
|
| <rich:dataTable id="passList"
| var="pass"
| value="#{passList}"
| rendered="#{not empty(passList)}">
| ...
| <h:column>
| <f:facet name="header">Action</f:facet>
| <s:link view="/passEdit.xhtml"
| value="Select"
| id="pass"
| action="#{passEdit.selectPass(pass)}">
| </s:link>
| </h:column>
| </rich:dataTable>
And the magic ain't happening. Maybe this is no longer a recommended way to do it, but I'd like to know why it's not working for me.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088887#4088887
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088887
18 years, 7 months
[JBoss Seam] - Re: FullTextEntityManagerImpl
by jatsrt
So just a little more information.....
JBoss 4.2.1
Seam 2.0.0 CR1
Standard seam-gen project, added this to my persistence.xml
| <!-- use a file system based index -->
| <property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider" />
| <!-- directory where the indexes will be stored -->
| <property name="hibernate.search.default.indexBase" value="./homespunindexes" />
| <property name="hibernate.ejb.event.post-insert" value="org.hibernate.search.event.FullTextIndexEventListener"/>
| <property name="hibernate.ejb.event.post-update" value="org.hibernate.search.event.FullTextIndexEventListener"/>
| <property name="hibernate.ejb.event.post-delete" value="org.hibernate.search.event.FullTextIndexEventListener"/>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088886#4088886
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088886
18 years, 7 months
[JBoss Seam] - Re: left tree - explorer like application
by christian.bauer@jboss.com
http://fisheye.jboss.com/browse/~raw,r=1.1/JBoss/jboss-seam/examples/wiki...
http://fisheye.jboss.com/browse/JBoss/jboss-seam/examples/wiki/src/main/o...
| public TreeNode getTree() {
| if (directoryTree == null) {
| directoryTree = new WikiTreeNodeAdapter(getInstance(), getNodeDAO().getComparatorDisplayPosition(), 2l);
| directoryTree.loadChildren();
| }
| }
|
| <h:form id="dirTree" rendered="false">
| <ui:include src="includes/statusIndicator.xhtml"/>
|
| #{directoryHome.instance.name}:
| <rich:tree value="#{directoryHome.tree}" var="nodeWrapper"
| switchType="ajax" status="dirTree\:status"
| nodeFace="#{wiki:getType(nodeWrapper.wrappedNode)}">
|
| <rich:treeNode type="Directory">
| <f:facet name="icon">
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.dir.gif" width="18" height="20"/>
| </f:facet>
| <f:facet name="iconLeaf">
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.dir.gif" width="18" height="20"/>
| </f:facet>
| <h:outputText value="#{nodeWrapper.wrappedNode.name}"/> (#{nodeWrapper.level})
| </rich:treeNode>
|
| <rich:treeNode type="Document">
| <f:facet name="icon">
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.doc.gif" width="18" height="20"
| rendered="#{nodeWrapper.wrappedNode != nodeWrapper.wrappedParent.wrappedNode.defaultDocument}"/>
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.doc.default.gif" width="18" height="20"
| rendered="#{nodeWrapper.wrappedNode == nodeWrapper.wrappedParent.wrappedNode.defaultDocument}"/>
| </f:facet>
| <f:facet name="iconLeaf">
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.doc.gif" width="18" height="20"
| rendered="#{nodeWrapper.wrappedNode != nodeWrapper.wrappedParent.wrappedNode.defaultDocument}"/>
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/icon.doc.default.gif" width="18" height="20"
| rendered="#{nodeWrapper.wrappedNode == nodeWrapper.wrappedParent.wrappedNode.defaultDocument}"/>
| </f:facet>
| <h:outputText value="#{nodeWrapper.wrappedNode.name}"/> (#{nodeWrapper.level})
| </rich:treeNode>
|
| <rich:treeNode type="File">
| <f:facet name="icon">
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/#{fileMetaMap[nodeWrapper.wrappedNode.contentType].displayIcon}"
| width="18" height="20"
| rendered="#{!empty fileMetaMap[nodeWrapper.wrappedNode.contentType]}"/>
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/#{fileMetaMap['generic'].displayIcon}"
| width="18" height="20"
| rendered="#{empty fileMetaMap[nodeWrapper.wrappedNode.contentType]}"/>
| </f:facet>
| <f:facet name="iconLeaf">
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/#{fileMetaMap[nodeWrapper.wrappedNode.contentType].displayIcon}"
| width="18" height="20"
| rendered="#{!empty fileMetaMap[nodeWrapper.wrappedNode.contentType]}"/>
| <h:graphicImage value="/themes/#{wikiPreferences.themeName}/img/#{fileMetaMap['generic'].displayIcon}"
| width="18" height="20"
| rendered="#{empty fileMetaMap[nodeWrapper.wrappedNode.contentType]}"/>
| </f:facet>
| <h:outputText value="#{nodeWrapper.wrappedNode.name}"/> (#{nodeWrapper.level})
| </rich:treeNode>
|
| </rich:tree>
| </h:form>
|
This is high performance read-mostly tree framework with dynamic pre-fetch size for on-demand loading of an arbitrary depth of childrens-children (in a single, very efficient, SQL query).
The UI part is not used right now but you should be able to figure out how it fits together if you look at the source and spend maybe 3 days on it.
Don't even start thinking about whatever magic Javascript buttons from whatever broken JSF library you click on before you sort out the basics. I am still looking for help implementing moving of tree nodes.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088884#4088884
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088884
18 years, 7 months
[JBoss Seam] - seam-gen problem when same table is referenced two times
by marius.oancea
Hello,
I have a table USER and a table ADDRESS.
USER has two (important) attributes :
- localAddress
- remoteAddress
both are foreign keys to ADDRESS table.
So in ADDRESS table we will have two records for each user.
seam generate-entities perfectly generate the beans but home entities are wrong. Name of address home entities injected in user home have the same name.
| create table xx.user (
| userid varchar(10)NOT NULL PRIMARY KEY,
| local_address integer,
| remote_address integer
| ) in userspace1;
|
| create table xx.ADDRESS (
| adrid integer NOT NULL PRIMARY KEY,
| street varchar(200),
| streetNo integer
| ) in userspace1;
|
| alter table xx.user add CONSTRAINT ADR1 foreign key (local_address) references xx.ADDRESS(adrid);
| alter table xx.user add CONSTRAINT ADR2 foreign key (remote_address) references xx.ADDRESS(adrid);
|
| Entity user is good:
| @Entity
| @Table(name = "USER", schema = "xx")
| public class User implements java.io.Serializable {
|
| private String userid;
| private Address addressByLocalAddress; //<---- correct, different names
| private Address addressByRemoteAddress; //<---- correct, different names
|
but in UserHome we have:
| @Name("userHome")
| public class UserHome extends EntityHome<User> {
|
| @In(create = true)
| AddressHome addressHome; //<----- WRONG, SAME NAME
| @In(create = true)
| AddressHome addressHome; //<----- WRONG, SAME NAME
|
I'm using SEAM 2.0 BETA (Hibernate Tools 3.2.0.b9) with ant.
Any clue?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088883#4088883
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088883
18 years, 7 months
[JBoss Seam] - Page parameter question
by limousyf
Hello,
I have trouble passing a simple parameter to a page.
I read the example on page 159 of Michael Yuan's book :
anonymous wrote :
| So when you load a URL such as person.seam?pid=3, Seam automatically invokes the ManagerAction.setPid(3) method (...)
|
But my implementation seems nto to work.
I re-created the exact same situation (I first tried with a boolean value without any success ...)
Well here's a bunch of my code :
| @Name("activitesByCollaborateurCrossData")
| public class activitesByCollaborateurCrossDataBean implements
| activitesByCollaborateurCrossData {
|
| (bla)
|
| @Out(scope = ScopeType.CONVERSATION)
| private Long realise;
|
| (blabla)
|
| public void setRealise(Long realise) {
| this.realise = realise;
| }
| (blablabla)
| }
|
Then I created my page parameter in .page.xml file
| <page>
| <param name="collaborateurFrom"/>
| <param name="collaborateurCollaborateurId" value="#{collaborateurHome.collaborateurCollaborateurId}"/>
| <param name="societeSocieteId" value="#{societeHome.societeSocieteId}"/>
| <param name="firstResult" value="#{collaborateurList.firstResult}"/>
| <param name="realise" value="#{activitesByCollaborateurCrossData.realise}" converterId="javax.faces.long"/>
| </page>
|
And finally I call the page using a s:link
| <s:link view="/PageactivitesByCollaborateurCrossData.xhtml" id="SaisieActivites" >
| <f:param name="collaborateurCollaborateurId" value="1" />
| <f:param name="realise" value="1" />
| <h:graphicImage value="/img/application_form.png" />
| </s:link>
|
But my "realise" attribute is aways null.
I put a breakpoint on the set setRealise(Long realise) method but it's never toogled.
The more unexpected stuff is that the other params, pointing on EntityHome objects are actually working fine !
In fact, I never succeeded in passing a parameter on a field created by me :/
What is wrong in my code ?
(PS: I haven't forgot to put the setRealise signature in the interface)
Thanks for your help on this
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088877#4088877
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088877
18 years, 7 months