1 2 Previous Next 19 Replies Latest reply on Sep 20, 2009 11:18 PM by akazakov

    Web App Libraries not published?

    deanhiller

      I right clicked the project, chose properties and then J2EE Module Depends and selected all my jars that I wanted published. Then, I start up tomcat and bam, ClassNotFoundException on the classes that are in the jars in Web App Libraries. How do I debug this issue? I would think this should work out of the box....it does with just a WTP project framework and changing it to a dynamic web project but doesn't seem to work in jboss tools.
      thanks,
      Dean

        • 1. Re: Web App Libraries not published?
          maxandersen

          jbosstools is not WTP but if it works without jbosstools then please report in jira with how you do it when it works and then what happens when you use jbosstools server adapter - thanks!

          • 2. Re: Web App Libraries not published?
            deanhiller

            k...I opened this issue..

            https://bugs.eclipse.org/bugs/show_bug.cgi?id=168538

            We have decided to just use WTP for now as can't just seem to figure out how to get setup in JBoss tools.

            • 3. Re: Web App Libraries not published?
              maxandersen

              deanhiller,

              That issue is something JBoss is actually helping fixing in upcoming WTP 3.2 by introducing a basic "Module assembly" page which allows for more flexible packaging than what WTP provides now.

              I fail to understand how you can say "just use WTP" since JBoss tools *is* using WTP.

              I really would like to know what exactly is not working here ?!

              • 4. Re: Web App Libraries not published?
                deanhiller

                well, I finally got it to work in jboss tools kind of, but I sure could not mount my project from jboss tools. Here is the exact play by play

                First, my dir structure
                project
                ---input
                ------javasrc
                ------libexclude - jars not to be put in WEB-INF/lib
                ------libinclude -- jars to be put in WEB-INF/lib
                ------webroot - xhtml files and jpgs, etc
                ---------WEB-INF - descriptors (NO jars, no class files)

                In WTP, I finally managed to mount this project doing the following
                1. checkout project from CVS (then find out there is no way to convert to JSF like JBoss has, but alas, I tried that way in JBoss and it didn't work)
                2. then delete project but leave on filesystem
                3. delete .project and .classpath files to make sure it is a clean java project with no eclipse relationship

                NOW, I figure I can mount using dynamic web project so I do that
                4. choose new->dynamic web project
                5. Use default must stay checked and you HAVE to make sure the path maps to where your project is. If you uncheck it and pick your project, it gives you a weird error saying project already exists but if you leave it checked, it is fine with your project being there which is odd.
                (I tried these same exact steps with jboss as well by the way)
                6. Next step was then to choose the properties->J2EE Module Dependencies and add all the jars there
                7. NExt add a tomcat runtime to the servers tab and deploy
                deploying worked great in WTP. Following all these same steps in JBoss, deployment failed with ClassNotFoundExceptions like Web App Libraries were not being deployed or something


                Workaround....to work around this, you HAVE to mount the java project while eclipse is WTP and then install JBoss tools AFTER you have mounted the project and deployment to tomcat works. then, for some reason, JBoss tools is ok.

                Another really really annoying thing is when I add the seam facet, it adds jars to input/webroot/WEB-INF/lib folder which is very annoying..our jars are in libinclude and all generated content we put in output folder so just deleting the output folder is enough to clean a project. At some point, jboss tools had put classes in input/webroot/WEB-INF/classes as well even though our output folder is eclipsegen folder.

                I hope this helps. I spent 3 days on this.

                Oh, and my personal opinion is that the wizards should really really ask for 4 or 5 things
                1. javasrc
                2. where jars are for WEB-INF/lib
                3. where jars are for libexclude(and this is where runtime jars should be put so project can build without external dependencies if user wants)
                4. where root of web files are
                5. maybe an output folder if jboss tools really needs to write out classes, jars into WEB-INF(and then just copy over webroot) sort of like the eclipse output folder for classes......it is configurable.

                Lastly, in JSF WTP, you can choose self manage jars(this is a GREAT feature allowing lots of flexibility)...when adding Seam, it does not let you do that, there is no option.

                I hope this helps some, thanks for the work!!!

                Dean


                • 5. Re: Web App Libraries not published?
                  akazakov

                  deanhiller, please read my comment on https://jira.jboss.org/jira/browse/JBIDE-4884:

                  You don't have to install Seam facet to enable seam support for a project. Just enable it in Project Properties->Seam settings page.

                  >> adding the facets JSF and seam also incorrectly added a bunch of junk...index.html, index.jsp
                  See https://jira.jboss.org/jira/browse/JBIDE-2927


                  • 6. Re: Web App Libraries not published?
                    deanhiller

                    actually, I tried that already and it did work!!! thanks!!!!...though I can't remember if that copied the jars over or not in that case.

                    is there a difference between that setting and the seam facet at all? ie. will I be lacking features?

                    Dean

                    • 7. Re: Web App Libraries not published?
                      akazakov

                       

                      "deanhiller" wrote:
                      I can't remember if that copied the jars over or not in that case.

                      It doesn't.
                      "deanhiller" wrote:
                      is there a difference between that setting and the seam facet at all?

                      Seam settings page can be used to enable/disable Seam on any Java project. And it doesn't copy any resources to a project. Facet can be installed only on a WTP project and copies resources (libs, java, pages) from Seam templates folder.
                      "deanhiller" wrote:
                      ie. will I be lacking features?

                      No. All features must work.

                      • 8. Re: Web App Libraries not published?
                        deanhiller

                        well, this sucks, my content assist seems to be completely broken. I definitely can't work like this. Where are the logs where the exception will be for this stuff?
                        thanks,
                        Dean

                        • 9. Re: Web App Libraries not published?
                          deanhiller

                          ah crap, why does it redeploy my app every time I make a simple code change. In MyEclipse, it just hotswapped the one class and was done. What is going on? This stinks as if I am in the middle click save and then do another class, it pretty much kills my session and what I was doing when it does this redeployment it is doing. any way to change that.

                          thanks,
                          Dean

                          • 10. Re: Web App Libraries not published?
                            rob.stryker

                            If your re-deploy which is happening after every save is launching an ant task or some sort of long-running process, you're not using the correct server adapter. You're using a WTP adapter which is not enhanced for speed.

                            If you were using the jbosstools server adapter you wouldn't even really notice the change.

                            • 11. Re: Web App Libraries not published?
                              maxandersen

                              deanhiller,

                              First, You moved from one IDE to another - please do expect some subtle differences. We love to help you make sure it works for you and at the same time learn what challenges a MyEclipse "migrator" bumps into - so please bear with us while trying to figure out what you are having problems with!

                              Secondly, here are some questions/answers

                              what does "content assist seems to be completely broken" means ? There are about 100 or so different code completions in Eclipse + JBoss Tools. Could you be more specific ?

                              About where errors are - look in the the Error Log View.

                              About redeploy and MyEclipse hotswapped one class then that sounds weird. Hotswapping is only done when you have a debug session running and has nothing to do with MyEclipse - just basic eclipse Java debug behavior.

                              And *if* you use the Server adapters provided by JBoss Tools i.e. in the JBoss Community and JBoss Enterprise categories then we only copy the actual changed files (to i.e. allow for .xhtml and similar files to be available instantly). No redeploy should occur *unless* you are touching the descriptors.

                              In case you simply don't want any automatic publishing then you can disable that in the global preferences or simply double click the server in the server view and disable it on that Server Editor that pops up.

                              btw. it might be me - but aren't your problems about class exceptions more about trying to use JBoss AS on a project that is configured to run in Tomcat standalone ?

                              For the issues about "converting a project" then in JBoss Tools 3.1.x we will be introducing a "don't copy/manage libraries" option too.

                              Maybe it would be better if you created different threads for different problems ? (hard to discuss project conversion, content assist, difference in deployment between IDE's etc.)

                              btw. I'm 100% convinced that MyEclipse doesn't do anything magically here that we don't do - your project is just done via MyEclipse's "way" so it works better there out of the box....we just need to find out what that "way" are to fix it.

                              • 12. Re: Web App Libraries not published?
                                deanhiller

                                no, this thread and help ROCKS...thankYOU!!! I am just very opinionated ;) and my frustration comes out in typing, but thankyou for all the help and comments!!!

                                content assist fixed...(but probably a small bug there)....
                                so, thanks, I did figure out that somehow when selecting jars, *.txt files were allowed and showed up in the view and so that is why content assist was broken!!! I removed txt files and it works(but not sure why txt files were allowed in the first place....if I remember on standard java projects, eclipse filters those out but for some reason, they were not filtered out).

                                hmmm, I just realized there is a WTP servers view and a JBoss servers view. I will try the jboss servers view and see if that helps.

                                Please Please though, it would be great if the wizards for the next people that try to port work better and they should really add a step for Web App Libraries as well in there as that led to alot of confusion I thought(just my 2 cents)

                                i love the "open selection" addition so I can go from *.xhtml file to java code....Can't wait for the refactor method to affect my xhtml files though!!! that would absolutely rock!!!.

                                later,
                                Dean

                                • 13. Re: Web App Libraries not published?
                                  maxandersen

                                   

                                  "deanhiller" wrote:
                                  no, this thread and help ROCKS...thankYOU!!! I am just very opinionated ;) and my frustration comes out in typing, but thankyou for all the help and comments!!!


                                  :)


                                  content assist fixed...(but probably a small bug there)....


                                  Again - *which* content assist ? In Java, xhtml, components.xml, pages.xml, hbm.xml, ??


                                  so, thanks, I did figure out that somehow when selecting jars, *.txt files were allowed and showed up in the view and so that is why content assist was broken!!! I removed txt files and it works(but not sure why txt files were allowed in the first place....if I remember on standard java projects, eclipse filters those out but for some reason, they were not filtered out).


                                  Selecting jars where ? In WTP wizard? In Java build path ? In Hibernate Console ? ...


                                  hmmm, I just realized there is a WTP servers view and a JBoss servers view. I will try the jboss servers view and see if that helps.


                                  In the latest releases there aren't much difference. We have our own server view for anything we havent yet contributed back as extendable in the WTP server view.

                                  What is important to use from us is not the view, but the actual server type you selected when creating the server.


                                  Please Please though, it would be great if the wizards for the next people that try to port work better and they should really add a step for Web App Libraries as well in there as that led to alot of confusion I thought(just my 2 cents)


                                  You would like *another* page added beyond the 5 already there ? I would rather remove than add pages at this point :)


                                  i love the "open selection" addition so I can go from *.xhtml file to java code....Can't wait for the refactor method to affect my xhtml files though!!! that would absolutely rock!!!.


                                  If you juse JBoss Tools 3.1 M3 it will....would love people to try it out and let us know if it works as expected for you guys!


                                  • 14. Re: Web App Libraries not published?
                                    deanhiller

                                    I think I am using 3.1.0 M3 ;). The version in eclipse says
                                    3.1.0v200909110340M-H277-M3 ;).

                                    1. Java Content assist was fixed by jars in build path and in J2EE Module Dependencies by removing *.txt files (it would be nice if the zip exception was just swallowed instead)

                                    2. hmmm, your own server view...I will have to try that. Maybe it will get rid of my hot redeploy every time I touch a class file. I added hte server through WTP servers view and it showed up in jboss servers view and was using that.

                                    3. adding another page....well, I must say, I LOVE how the basic create project from CVS wizard has about 5 pages but the finish button shows up on alot of them so I could skip out of the wizard early, but for most beginners, they would go through the whole wizard and seeing the J2EE Module Dependencies tab would have been a huge help(I would never have had ot ask about where to add to Web App Libraries in that case on the forums). just my 2 cents though, don't know what other jboss tools newbs think there.

                                    1 2 Previous Next