1 2 3 4 5 Previous Next 69 Replies Latest reply on Jul 7, 2011 11:59 AM by arjan tijms Go to original post
      • 30. Re: Adding JBoss AS source to a project
        Denis Golovin Master

        I believe it is a bug, could you try to create Server using runtime definition from JBoss category ( Not JBoss Community). Then eploy your project into this server, start it in debug mode and try debug your app again. I guess it should work this time because WTP JBoss AS Server Adapter alters Server Launch Configuration after you deploy/undeploy projects to server.

         

        You can see it by make a double click on server Item in Servers View and select "Open Launch Configuration" link to open configuration dialog. Then select source tab and expand Default item in tree.

         

        All deployed projects and libs form them are here as siblings for WTP JBoss AS Server Adapter and there is nothing related to deployed projects for JBossTools JBoss AS Server adapter.

        • 31. Re: Adding JBoss AS source to a project
          Denis Golovin Master

          Here are screen shots for JBossTools JBoss AS Adapter

          jbossas-community.png

          and for WTP JBoss AS Adapter
          jbossas-wtp.png

           

          I have test project deployed on both of them and you can see the difference.

          • 32. Re: Adding JBoss AS source to a project
            henk de boer Master

            dgolovin wrote:

             

            I believe it is a bug, could you try to create Server using runtime definition from JBoss category ( Not JBoss Community). Then eploy your project into this server, start it in debug mode and try debug your app again. I guess it should work this time

             

            I did exactly that. Just to be sure, I started in a new workspace and used a new JBoss AS 5.1 instance. I added the JBoss -> JBoss v5.0 runtime (the ones that comes bundled with WTP) and deployed my simple hello world test app to it. I added a break-point in a .java file that's within the project and when it hit, I could see the source of this class as expected.

             

            I then removed the project from the server and also manually removed the .ear file from the JBoss AS deploy directory (the standard runtime doesn't do that unfortunately).

             

            Then I added the JBoss Community -> JBoss AS 5.1 runtime (the one from JBoss AS tools) and again deployed my simple hello world test app to it. Added the break point again, but when I hit I didn't get to see the source this time. Just the default white editor with the red "Source not found." and the single button "Edit Source Lookup Path...".

             

            As you suggested, I inspected the lauch configuration of both servers. When I have nothing deployed to the JBoss -> Jboss v5.0 runtime, the source tab shows an entry called "Default", which contains only the base JDK jars. However, as soon as I add (publish/deploy) my project to the JBoss v5.0 runtime, the "Default" entry in the source tab contains all JBoss jars and folders for both the web module and the ejb module of my test project.

             

            The JBoss Community -> JBoss AS 5.1 runtime however in both cases (nothing deployed to it and my test project deployed to it) shows the same standard JDK classes under "Default" and nothing else.

            • 33. Re: Adding JBoss AS source to a project
              Denis Golovin Master

              Thank you, that you found time to test it and described the problem in details

               

              I've created issue https://jira.jboss.org/jira/browse/JBIDE-5790 to track this problem. I added JBossAS 2.1.0.v201001140901N-H132-CR2 version in environment description because I forget to ask what your version is and used version I used to replicate the issue.

              • 34. Re: Adding JBoss AS source to a project
                Denis Golovin Master

                I forget the rule to verify if problem can be reproduced on most recent available version. So I updated JBoss Tools to last Nightly version and sure I couldn't replicate it on JBossAS Tools Version: 2.1.0.v201002012242N-H194-CR2. I also couldn't find a commit that made the trick. Waiting for response from Rob in JIRA.

                 

                Could anyone try it on last nightly build to confirm it works now?

                • 35. Re: Adding JBoss AS source to a project
                  Max Rydahl Andersen Master
                  Wanted to comment on this one:

                  I then removed the project from the server and also manually removed the .ear file from the JBoss AS deploy directory (the standard runtime doesn't do that unfortunately).

                  You need to use explicit undeploy for that.

                   

                  Removing a project just indicates you don't want any additional deployment, this ensures we don't by accident delete something you might have deployed to some test or near-prod environment just because you stopped developing on it.

                  • 36. Re: Adding JBoss AS source to a project
                    Max Rydahl Andersen Master

                    dgolovin wrote:

                     

                    henk53 wrote:

                     

                    max.andersen@jboss.com wrote:

                     

                    If your project is setup to locate sources correctly then any debug launches that refer to that project should also work - if not then please report a bug.

                     

                    Using the debug view I then add both the EJB and web projects to the source lookup and then it can find the source of the .java file that is directly in the project.

                    It looks like lunch configuration for server should be altered after project deployed/undployed to/from the server. WTP JBoss AS adapter does that but JBossTools JBossAS adapter doesn't.

                    hmm - I would be surprised if the wtp adapters does that...it sounds wrong.

                    • 37. Re: Adding JBoss AS source to a project
                      henk de boer Master

                      max.andersen@jboss.com wrote:

                      dgolovin wrote:

                       

                      It looks like launch configuration for server should be altered after project deployed/undeployed to/from the server. WTP JBoss AS adapter does that but JBossTools JBossAS adapter doesn't.

                      hmm - I would be surprised if the wtp adapters does that...it sounds wrong.

                       

                      I'm of course not 100% sure whether that is what is technically happening under the hood, but the UI surely does suggest this is what happening. The screenshots posted by Denis Golovin show that and I observed the exact same thing as I described earlier. I haven't yet tested with the latest nightly build of Jboss Tools, I used 3.1 CR1.

                       

                      When my project is not deployed to the wtp adapter, the launch config contains only the JDK jars. With the project deployed, my project folders are there as well as all the Jboss jars. At any length, whatever is happening, the wtp adapter gives me the source of my own files in the debugger while the jboss tools adapter doesn't.

                       

                      I also vaguely remember that the MyEclipse deployer does a similar thing; adding the project's libs and folders to the launch configuration.

                      • 38. Re: Adding JBoss AS source to a project
                        Denis Golovin Master
                        It should be an option in Delete confirmation dialog like Delete Project has a checkbox "Delete project contents on disk (cannot be undone)"
                        • 39. Re: Adding JBoss AS source to a project
                          arjan tijms Novice

                          max.andersen@jboss.com wrote:

                           

                          hmm - I would be surprised if the wtp adapters does that...it sounds wrong.

                           

                          We're seeing the exact same problem here. The WTP adapter automatically adds the source of our project and the JBoss AS jars to the launch configuration, while the JBoss AS tools adapter doesn't. The result is that during debugging, the debugger can't find a single source file when using the JBoss AS tools adapter. There is no such problem when using the WTP adapter.

                           

                          If what the WTP adapter does is wrong in your opinion, then do you mean that JBoss AS tools users are supposed to attach all source code (including that of their own project) twice, or is their some other mechanism via which it should work with JBoss AS tools then?

                          • 40. Re: Adding JBoss AS source to a project
                            Max Rydahl Andersen Master

                            My understanding is that users attach source to their project classpath (like everything else) and then the actual Debug Source lookup has a delegate that not only looks on the classpath of the Server runtime classpath (which btw. should *not* include all jars of users projects since that will mess up classloading!)  but also look on the deployed projects classpath.

                            • 41. Re: Adding JBoss AS source to a project
                              Max Rydahl Andersen Master
                              sorry, just saw it is actually adding on source lookup not classpath - but again, these shouldn't really be needed to be added ....
                              • 42. Re: Adding JBoss AS source to a project
                                Denis Golovin Master
                                It actually should, because java also has the same at Source tab in launch configuration. It contains Default item which children are project(s), project's jars and JDK jars. If you remove that Default item eclipse cannot find sources during debugging session.
                                • 43. Re: Adding JBoss AS source to a project
                                  Max Rydahl Andersen Master

                                  Yes, I were mixing up source and classpath my bad.

                                   

                                  Talked with Snjezana on this and she says JBIDE-5524 fixes it, that means it were an issue in CR1 and should be fixed in CR2.

                                   

                                  So use the nightly build to pick up these.

                                  • 44. Re: Adding JBoss AS source to a project
                                    Denis Golovin Master

                                    I can confirm this, I switched to last nightly and it works for me. I linked https://jira.jboss.org/jira/browse/JBIDE-5790 to https://jira.jboss.org/jira/browse/JBIDE-5524 as duplicate an resolved JBIDE-5790.