4 Replies Latest reply on Apr 16, 2009 7:26 PM by Neil McFarlane

    Running JBoss 5 within Eclipse with a different set of ports

    Neil McFarlane Novice

      Hello.

      I can't use the default set of ports with JBoss and would like to run it with one of the alternative sets.

      I can do this on "stand-alone" JBoss by creating a new .bat file with the contents "run.bat -Djboss.service.binding.set=ports-01", but I'm not sure how do to the equivalent when running JBoss from within Eclipse. Is there a way to supply parameters?

        • 1. Re: Running JBoss 5 within Eclipse with a different set of p
          Neil McFarlane Novice

          I should specify, I'm running Eclipse 3.4.2 w/ JBoss Tools. The JBoss version is 5.0.1.GA.

          • 2. Re: Running JBoss 5 within Eclipse with a different set of p
            Peter Johnson Master

            I thought it should be as easy as specifying a property somewhere, but it appears that no such place exists. It even looks like Eclipse runs JBoss AS via a java command that it generates, rather than relying on the run.bat file, so it is not like you could edit the run file.

            Found it! Look in workspace\.metadata\.plugins\org.eclipse.debug.core\.launches\XXX.launch, where XXX is the name you gave to the server. Edit this entry:

            <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--configuration=admin -b localhost"/>
            


            Perhaps you should ask about this in the JBoss Tools (Users) forum; being able to provide additional command line arguments sounds like a worthwhile new feature request to me.

            • 3. Re: Running JBoss 5 within Eclipse with a different set of p
              Peter Johnson Master

              Caveats:

              You have to change the XXX.launch file while Eclipse is not running - apparently the file is not reread when you start the server, and also the file is overwritten when you stop Eclipse. So stop Eclipse first, then change the file.

              Eclipse can no longer tell if the JBoss AS has started because Eclipse is looking at JNDI port 1099, which is not used by the ports-01 port configuration. I thought I saw a post about this earlier.

              • 4. Re: Running JBoss 5 within Eclipse with a different set of p
                Neil McFarlane Novice

                Thanks Peter. Using what you said I think I found the solution.

                Instead of editing the launch configuration though, you can actually just double-click on the server from either the "Servers" or "JBoss Server View" views to open up the "Overview" window.

                From there, select "Open launch configuration" and add the ports-01 parameter to the "Arguments" tab. After that, you can modify the "Server Properties" on the main "Overview" window you have to adjust the port to "8180" and the JNDI Port to "1199" (I'd guess more if you use ports-02 etc.).

                While my server starts up fine (and is recognized as starting), I find that it doesn't shutdown properly. At first I was getting a whole heap of errors (it was still looking for 1099), but now I don't get any messages at all. It does shutdown and restart without a hitch, but it's still a little worrisome.