-
1. Re: Cant get list to populate with values before trying to a
meghiddo Jun 1, 2009 12:54 PM (in response to meghiddo)oh and also can someone tell me where in the richfaces folder I can find whatever it is I need to add as the source so when I click on 183 on the following line:
at org.richfaces.component.html.HtmlRecursiveTreeNodesAdaptor.getRoots(HtmlRecursiveTreeNodesAdaptor.java:183)
it wil bring up that class file editor so I can see what it is referring to? I thought it would just be the src folder but apparently not -
2. Re: Cant get list to populate with values before trying to a
meghiddo Jun 1, 2009 1:40 PM (in response to meghiddo)Here is the first part of the stack if it will help someone to help me figure this out:
javax.el.ELException: /test/treetest.xhtml @18,75 roots="#{tempTreeBean.ids}": Error reading 'ids' on type testContainer.Temp
com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
org.richfaces.component.html.HtmlRecursiveTreeNodesAdaptor.getRoots(HtmlRecursiveTreeNodesAdaptor.java:181)
org.richfaces.component.UIRecursiveTreeNodesAdaptor.getData(UIRecursiveTreeNodesAdaptor.java:55)
org.richfaces.component.UITreeNodesAdaptor$1.getData(UITreeNodesAdaptor.java:54)
org.richfaces.model.StackingTreeModel.getDataModel(StackingTreeModel.java:83)
org.richfaces.model.StackingTreeModel.doWalk(StackingTreeModel.java:309)
org.richfaces.model.StackingTreeModel.walk(StackingTreeModel.java:381)
org.richfaces.component.UITree.walk(UITree.java:422) -
3. Re: Cant get list to populate with values before trying to a
meghiddo Jun 1, 2009 1:53 PM (in response to meghiddo)essentially Im needing to tell my jsf page "invoke this method to load the list before you do anything else, then use this list to populate the tree"
-
4. Re: Cant get list to populate with values before trying to a
nbelaevski Jun 1, 2009 4:19 PM (in response to meghiddo)"Meghiddo" wrote:
essentially Im needing to tell my jsf page "invoke this method to load the list before you do anything else, then use this list to populate the tree"
You can use @PostConstruct annotation or constructor itself. -
5. Re: Cant get list to populate with values before trying to a
meghiddo Jun 1, 2009 5:12 PM (in response to meghiddo)sigh - well apparently there is just a problem with the method used to populate the list.
because I see this:
javax.servlet.ServletException: java.lang.IllegalArgumentException: Invalid PostConstruct annotation
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
Here is the method itself if you feel like trying to see whats wrong, Im at a loss. I think Im just going to have to give up on the rich tree Ive spent the last two weeks on. Its weird, this method seems to work when I just run it from eclipse but it just wont do it otherwise. Maybe it has something to do with client/server side issues?@PostConstruct public void loadNodes() throws IOException, Exception { DeviceCollectionXMLAO access = new DeviceCollectionXMLAO(); HttpClientMethods method = new HttpClientMethods(); DeviceCollection deviceCollection = null; deviceCollection = access.readXML(method.Response(null)); //System.out.println("printing deviceCollection = access.readXML(method.getResponseBodyAsStream(null));: " //+ deviceCollection.toString()); for (Device device : deviceCollection.getDevices()){ String x = device.getDeviceId(); ids.add(x); //System.out.println(ids); } } public List<String> getIds() { //loadNodes(); return ids; } public void setIds(List<String> ids) { this.ids = ids; } public void print(){ System.out.println("Printing ids list: "+ids); } }
And when I call that print method it prints out a list of deviceIds, so when I run it in eclipse its fine...I dont know what is up with this anymore, I thought I had it... -
6. Re: Cant get list to populate with values before trying to a
nbelaevski Jun 1, 2009 5:30 PM (in response to meghiddo)Methods annotated with @PostConstruct should not declare any exceptions in "throws", that's why you get java.lang.IllegalArgumentException.
Here is the first part of the stack if it will help someone to help me figure this out:
javax.el.ELException: /test/treetest.xhtml @18,75 roots="#{tempTreeBean.ids}": Error reading 'ids' on type testContainer.Temp
com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
org.richfaces.component.html.HtmlRecursiveTreeNodesAdaptor.getRoots(HtmlRecursiveTreeNodesAdaptor.java:181)
org.richfaces.component.UIRecursiveTreeNodesAdaptor.getData(UIRecursiveTreeNodesAdaptor.java:55)
org.richfaces.component.UITreeNodesAdaptor$1.getData(UITreeNodesAdaptor.java:54)
org.richfaces.model.StackingTreeModel.getDataModel(StackingTreeModel.java:83)
org.richfaces.model.StackingTreeModel.doWalk(StackingTreeModel.java:309)
org.richfaces.model.StackingTreeModel.walk(StackingTreeModel.java:381)
org.richfaces.component.UITree.walk(UITree.java:422)
Full stack trace is necessary to check.
Can you please post full example source code (managed beans, full page code, faces-config.xml) here or somewhere on the Internet (e.g. on sendspace.com)? -
7. Re: Cant get list to populate with values before trying to a
meghiddo Jun 1, 2009 5:48 PM (in response to meghiddo)I deleted all the other stuff besides the 6 java classes and one .xhtml page that are necessary for what Im trying to do, so I cut out all the excess I was able to.
http://www.sendspace.com/file/ce6t1p
I am about to go to class for 4 hours. Please dont go out of your way - any farther than you already have I should say for this. I think its obvious Im trying to work this out on my own (how many threads on this in two weeks now haha), I just dont have the needed experience yet. -
8. Re: Cant get list to populate with values before trying to a
nbelaevski Jun 1, 2009 6:20 PM (in response to meghiddo)I've removed throws (wrapped all in try/catch for now) and successfully launched the application on Tomcat 6 and JBoss 5.0.1.GA (removed jsf-api/jsf-impl and stax-* jars from the project before deploying to JBoss). I see one leaf tree - as in the source XML file.
-
9. Re: Cant get list to populate with values before trying to a
meghiddo Jun 2, 2009 12:10 AM (in response to meghiddo)I messed things up for myself even more now it would seem.
How do you start the server without the jsf api and jsf impl jars, every time I try to I get this log:
SEVERE: Exception starting filter richfaces
java.lang.NoClassDefFoundError: javax/faces/FacesException
at org.ajax4jsf.webapp.BaseFilter.init(BaseFilter.java:170)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.ClassNotFoundException: javax.faces.FacesException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 28 more
And then when I add those jars back in the server starts with no errors, but then when trying to launch the tree I get
javax.servlet.ServletException: java.lang.reflect.InvocationTargetException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
This is even more frustrating to know that my methods are all working but it is my friggin libraries messing things up!
And you didnt edit the web.xml or faces-config files at all then? -
10. Re: Cant get list to populate with values before trying to a
meghiddo Jun 2, 2009 12:32 AM (in response to meghiddo)btw, Im trying to figure out what the problem is now, Ill let you know if I find it.
Just to clear up your reply as well, did you first launch the server, and then go in and remove those jars? because as I say my server gives me errors when I tried to remove them.
And when creating the project, did you use server side implementation, or mojarra (which is where those two jsf JARS come from)? -
11. Re: Cant get list to populate with values before trying to a
meghiddo Jun 2, 2009 12:56 PM (in response to meghiddo)I really think it is something in my web.xml file that is tellling my project it must have the jsf api and impl jars.
So did you use the web.xml file I sent with my example, or did you have your own? -
12. Re: Cant get list to populate with values before trying to a
meghiddo Jun 2, 2009 1:03 PM (in response to meghiddo)
I think these lines from my web.xml file may be the problm:<servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
As soon as I removed those though my libraries started going crazy and changing positions and eclipse wont let me do anything... we shall see... -
13. Re: Cant get list to populate with values before trying to a
nbelaevski Jun 2, 2009 3:38 PM (in response to meghiddo)I've removed libraries, then deployed.
-
14. Re: Cant get list to populate with values before trying to a
meghiddo Jun 3, 2009 3:44 PM (in response to meghiddo)working finally!
the probelm was, I kept making libraries and putting jars in them, and then when I made a project I would import those libraries. Eclipse didnt like this, so instead I just made project with the bare minimum jars, and then added all the jars I knew I needed into web-inf/lib (which is what the gettying started guide says to do but I did not because it didnt work for me whan I first tried it)
Thanks a ton nbevalaeski, couldnt have done it without your tremendous effort