• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

rich:tree working now... all the work has finally paid off - THANKS

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright, Ive made progress, thats for sure. I have gotten my values bound to a list, but when I try to use that list to populate the rich tree I just get a blank page....not even any errors to go on...

So Im gonna start from the beginning here, and maybe someone with some extra time will try to figure this out. So be warned now, this is something you will have to sepnd some time on, it won't be a post you can just read through and see what my problem is. Youll probably have to copy and try my code on your own...but here goes anyway, who knows, maybe I am only a step away here...

So I have a web service storing data in xml form. I need to take this data from the web service and use it to populate a rich tree. Here is the link from which Im trying to get the data:

http://webc-apps.ni.com/measure/1.01/devices (this link is down right now for some reason though)

but all that you will see when you go there is:



This of course will be changing quite a bit too, which is why I cant just make this tree declaratively, it must be dynamic.

OK so where to start? I guess the method to get the data from this web service:



I know for sure that responseBody is holding the correct value, because I printed it out. SO I also have a readXml method that parses this data:



I guess I should also show the classes for Device and DeviceCollection:





And of course my class that makes all the method calls to grab and parse the data, then put it into the list (ids - thanks ernest for that)



I have changed a few things from when I first got this working. Mainly I commented out my basic getter and made that more complicated bit of code my getter. Because otherwise the getter would just be a null value right? Because that value has to have these other operations performed before it will actually hold a value. But at first the first method was called updateNodes() and the basic getter close to the bottom was not commented out. If it makes any difference
So when I print out the value of ids, it prints out:

[deviceID1] - although not right now since the web service is down - I hope the service wasnt down when I was attempting to populate the tree...wouldnt that be a laugh riot...

So now it would appear I now have a list (ids) that does contain the values I need (even though it is only one value right now it will be able to hold more Im pretty sure unless something else is wrong, heh)
So of course my managed bean:



and my .xhtml page:



That is just the version I gave up on, but believe me when I say I tried many different combinatins for populating the tree on that .xhtml page...

But, as I said, when I run this on my server, I get a nice blank white page. Now I would assume this means the value I am binding to my treenode holds no values, but I really don't know for sure what a white page means.
And dont worry, it isnt a problem with the eclipse set up or anything, I can get a rich tree to display using a .properties files as the data source. And all the other richfaes components I have been using for the rest of the stuff. Its just this one thing that is not working.

Thanks if you even attempted to read through this and find my problem.. But I wont feel bad if I get 0 replies to this, I mean who is going to want to take the time to have to go through all of this?
 
Saloon Keeper
Posts: 28757
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, Matt, when the ENTIRE page is blank, it probably means you're throwing a major exception and not getting anything back at all. If the page contains the non-tree elements such as headers and body text, that's different.

I'm not sure there's an option for a properly-behaving tree to never show anything unless you simple set its rendered attribute to false, irrespective of the data. I think at a minimum, it should be displaying a root not.

Do a Show Page Source on your web browser and see if it gives you any hints. Also, of course, check the server logs.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thought some of you who have seen me working on thsi same problem for two weeks might like to know it turns out my source code is all working fine, it has something to do with the JARs...
someone on the rich forums finally got tired of seeing all my possts Im sure, because he asked me to upload my source code so he could check it himself...
here is what he posted:

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.



Of course I tried his fix, but I still have problems (big surprise eh)
Here is my reply to his post:



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?





So now Im pretty much back where I started, just with a better idea of what the problem is, but even less clue about how to fix it. At least with java code I have some tidbit of experience...
 
Tim Holloway
Saloon Keeper
Posts: 28757
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wheee! All that grief, too.

I think you're including missing JSF API jar in your WEB-INF/lib directory. Or you have the JSF impl jar there, and it's giving classpath problems.

It might help if you just list what's in your WAR's WEB-INF/lib. And let us know what flavor and version of server you're using. JSF is still bleeding-edge enough that it can make a difference.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
edit - I created a new project where I removed all the redundancies, and used server supplied implementation rather than mojarra (jsf-api and jsf-impl), but I get errors starting the server. But as soon as I put jsf-api and impl into my lib folder the server starts fine. So Im being told those jars are causing my problems, yet I cant get ther server started without them!

