1 2 3 4 5 Previous Next 69 Replies Latest reply on Jul 7, 2011 11:59 AM by atijms Go to original post
      • 45. Re: Adding JBoss AS source to a project
        henk53

        max.andersen@jboss.com wrote:

         

        sorry, just saw it is actually adding on source lookup not classpath - but again, these shouldn't really be needed to be added ....

         

        So as I understand it, the path taken by the WTP adapter is strictly spoken 'wrong', although it does seem to do the trick. The JBoss AS tools adapter does its thing in a better way, but happens to be broken in CR1 and this will be fixed in CR2 (and is already fixed in the nightly).

         

        It would be interesting to learn about the approach taken by the JBoss AS tools adapter.

         

        Anyway, with this intermediate problem out of the way we can go back on concentrating on what the best way is to attach all source from the JBoss AS source distribution in an easy way

        • 46. Re: Adding JBoss AS source to a project
          snjeza

          So as I understand it, the path taken by the WTP adapter is strictly spoken 'wrong', although it does seem to do the trick. The JBoss AS tools adapter does its thing in a better way, but happens to be broken in CR1 and this will be fixed in CR2 (and is already fixed in the nightly).

           

          It would be interesting to learn about the approach taken by the JBoss AS tools adapter

           


          The wtp generic adapter  had a bug related to the source lookup that we fixed within https://jira.jboss.org/jira/browse/JBIDE-2215. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=233110. Since the WTP bug is fixed in the meantime, we use wtp's source lookup again. See https://jira.jboss.org/jira/browse/JBIDE-5524.

          Currently, the JBoss AS (CR2) and WTP adapters use the same source lookup.

          • 47. Re: Adding JBoss AS source to a project
            henk53

            snjeza wrote:


            Currently, the JBoss AS (CR2) and WTP adapters use the same source lookup.

             

            I see, so does that mean that JBoss AS CR2 will also add the project's java source folders and the JBoss AS jars to the source lookup in the launch configuration? What I mean is, will it then look just like this screen shot taken from the WTP adapter's launch configuration after a deployment has been added:

             

            http://community.jboss.org/servlet/JiveServlet/showImage/2-523780-1967/jbossas-wtp.png

            • 48. Re: Adding JBoss AS source to a project
              dgolovin
              Yes, they are exactly the same now in nightly CR2 version.
              • 49. Re: Adding JBoss AS source to a project
                maxandersen

                max.andersen@jboss.com wrote:

                 

                sorry, just saw it is actually adding on source lookup not classpath - but again, these shouldn't really be needed to be added ....

                 

                So as I understand it, the path taken by the WTP adapter is strictly spoken 'wrong', although it does seem to do the trick. The JBoss AS tools adapter does its thing in a better way, but happens to be broken in CR1 and this will be fixed in CR2 (and is already fixed in the nightly).

                 

                It would be interesting to learn about the approach taken by the JBoss AS tools adapter.

                 

                Anyway, with this intermediate problem out of the way we can go back on concentrating on what the best way is to attach all source from the JBoss AS source distribution in an easy way

                Sorry for brining confusion - the newest WTP adapter does it the *right* way by having a good default source lookup delegate (I just didnt realize that this would actually show up in the launch configuration under the "Default").

                 

                As Snjezana said, our AS adapter had workarounds for bugs that were  in the old  WTP Adapter which now has been fixed so the new AS adapter matches the WTP adapter in behavior for this specific thing.

                 

                And yes, adding AS source distribution an easier way would be good - but for that to work we need some kind of co-release with AS that has the src available so if you point to such a thing we could attach it as source automatically. My understanding was that such a thing doesn't yet exist...do you know of one ?

                 

                My best bet is that AS 6 should have maven artifacts for all its .jars so this should be much easier done for that.

                 

                That of course leaves the question what to do for AS 4 and AS 5

                • 50. Re: Adding JBoss AS source to a project
                  henk53

                  max.andersen@jboss.com wrote:

                  Sorry for brining confusion - the newest WTP adapter does it the *right* way by having a good default source lookup delegate (I just didnt realize that this would actually show up in the launch configuration under the "Default").

                   

                  As Snjezana said, our AS adapter had workarounds for bugs that were  in the old  WTP Adapter which now has been fixed so the new AS adapter matches the WTP adapter in behavior for this specific thing.

                   

                  Thanks a lot for this explanation. It's much clearer to me now.

                   

                  max.andersen@jboss.com wrote:

                   

                  And yes, adding AS source distribution an easier way would be good - but for that to work we need some kind of co-release with AS that has the src available so if you point to such a thing we could attach it as source automatically. My understanding was that such a thing doesn't yet exist...do you know of one ?

                   

                  Personally I of course do not know of any specific way to attach all of the JBoss AS source automatically, otherwise I wouldn't have started this thread. The one thing I can think of is a way to extract all jar files found in the source distribution recursively to one location. Delete all .class files. Then use some rules of thumb to copy the source files that are distributed as .java file to this same location (e.g. find a .java file, and trace back its root directory to anything starting with .com, .org, etc.).

                   

                  After having done that, jar anything again so you have one huge jboss51-src.jar. Write a small Eclipse plug-in that iterates over all jar files exposed by the JBoss AS runtime and attach this jboss51-src.jar to it.

                   

                  It's rather hacky, but maybe this would work.

                   

                  max.andersen@jboss.com wrote:

                   

                  My best bet is that AS 6 should have maven artifacts for all its .jars so this should be much easier done for that.

                   

                  That of course leaves the question what to do for AS 4 and AS 5

                   

                  Just having the ability for AS 6 would already be a major step forward and would be much welcomed! Indeed, AS 4 and AS 5 users would still be in the dark, but if the trade-of is between having no automatic source attachment at all or having it only for AS 6, then the latter would definitely be the way to go IMHO.

                  • 51. Re: Adding JBoss AS source to a project
                    henk53

                    Some other I noticed regarding the JBoss AS tools adapter, is that it doesn't seem to be putting jstl.jar on the build-path. This one is located in server/default/deploy/jbossweb.sar. Other libraries there, like the ones in jsf-libs are exposed, but for some reason jstl.jar is missing.

                     

                    Because it's missing, it's also impossible to do a source attachment for it in Eclipse.

                    • 52. Re: Adding JBoss AS source to a project
                      maxandersen

                      create a jire for it

                       

                      The set of *.jars added automatically is based on user input - optimally we would not everything in there since it really only should be the jars you actually need for your project....coming back again that we should really be delegating the classpath resolution to something else than a fixed list of dependencies (such as the current AS (actually any) wtp server adapter do)

                      • 53. Re: Adding JBoss AS source to a project
                        atijms

                        max.andersen@jboss.com wrote:

                        The set of *.jars added automatically is based on user input

                         

                        Do you mean with "user input" that you ask the community about which jars they would like to see added to the list of jars automatically put on the classpath by the server adapter? Or do you mean the user has to provide some input (e.g. clicking, modifying some config file)?

                         

                        JSTL.jar is indeed a notoriously missing one. It's a part of the Java EE spec, so it seems this one should definitely be present. I assume not much projects have Java dependencies on this one, but the thing is that it also contains the JSTL *.tld files. Currently every JSP page in one of our projects that uses the JSTL tags is now flagged as containing an error.

                        • 54. Re: Adding JBoss AS source to a project
                          maxandersen

                          atijms wrote:

                           

                          max.andersen@jboss.com wrote:

                          The set of *.jars added automatically is based on user input

                           

                          Do you mean with "user input" that you ask the community about which jars they would like to see added to the list of jars automatically put on the classpath by the server adapter? Or do you mean the user has to provide some input (e.g. clicking, modifying some config file)?


                          I was talking about community input since we unfortunately do not have a server adapter that allows configurable classpath setup ( I got it on my wishlist though )

                           

                          JSTL.jar is indeed a notoriously missing one. It's a part of the Java EE spec, so it seems this one should definitely be present. I assume not much projects have Java dependencies on this one, but the thing is that it also contains the JSTL *.tld files. Currently every JSP page in one of our projects that uses the JSTL tags is now flagged as containing an error.

                          Create a jira with the details - then it will be picked up.

                          • 55. Re: Adding JBoss AS source to a project
                            henk53

                            max.andersen@jboss.com wrote:

                            I was talking about community input since we unfortunately do not have a server adapter that allows configurable classpath setup ( I got it on my wishlist though )

                             

                            Sounds interesting, and this would certainly be helpful to many. Especially handy would be the possibility to configure the classpath for specific kind of projects. Just from the top of my head I can think of at least 3 different kind of classpath setups:

                             

                            1. Standard Java EE - Everything from the Java EE spec, without a singe JBoss AS or other third party lib exposed.
                            2. JBoss AS ALL - Just everything that JBoss AS offers for a configuration. JBoss libs, the packaged Quartz, everything
                            3. JBoss AS, per project type - Don't put the client libs in the classpath for a server project and the other way around.

                             

                            max.andersen@jboss.com wrote:

                            Create a jira with the details - then it will be picked up.

                             

                            I'll create a Jira for it I was waiting for some more confirmation from other posters on this thread that it really is a bug. JBoss AS tools is still rather new for me, so it's hard for me to determine whether something is a bug or an error on my side.

                            • 56. Re: Adding JBoss AS source to a project
                              henk53

                              henk53 wrote:

                               

                              I'll create a Jira for it I was waiting for some more confirmation from other posters on this thread that it really is a bug. JBoss AS tools is still rather new for me, so it's hard for me to determine whether something is a bug or an error on my side.

                               

                              Sorry for the delay. I created the jira issue here: https://jira.jboss.org/jira/browse/JBIDE-5836

                              • 57. Re: Adding JBoss AS source to a project
                                henk53

                                Max Andersen wrote:

                                 

                                And yes, adding AS source distribution an easier way would be good - but for that to work we need some kind of co-release with AS that has the src available so if you point to such a thing we could attach it as source automatically. My understanding was that such a thing doesn't yet exist...do you know of one ?

                                 

                                My best bet is that AS 6 should have maven artifacts for all its .jars so this should be much easier done for that.

                                 

                                That of course leaves the question what to do for AS 4 and AS 5

                                 

                                Just curious, has any progress been made on this issue?

                                 

                                I had manually hunted down a lot of source attachments in the JBoss AS source directory (some are quite hard to find, like servlet-api.jar has its sources in jboss-web-sources.jar or something like that). However, when I moved to a new installation, I had to re-attach all those dozen of source code jars again. I'm starting to remember some now, so the third or fourth time along it gets easier, but it's still a rather unpleasant task to do.

                                 

                                Thank you again for taking the trouble to look into this.

                                • 58. Re: Adding JBoss AS source to a project
                                  maxandersen

                                  Not yet - on my TODO list.

                                   

                                  But as said earlier (I think ) this issue is more a runtime build issue than tooling.

                                   

                                  Tooling can push for it but eventually it is the runtime guys that needs convincing to make it happen.

                                  • 59. Re: Adding JBoss AS source to a project
                                    henk53

                                    Just wondering, have the runtime guys ever been convinced of this?

                                     

                                    In other words, with JBoss AS 6 and JBoss Tools 3.2, can I attach all source with one click now?

                                     

                                    I'm now moving to Eclipse 3.6, which is of course a brand new install and it's really painful to attach all the literally hundreds of jars again that I attached to my old setup over the last year. Since quite often I have to attach the same jar twice (both for the editor and for the debugger), this really adds up.

                                     

                                    If I upgrade my installation at work I have to attach the same couple of hundred jars there as well. This is really painful. I'm not sure how others cope with this, or maybe I'm the only nut who wants to have every last bit of source there is available in Eclipse