14 Replies Latest reply on Apr 3, 2008 11:39 AM by peterj

    Can't build using ant

    leonidmir

      Hi all,
      I am new to Jboss.
      I am trying to build Jboss 5 beta 4 using ant.
      I followed the installation documentation but still getting the following errors after running ant from the build dir:


      compile-classes:
      [javac] Compiling 137 source files to C:\jboss-5.0.0.Beta4-src\j2se\output\classes
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\loading\support\Trivial.java:27: cannot find symbol
      symbol: class TrivialMBean
      public class Trivial implements TrivialMBean
      ^
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\loading\support\Trivial2.java:27: cannot find symbol
      symbol: class Trivial2MBean
      public class Trivial2 implements Trivial2MBean
      ^
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\metadata\support\Trivial.java:24: cannot find symbol
      symbol: class TrivialMBean
      public class Trivial implements TrivialMBean
      ^
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:48: package org.jboss.test.jmx.compliance.monitor.support does not exist
      import org.jboss.test.jmx.compliance.monitor.support.CounterSupport;
      ^
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:49: package org.jboss.test.jmx.compliance.monitor.support does not exist
      import org.jboss.test.jmx.compliance.monitor.support.GaugeSupport;
      ^
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:50: package org.jboss.test.jmx.compliance.monitor.support does not exist
      import org.jboss.test.jmx.compliance.monitor.support.MonitorSupport;
      ^
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:51: package org.jboss.test.jmx.compliance.monitor.support does not exist
      import org.jboss.test.jmx.compliance.monitor.support.StringSupport;
      ^
      C:\jboss-5.0.0.Beta4-src\j2se\src\tests\org\jboss\test\jmx\compliance\monitor\MonitorTestCase.java:89: cannot find symbol
      symbol : class MonitorSupport
      location: class org.jboss.test.jmx.compliance.monitor.MonitorTestCase
      MonitorSupport monitored;
      .
      .
      .
      .
      .

      Note: Some input files use unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.
      100 errors
      12 warnings

      BUILD FAILED

      C:\jboss-5.0.0.Beta4-src\j2se\build.xml:143: Compile failed; see the compiler error output for details.
      at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:999)
      at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:820)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:357)
      at org.apache.tools.ant.Target.performTasks(Target.java:385)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      at org.jboss.tools.buildmagic.task.CallTarget.execute(CallTarget.java:141)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:357)
      at org.apache.tools.ant.Target.performTasks(Target.java:385)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      at org.jboss.tools.buildmagic.task.Ant.execute(Ant.java:261)
      at org.jboss.tools.buildmagic.task.module.ExecuteModules$1.run(ExecuteModules.java:361)
      at org.jboss.tools.buildmagic.task.module.ExecuteModules.executeModule(ExecuteModules.java:376)
      at org.jboss.tools.buildmagic.task.module.ExecuteModules.execute(ExecuteModules.java:241)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:357)
      at org.apache.tools.ant.Target.performTasks(Target.java:385)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      at org.apache.tools.ant.Main.runBuild(Main.java:698)
      at org.apache.tools.ant.Main.startAnt(Main.java:199)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


      Someone familiar with that error?

      Regards,
      Leonid M.


        • 1. Re: Can't build using ant

          those are all classpath issues. Resolve those (both linking to your own and JBoss files and things should start to look brighter.

          • 2. Re: Can't build using ant
            leonidmir

            Hi,
            thx.
            Can you tell me please the correct class path entries?
            jboss dir: C:\jboss-5.0.0.Beta4-src
            jdk dir: C:\Program Files\Java\jdk1.6.0_05
            ant dir: C:\apache-ant-1.7.0

            Regards,
            Leonid M.

            • 3. Re: Can't build using ant
              peterj

              Why are you using Ant? The source comes with its own version of Ant that should be used for the build.

              The correct way to build JBossAS is to cd to the build directory and run the build.bat or build.sh script. I have successfully built 5.0.0.Beta4 using both JDK 5 and 6. The build also sets all the necessary classpaths.

              • 4. Re: Can't build using ant
                leonidmir

                Thank you all for helping.
                Firstly it is written in the documentation that I should download and use the downloaded ant version:
                http://labs.jboss.com/file-access/default/members/jbossas/freezone/docs/Installation_Guide/beta500/html-single/index.html

                Secondly after running the batch file from the build directory (in cmd) I get the SAME errors.
                Maybe something else is wrong with my configuration? But shouldn't the build.bat set all the variables needed?

                Regards,
                Leonid M.

                • 5. Re: Can't build using ant
                  peterj

                  Hmm, looks like the new documentation is making things harder than what they need to be. Oh well.

                  And you are right, JBossAS 5.0.0.Beta4 source download will not compile. Looks like the source download was not packaged correctly.

                  I looked back at what I did and realized that I did not download the source bundle and compile that. Instead, I extracted the source files from the JBoss_5_0_0_Beta4 tag in Subversion and compiled that (with JDK 5 and JDK 6). I just now did that again and it compiles, and runs, just fine.

                  You can get the source using:

                  svn co http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_0_0_Beta4/

                  • 6. Re: Can't build using ant
                    leonidmir

                    Thx.
                    Couldn't find the files in the svn path you gave (The path is incorrect), honestly I got lost there :).
                    Can you please specify a correct path to these files ?
                    Also I tried to compile in the same way (using the build.bat file) jBoss5_beta4 and got the same errors....
                    Very strange.
                    Someone ?

                    • 7. Re: Can't build using ant
                      peterj

                      Do you have Subversion installed? Is svn in the PATH? Click this link: http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_0_0_Beta4/, what do you see? You should see a list of links very similar to the directories in the source download.

                      The beta4 bundled source will not compile.

                      Might I ask why you are trying to compile the source and not simply working with the binary download?

                      • 8. Re: Can't build using ant
                        leonidmir

                        Thx, I will try it tomorrow.
                        I want to learn the code because I will contribute to the project in a future. Compiling is a first stage :)

                        • 9. Re: Can't build using ant
                          peterj

                          And the answers to my other questions?

                          • 10. Re: Can't build using ant
                            leonidmir

                            Hi,
                            If I click the link I see all the directories tree, similar to the downloaded pack.
                            I use TortoiseSVN to export the files from the repository into local dir.
                            Unfortunately I get the following error (At the same stage, near 10MB):
                            REPORT request failed on 'repos/jbossas/!svn/vss/default'
                            REPORT of '/repos/jbossas/!svn/vcc/default': Could not read response body: connection was closed by server.

                            huh? :)

                            • 11. Re: Can't build using ant
                              peterj

                              Don't use TortoiseSVN to do the download, I have experienced similar problems with using it. Instead, use the command line I provided earlier, I have never had problems doing it that way.

                              • 12. Re: Can't build using ant
                                leonidmir

                                Hi,
                                I have to admit it is very funny.
                                I downloaded and installed the subversion command line client.
                                I run it this way:
                                svn co http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_0_0_Beta4/

                                And again got this message (after it downloaded 74MB of content):

                                svn: REPORT request failed on '/repos/jbossas/!svn/vcc/default'
                                svn: REPORT of '/repos/jbossas/!svn/vcc/default': Could not read response body:
                                connection was closed by server (http://anonsvn.jboss.org)

                                Wow, it`s the longest compilation I tried to perform ever!

                                • 13. Re: Can't build using ant
                                  leonidmir

                                  YES!
                                  I downloaded the source finally, apparently you just need to continue trying and svn knows where it was aborted.

                                  Now I am running the build.bat. seems ok.
                                  If there will be any error's in compilation should I post it here or open a new discussion ?

                                  btw Thank you Peter for all the help.

                                  Regards.

                                  • 14. Re: Can't build using ant
                                    peterj

                                    Glad you got it downloaded. Yes, svn is pretty good about picking up where it left off. Since you started this post on a compilation problem, if you run into other compilation issues, post them here. But if you run into a runtime issue, it would be best to start a new post.