This setting up of JARs s totally new territory to me, it was only by some miracle that I got things working in the first place. But your right I do have jsf-api in the web-inf folder, but only since trying to remove the mojarra library. Before this JAR was located in the mojarra libraray, but after removing it and trying to put it back in, the only way my sever starts without errors is by puting it in web-inf/lib

Here is the only way in which I can get my server to start without errors, by having these libraries:

Apache Commons
commons-beanutils
commons-collections
commons-digester
commons-logging

JBoss v5.0
waaay to numerous to list

JRE System Library - this libraray just shows up without me specifying it
resources
rt
jsse
jce
charsets
dnsns
localedata
sunjce_provider
sunmscapi
sunpkcs11

Mojarra (is implementation)
jsf-api
jsf-impl

RFJars (I created this one)
commons-beanutils
commons-collections
commons-digester
commons-logging
jsf-facelets
jstl-1.2

RichFaces (another I created)
richfaces-api
richfaces-impl
richfaces-ui

WebApp (jars show up in here after I add libraries to WEB-INF/lib)
jsf-api
jsf-impl
simple-xml
stax-1.2.0
stax-api-1.0.1

plus two free jars that are under no library heading
commons-codec-1.3
commons-digester

So I have doubles of commons-beanutils, commons-collections, and commons-logging; and triples of commons-digester. Before i tried the fix I got from the rich forum I only had one copy each of jsf-api and jsf-impl in the mojarra library, but now the only way to get my server to start correctly is by also placing these two jars in WEB-INF/lib, creating duplicates of them. However if Im understanding I should not need those two at all. But if that is so, why does my serve get errors every time I try to start without them (unless there are no projects deployed to the server)


I should give the steps I take when creating a new project to I think.

New->dynamic web project->
target runtime is jboss5.0
configuration is facelet 1.0 project
next->next->
then when asked to choose between server suplied implementation or one of my choosing, I choose my own - mojarra (which includes jsf-api and jsf-impl jars only)
then Im also prompted to choose other libraries and I choose
-apache commons (commons-beanutils, commons-collections, commons-digester, commons-logging)
-RFJARS which is one I created (commons-beanutils, commons-collections, commons-digester, commons-logging, jsf-facelets, jstl-1.2)
-Richfaces, another library I created - (richfaces-api, richfaces-impl, richfaces-ui)
then hit finish. after that I still needed some other jars so I manually added them to the build path. they are (commons-codec, and yet another commons-digester)
and finally I put some jars in my web-inf/lib folder (simple-xml, stax-1.2.0, and stax-api-1.0.1) Ive recently also had to add jsf-api and jsf-impl to this folder because after I tried to remove the mojarra libraray upon advice from the jboss forums, now the only way to get my server started correctly is to have those to jars in this folder




I think these lines from my web.xml file may be the problm:



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...
 
Tim Holloway
Saloon Keeper
Posts: 28757
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yank the jsf-imp jar out of your WAR. JBoss supplies its own copy and that can result in trouble - especially for MyFaces, but trouble regardless.

If that doesn't help, I'll list one of my projects for you to compare with.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thats what everyone is telling me but my server doesnt like not having it lol!!

But I think it has something to do with something I put in my web.xml file waaaay back when I first was learning about getting jars to work. I think this line is making my server think I must have this jar, or something like that. The line I am suspecting is:



I removed it, but now I am needing to restart my system because port 80 is taken, a mean little trick tomat likes to pull on me every now and then. Even when I use shutdown.bat the port is still taken. Itll be a sec but Ill post back soon
 
Tim Holloway
Saloon Keeper
Posts: 28757
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If Tomcat is holding Port 80, someone overrode the standard server.xml configuration data. Tomcat normally runs ports in the 8000 range, leaving port 80 alone. That way Apache can fron to for it if desired.

You generated a webapp for JBoss 5, but are you running JBoss 5? It makes a big difference, since the JSF support only came in somewhere around 4.2 or so.

You don't need - or want - javax.faces.webapp.FacesServlet to be in your WAR (in the faces-impl.jar file) because the WAR classpaths (WEB-INF/lib/* and WEB-INF/classes are prepended to Tomcat's TOMCAT_HOME/lib directory (I forget where that is when running JBOSS). Since the Sun RI faces-impl.jar is in TOMCAT_HOME/lib, you end up with classpath conflicts.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I changed the port to 80 so I wouldnt need to put :8080 when I went to check my pages.
But now I am getting that port 8009 is in use, so tomcat cant start. This has happened before, and the only way i resolved it in the past was by restarting my system, but that doesnt seem to be working right now.
Im not totally sure what you mean by am I running JBoss 5. The only time I do anything regarding JBoss is when choosing the target runtime. I can choose from APache tomcat or JBoss when choosing, and usually choose JBoss since I am useing richfaces. But then my actual server is tomcat. Should I change this? I know I can create a server JBoss, but nothing has ever worked on that in the past.

ANd so I do need to remove those lines in my web.xml then huh? The only reason it is in there is because when I first tried getting things working I had to put that in there to make thigs work. But I think that was because I always try to choose mojarra as my implementation. Which brings up another question, when eclipse asks me what implementation to use, should I choose from server supplied or mojarra? I would guess it isnt mojarra since those jsf jars seem t be part of the problem. In addition to that I also can choose from Sun JSF_R1 or something lke that. Should that be what i am choosing?

I am trying different combinations, but I cant really get any results until I free up port 8009.

I think it is coming down to I just have too much mismathced together, and it was working for simpler pages, but now that Im getting more complicated this is causing problems.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kill the process manually.

Personally, I think if you're not using Maven to manage a JSF project you're begging for trouble.

If you're running on Tomcat you should be very, very sure that the JBoss libraries you're using will work under TC: you can't just throw random libraries into a container and expect them to work. Are you following something from somewhere that describes how to use JSF/etc. on Tomcat? If you're not targeting JBoss then no, you shouldn't target its runtime...
 
Tim Holloway
Saloon Keeper
Posts: 28757
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yipes! If you don't intend to run on JBoss, don't generate for JBoss. Standards aside, there are major differences between straight Tomcat and JBoss JSF WARs.

Port 8009 is used by Tomcat to control shutdown, so you're either not shutting Tomcat down all the way or at least not waiting long enough. If your app doesn't cleanup well enough, it can hang shutdown - I fixed one of those about 3 months ago, and can't wait to get the repaired, rewritten app into production. Not only because of the shutdown hang, but because it takes the present app 35 flamin' minutes to restart versus about 53 seconds for the new version.

For Tomcat without JBoss, you do need jsf-impl.jar in your WAR. Tomcat6 has EL support in TOMCAT_HOME/lib (Tomcat 5 didn't), but currently no Tomcat has JSF built-in support.

RichFaces is a JBoss project, but you certainly don't need to run on or target JBoss. I use standalone Tomcat6 for the project I just mentioned.

Someone should correct me, but mojarra is a Sun RI implementation, I think. I believe it's the 1.2 implementation, but on that I'm not so certain. You do need 1.2 for the latest RichFaces stuff, though.

As for Eclipse settings, they're specific to the J(2)EE plugin you're using. My project was already J2EE when I got it, but no Eclipse support, so I couldn't get much help from the IDE. I'm using Maven to manage the packages.

But if you pull the FacesServlet from web.xml, ALL JSF will cease functioning. The FacesServlet is the engine that drives everything JSF-related.
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Someone should correct me, but mojarra is a Sun RI implementation, I think. I believe it's the 1.2 implementation, but on that I'm not so certain. You do need 1.2 for the latest RichFaces stuff, though.

You are right Tim. (Richfaces userguide specifies that)

Matt,
If your target server is Tomcat, do not associate anything related to JBoss with it.

All you need is the richfaces jars and you should be fine with the correct filter entry for the richfaces filter in your web.xml


This is specified in the richfaces userguide
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I remember now why I used the JBoss target runtime. I just made a project without it, and my HttpCLient stuff no longer works.



all underlined and say

The import org.apache.commons.httpclient cannot be resolved

I went to confgure build path and add external JARs, and I added in sommons-codec and junit, and commons-logging is already included in apache-commons. But still same problem. Maybe the versions of these JARs are wrong? I really dont know. But it is necessary for things to work, because I am getting and putting data from a web service via httpclient

Any ideas?

edit - oh and someone at the company this is being done for advised against me using maven for some reason. I cant remember what he said but he inferred it would cause problems
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you add the httpclient jars???
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
edit - i was just one of those things where it did not like me copying and pasting this code, I had to just retype it all and the errors went away.

Now the only error I have on this new project are these four:



although I dont see any of those jars listed in my libraries when I look at the project explorer. Think that will be a problem? Im about to try this new setup and see what happens...
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version? HttpClient, for example, now lives at org.apache.http.client.HttpClient.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well it is the httpclient jar that comes with jboss, that is the only one I have. I just manually import that jar only and it seems to work for now (and in the past). But my imports are not what you have there, mine are
import org.apache.commons.httpclient.HttpClient;

But still my server doesnt even want to start without errors. Here is what I am getting now:




edit - I went ahead and downloaded the most recent http client commons jar - 3.1, but I still have to use
import org.apache.commons.httpclient.HttpClient;
rather than
import org.apache.http.client.HttpClient;

but that may not have been what you meant in the first place
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's an older version. Not that there's anything intrinsically wrong with that, but I don't know why you're using stuff that comes with JBoss.

Now it sounds like you're not deploying correctly; you say the commons-logging jar is in "apache-commons" (I don't know what that means), but it's obviously not there on startup.

I know your stuff is due tomorrow, but I *really* think you need to take a big step back.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The commons httpclient is being superceded by the HTTP components (see http://hc.apache.org/) but it probably doesn't matter which you use.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when I look in tomcat/wtpwebapps/projectname/WEB-INF/lib here are the jars in there:

jsf-api
jsf-impl
jsf-facelets
jstl-1.2
richfaces-api
richfaces-impl
richfaces-ui

is there anything missing in that?

I seem to be follwoing the same path I did a month and a half ago which got me to the point I was at before, with all these jars and libraries mis mashed together.

I just need to create a project that can use simplexml, httpclient, jsf and richfaces - such a simple proposition eh?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, almost *everything* is missing.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:

Now it sounds like you're not deploying correctly; you say the commons-logging jar is in "apache-commons" (I don't know what that means), but it's obviously not there on startup.

.



By that I mean I have certain libraries that I can choose from that include more than one jar. Apache commons is one such library. It contains 4 commons-* jars. Another is my richfaces library. It includes 3 richfaces-* jars.

So you think I shuld essentially go back to the beginning and do some more tutorials that help me setup my project in the first place?

The first tutorial I was able to get a successful run out of was
http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html
but after that it seemed I had to jump through hoops to get other things working.

And it was that tutorial that had me use the mojarra library (which contains the jsf-api and jsf-impl jars) which are the jars that seem to keep coming around as my problem.

I think too many tutorials has ben my problem actually, I do one and then another and another and Im not sure which parts of them are supposed to e interchangeable and which parts only apply to a particular set up

But I dont demo this until june 11th actually. Tomorrow I have to do a pre-demo with some of the compnay guys, but they are aware of the issues I have had with this.

Im not sure what to try next lol, Ive been trying to do too much at once ><

David Newton wrote:Yeah, almost *everything* is missing.



lmao, that is one of the funniest replies I have seen for some reason

so maybe instead of trying to import these libraries, some of which I created myself just to have jars in one place, I should manually add each jar one at a time to the WEB-INF/lib folder? Ill try it but for now I have to turn off my system becasue we are having a bad storm and its very likely Ill see a power surge

Thanks for trying you three, I learn a little more from each reply
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean when you say "the library contains multiple jars"? I don't know what that means. It sounds bad.

I think trying to do manual transitive dependency management for any project that has more than a few dependencies is a bad idea. At the *very* least you should be using one of the Maven repo browsers that list dependencies.

Once you figure out the dependencies, deploy each individual jar.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I moved on from this for now, but David, I wanted to say thanks for something else.
I was having another problem I was trying to work out, and remembered what you said about the httpclient jar stuff. It would have been another problem with no end in sight, but as soon as I used the updated jar it worked perfectly!
It is just a page that asks users to put in a project name, and hit submit, and from there my java code is supposed to add the project data to the web service. And it works flawlessly (well not quite actually, it adds "jsf" to the front of the name input for some reason when posting it the web service...but I can definitely live with that, its not line after line of error code!).
Thanks very much, you saved me a lot of grief by just giving me that little bit of offhanded info
 
Tim Holloway
Saloon Keeper
Posts: 28757
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. Although it looks like this is the end, I think maybe we learned a few things, so I'm going to make one last contribution. Since it seems that the root of the problem was getting the right jars and the right versions, here's a Maven POM that does RichFaces on Tomcat, uses Hibernate JPA for persistence, and the Spring Framework to wire it up. It's also using JAXB and Dozer for needs specific to the project and you'll note that I had been using OpenJPA. One of the advantages of using standards-based Maven-supported components is that if a piece of software doesn't work, you can swap it out as easy as modifying the POM and doing a clean/install build.

The POM is only the tip of the iceberg, since Maven also automatically downloads and includes any depency JARs. It's why, despite Maven's more irritating attributes, I use it on most of my more advanced projects.

Also, see the "Not in JBoss?" comment. You can remove the question-mark. It really is not in JBoss. Maven can handle things like that using profiles, where the Tomcat profile includes the JSF-impl jar but the JBoss profile doesn't. This project has some scars as I tried bouncing stuff back and forth, and doesn't actually have the profiles set up right for that, but at least you can see where they'd go.

 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wow, I hope you didnt do all that just for my problem!
But I would not say we were at the end here lol, I still cant get this to work.
I just moved on to other issues for now since I need to have something to show for today.
I guess Im gonna have to bite the bullet and lern maven, because I have no idea what any of that is really
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maven, among other things, eliminates manual transitive dependency resolution, which is amongst the problems you're having.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh no, I have a good idea of what maven does, Im saying I dont much understand that code tim posted up there
but Im sure as I learn maven it will begin to make sense
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It defines the top-most dependencies for his Tomcat/JSF project (and includes a number of other technologies). The additional dependencies are handled by Maven.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally it is working!!!

Want to know what the problem was?

It was all the libraries I had defined (like an RF library that I puit all the rf jars in). When I made a project without putting in all those pre defined libraries, and with tomcat runtime instead of jboss, and then just added all the jars I needed to web-inf/lib it worked perfectly (kinda but at least a tree shows up lol)


Thanks again to tim, david, and kavita - I might have to make another donation alredy haha
 
Kavita Tipnis
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad that it is working ! Log your steps so that you don't forget ;)
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont think I could possibly ever forget them lol. This is the biggest programming hurdle Ive ever overcome, its really a big moment for me lol
 
Tim Holloway
Saloon Keeper
Posts: 28757
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Matt Kohanek wrote:wow, I hope you didnt do all that just for my problem!
But I would not say we were at the end here lol, I still cant get this to work.
I just moved on to other issues for now since I need to have something to show for today.
I guess Im gonna have to bite the bullet and lern maven, because I have no idea what any of that is really



Nah. I stole it verbatim from a "showcase" project I have. It actually started quite small, but since it's my technology sandbox, I started pulling in more and more gee-whiz features until it grew to what you see. And actually, if you look at just the dependencies, which form the heart of it, it's not quite as scary as it looks.

Now another project I have has a much more formidable POM. It's a descendent of this one, but I copied it into a completely unrelated app. That POM not only does the basic builds for a webapp, it also constructs a Linux RPM install file, handles version incrementing, checks tagged versions into subversion, and can even generate the project website.

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Full-featured POMs are things of terrifying beauty. (Which is why I'm leaning towards buildr ;)
reply
    Bookmark Topic Watch Topic
  • New Topic