Problem compiling stendhal 0.66

  • v00d00

    v00d00 - 2008-02-04

    Hi guys!

    First of all I want to thank you for the great game and engine. However I couldn't manage to compile it on my Fedora 8. I have JDK 7 (1.7.0). Here are the ERRORs I'm getting:

        [mkdir] Created dir: /root/build/stendhal-0.66/build/build_server
         [copy] Copying 1 file to /root/build/stendhal-0.66/build/build_server/data/conf
         [copy] Copying 1 file to /root/build/stendhal-0.66/build/build_server/games/stendhal/server
         [copy] Copying 1 file to /root/build/stendhal-0.66/build/build_server/games/stendhal/server
        [javac] Compiling 397 source files to /root/build/stendhal-0.66/build/build_server
        [javac] ----------
        [javac] 1. WARNING in /root/build/stendhal-0.66/src/games/stendhal/server/core/rp/guilds/ (at line 45)
        [javac]     private String playerName;
        [javac]                    ^^^^^^^^^^
        [javac] The field GuildMember.playerName is never read locally
        [javac] ----------
        [javac] ----------
        [javac] 2. WARNING in /root/build/stendhal-0.66/src/games/stendhal/server/core/scripting/ (at line 60)
        [javac]     zone = StendhalRPWorld.get().addArea(name, content);
        [javac]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [javac] The method addArea(String, String) from the type StendhalRPWorld is deprecated
        [javac] ----------
        [javac] ----------
        [javac] 3. WARNING in /root/build/stendhal-0.66/src/games/stendhal/server/entity/npc/
        [javac]  (at line 230)
        [javac]     if (Grammar.isPreposition(nextWord) && !nextWord.equals("of")) {
        [javac]         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [javac] The method isPreposition(String) from the type Grammar is deprecated
        [javac] ----------
        [javac] 3 problems (3 warnings)
          [jar] Building jar: /root/build/stendhal-0.66/build/lib/stendhal-server-0.66.jar
        [mkdir] Created dir: /root/build/stendhal-0.66/build/build_server_maps
        [javac] Compiling 239 source files to /root/build/stendhal-0.66/build/build_server_maps
        [javac] ----------
        [javac] 1. ERROR in /root/build/stendhal-0.66/src/games/stendhal/server/entity/npc/action/ (at line 3)
        [javac]     import org.apache.commons.lang.builder.EqualsBuilder;
        [javac]            ^^^^^^^^^^^^^^^^^^^^^^^
        [javac] The import org.apache.commons.lang cannot be resolved
        [javac] ----------
        [javac] 2. ERROR in /root/build/stendhal-0.66/src/games/stendhal/server/entity/npc/action/TeleportAction.jav
        [javac] a (at line 4)
        [javac]     import org.apache.commons.lang.builder.HashCodeBuilder;
        [javac]            ^^^^^^^^^^^^^^^^^^^^^^^
        [javac] The import org.apache.commons.lang cannot be resolved
        [javac] ----------
        [javac] 3. ERROR in /root/build/stendhal-0.66/src/games/stendhal/server/entity/npc/action/ (at line 57)
        [javac]     return HashCodeBuilder.reflectionHashCode(this);
        [javac]            ^^^^^^^^^^^^^^^
        [javac] HashCodeBuilder cannot be resolved
        [javac] ----------
        [javac] 4. ERROR in /root/build/stendhal-0.66/src/games/stendhal/server/entity/npc/action/ (at line 62)
        [javac]     return EqualsBuilder.reflectionEquals(this, obj, false,
        [javac]            ^^^^^^^^^^^^^
        [javac] EqualsBuilder cannot be resolved
        [javac] ----------
        [javac] ----------
        [javac] 5. ERROR in /root/build/stendhal-0.66/src/games/stendhal/server/entity/npc/condition/ (at line 7)
        [javac]     import org.apache.commons.lang.builder.EqualsBuilder;
        [javac]            ^^^^^^^^^^^^^^^^^^^^^^^
        [javac] The import org.apache.commons.lang cannot be resolved
        [javac] ----------

    It's only excerpt of the whole log (there are 115 errors and 3 warnings), but I believe all these errors are related. Probably the issue is org.apache.commons.lang library but unfortunately I'm not Java programmer so I'm not sure.

    Any help would be much appreciated!


    • oslsachem

      oslsachem - 2008-02-05

      You are probably using an IDE (NetBeans, Eclipse...), as opposed to the plain command-line JDK, and this IDE can't find the jar named commons-lang.jar because:
      - You haven't specified where the IDE can find the jar in the filesystem (classpath, your project's IDE configuration isn't right: )
      - the commons-lang.jar file simply doesn't exist there where the IDE expects the jar to be (the jar has to be downloaded and put in the right directory: )

      I hope this can help. Good luck :)

      • v00d00

        v00d00 - 2008-02-06


        Thanks for suggestion. However I'm not using an IDE, I'm using Apache Ant for building. I tried to download older versions of common-lang.jar but it didn't help. Libs path is fine; I've checked and to make sure tried to comment out other libs and got a lot more errors. I'm not sure if there is some extra settings of Apache Ant of JDK paths or something else which could resolve this issue.

        Please advise.


        • Katie Russell

          Katie Russell - 2008-02-06

          you call it common-lang.jar in your last comment - was this a typo? The name should be commons-lang.jar (with an s after commons) and it should be in your libs folder.

          • v00d00

            v00d00 - 2008-02-06

            Yes, it was typo. It's commons-lang.jar.

            Any ideas?


            • Miguel Angel Blanch Lardin

              Are you using released source code or CVS?

              CVS should work out of the box, while on released source code AFAIK we don't add compiled libraries, so perhaps the problem can be caused by an invalid/corrupt/outofdate/toomuchupdate jar?

              Anyway, as kymara points the problem is related to commons-lang library.
              Let me know what do you use so we can fix the problem as soon as possible.

              • v00d00

                v00d00 - 2008-02-06

                Hi Miguel, Guys,

                Thanks for advice. I've used released source code not CVS. I'll try with CVS.

                I made a typo while writing post on the forum, it's actually commons-lang.jar lib so that's not the problem. Regarding possible corruption of commons-lang.jar I doubt it's the case because I've tried with original Apache library which btw. have same size as the one you're distributing via sourceforge. Moreover I tried with version commons-lang.jar 2.0 and it didn't work as well. I didn't tried with version 1.0 because I believe it's too old.

                I'm using Fedora Core 8, Apache Ant 1.7, JDK 6 update 4. I've installed Ant optional packages.

                My building process is following:

                1. downloaded stendhal released source code 0.66
                2. unpacked stendhal tar.gz into build dir
                3. created libs dir
                4. downloaded all .jar packs required (and published on sourceforge) into libs dir
                5. from the stendhal dir started ant (before that I issued ant clean command to remove possible files from prev. build)

                As you can see from the log above ([jar] Building jar: /root/build/stendhal-0.66/build/lib/stendhal-server-0.66.jar ) stendhal server has been built (with few warnings probably because new JDK version I'm using) but ant filed during the compilation of server-maps source code.

                Thanks for comments.

                Waiting for your further instructions.

                • oslsachem

                  oslsachem - 2008-02-06

                  You could try doing an " ant clean " before building again.

                  • oslsachem

                    oslsachem - 2008-02-06

                    "from the stendhal dir started ant (before that I issued ant clean command to remove possible files from prev. build)" -> ok, I'm run out of ideas :)

                • Miguel Angel Blanch Lardin

                  Ok, thanks.

                  I will give a try myself this afternoon and post here the results.

                  • v00d00

                    v00d00 - 2008-02-08


                    I've set up NetBeans 6.0 IDE. Then I checkout the latest source from CVS and built everything with no errors.

                    However I have few questions and issues.

                    First thing that bother me, everything is built into single JAR file, stendhal.jar. I would like to have it separated like in your distribution version: stendhal-server.jar, stendhal-maps.jar, stendhal-xmlconf.jar. Should I create separate projects from each of these sections and how to do that?

                    Anyway I tried to start server using batch file:

                    export LOCALCLASSPATH=.:stendhal.jar:libs/marauroa-2.4.jar:libs/jython.jar:libs/mysql-connector.jar:libs/log4j.jar:simple.jar:groovy.jar:commons-lang.jar
                    java -Xmx128m -cp "${LOCALCLASSPATH}" marauroa.server.marauroad -c server.ini

                    I'm getting a lot of errors like this:
                    ERROR [marauroad ] StendhalRPWorld          (287 ) - Error on Init the server.
           Cannot find resource: /data/conf/zones.xml
                            at games.stendhal.server.core.config.GroupsXMLLoader.load(
                            at games.stendhal.server.core.config.ZoneGroupsXMLLoader.load(
                            at games.stendhal.server.core.engine.StendhalRPWorld.onInit(
                            at marauroa.server.marauroad.init(
                    ERROR [marauroad ] QuestsXMLLoader          (101 ) - cannot find resource 'data/conf/quests.xml' in classpath
                    ERROR [marauroad ] QuestsXMLLoader          (66  ) - cannot find resource 'data/conf/quests.xml' in classpath
           cannot find resource 'data/conf/quests.xml' in classpath
                            at games.stendhal.server.core.config.QuestsXMLLoader.load(
                            at games.stendhal.server.core.config.QuestsXMLLoader.get(
                            at games.stendhal.server.core.engine.SingletonRepository.getQuestsXMLLoader(
                            at games.stendhal.server.core.rp.StendhalQuestSystem.init(
                            at games.stendhal.server.core.engine.StendhalRPRuleProcessor.setContext(
                            at marauroa.server.marauroad.init(
                    INFO  [marauroad ] StendhalQuestSystem      (136 ) - Loading Quest: AdosDeathmatch
                    INFO  [marauroad ] StendhalQuestSystem      (136 ) - Loading Quest: AmazonPrincess
                    WARN  [marauroad ] StendhalQuestSystem      (147 ) - Quest(AmazonPrincess) loading failed.
                            at games.stendhal.server.maps.quests.AmazonPrincess.offerQuestStep(
                            at games.stendhal.server.maps.quests.AmazonPrincess.addToWorld(
                            at games.stendhal.server.core.rp.StendhalQuestSystem.loadQuest(
                            at games.stendhal.server.core.rp.StendhalQuestSystem.init(
                            at games.stendhal.server.core.engine.StendhalRPRuleProcessor.setContext(
                            at marauroa.server.marauroad.init(
                    INFO  [marauroad ] StendhalQuestSystem      (136 ) - Loading Quest: ArmorForDagobert
                    WARN  [marauroad ] StendhalQuestSystem      (147 ) - Quest(ArmorForDagobert) loading failed.


                    I guess this might have something with this all-in-one JAR or maybe something else. However server seems to be working after these bunch of errors.
                    But when I try to access the server using fresh compiled client I'm getting this error (on server):
                    WARN  [verManager] Attributes               (196 ) - Message has incorrect protocol version(54) expected (30)
                    WARN  [verManager] NIONetworkServerManager  (191 ) - Invalid version message

                    The pre-compiled client (downloaded from sourceforge) can connect to the server, but the screen is black. I believe it's because maps and quests weren't loaded.

                    Do you have any idea how to resolve these issues?

                    I promise if you help me to sort this out, I'll write a tutorial with complete procedure how to build latest client/server and how to set up everything as a server.


                    • Miguel Angel Blanch Lardin


                      I am right now testing build on released source code.

                      About Netbeans, no idea, we use Eclipse ( btw there is an IRC channel at #arianne ) and it compile code just to class files. In order to get several jars use the ant script.

                      About the error you obtain, you MUST copy the data folder to where the server is being run from. I think that in our wiki ( ) there is a guide to configure and run stendhal using Eclipse, most of the steps should be valid too for Netbeans.

                      Stendhal CVS uses Marauroa CVS that is now protocol version 31 due to a important fix that we had to add, so the released client won't work against CVS.

                      Give a try to copy the data folder.
                      That's should fix all the problems.


                      PS: As soon as I have more info on released source I will post it here.

    • Miguel Angel Blanch Lardin

      Well, definitively there are missing files on the released source code, so if you plan to "play" with the code you would better get CVS. On the other hand, I have been able to compile successfully the released code, just you need to look for the files, copy the jar to and run ant.

      I only have had problems looking for simple http ( simple.jar )

      The rest are simple to find googling them.

      Here is the output:

      Buildfile: build.xml

          [mkdir] Created dir: D:\sandbox\stendhal-0.66\build\lib
      [replaceregexp] The following file is missing: 'D:\sandbox\stendhal-0.66\web\html\stendhal.version'
      [replaceregexp] The following file is missing: 'D:\sandbox\stendhal-0.66\stendhal.jnlp'

      [xmlvalidate] 43 file(s) have been successfully validated.

          [mkdir] Created dir: D:\sandbox\stendhal-0.66\build\build_server
           [copy] Copying 1 file to D:\sandbox\stendhal-0.66\build\build_server\data\conf
           [copy] Copying 1 file to D:\sandbox\stendhal-0.66\build\build_server\games\stendhal\server
           [copy] Copying 1 file to D:\sandbox\stendhal-0.66\build\build_server\games\stendhal\server
          [javac] Compiling 397 source files to D:\sandbox\stendhal-0.66\build\build_server
          [javac] D:\sandbox\stendhal-0.66\src\games\stendhal\server\core\scripting\ warning: [deprecation] add
      Area(java.lang.String,java.lang.String) in games.stendhal.server.core.engine.StendhalRPWorld has been deprecated
          [javac]                     zone = StendhalRPWorld.get().addArea(name, content);
          [javac]                                                   ^
          [javac] D:\sandbox\stendhal-0.66\src\games\stendhal\server\entity\npc\ warning: [deprecation] isPr
      eposition(java.lang.String) in games.stendhal.common.Grammar has been deprecated
          [javac]                     if (Grammar.isPreposition(nextWord) && !nextWord.equals("of")) {
          [javac]                                    ^
          [javac] 2 warnings
            [jar] Building jar: D:\sandbox\stendhal-0.66\build\lib\stendhal-server-0.66.jar
          [mkdir] Created dir: D:\sandbox\stendhal-0.66\build\build_server_maps
          [javac] Compiling 239 source files to D:\sandbox\stendhal-0.66\build\build_server_maps
           [copy] Copying 493 files to D:\sandbox\stendhal-0.66\build\build_server_maps\data\maps
            [jar] Building jar: D:\sandbox\stendhal-0.66\build\lib\stendhal-maps-0.66.jar
          [mkdir] Created dir: D:\sandbox\stendhal-0.66\build\build_server_xmlconf
           [copy] Copying 42 files to D:\sandbox\stendhal-0.66\build\build_server_xmlconf\data\conf
            [jar] Building jar: D:\sandbox\stendhal-0.66\build\lib\stendhal-xmlconf-0.66.jar
          [mkdir] Created dir: D:\sandbox\stendhal-0.66\build\build_server_script
          [javac] Compiling 32 source files to D:\sandbox\stendhal-0.66\build\build_server_script

          [mkdir] Created dir: D:\sandbox\stendhal-0.66\build\build_client
           [copy] Copying 1 file to D:\sandbox\stendhal-0.66\build\build_client\games\stendhal\client\gui
          [javac] Compiling 261 source files to D:\sandbox\stendhal-0.66\build\build_client
          [javac] Compiling 1 source file to D:\sandbox\stendhal-0.66\build\build_client
           [copy] Copying 1 file to D:\sandbox\stendhal-0.66\build\build_client\games\stendhal\client\update
            [jar] Building jar: D:\sandbox\stendhal-0.66\build\lib\stendhal-starter-0.66.jar
            [jar] Building jar: D:\sandbox\stendhal-0.66\build\lib\stendhal-0.66.jar
          [mkdir] Created dir: D:\sandbox\stendhal-0.66\build\build_client_data
           [copy] Copying 1249 files to D:\sandbox\stendhal-0.66\build\build_client_data\data\sprites
           [copy] Copying 36 files to D:\sandbox\stendhal-0.66\build\build_client_data\data\docu
           [copy] Copying 1 file to D:\sandbox\stendhal-0.66\build\build_client_data\layers
           [copy] Copying 909 files to D:\sandbox\stendhal-0.66\build\build_client_data\data\tileset
           [copy] Copying 18 files to D:\sandbox\stendhal-0.66\build\build_client_data\data\gui
           [copy] Copying 1 file to D:\sandbox\stendhal-0.66\build\build_client_data\data\conf
            [jar] Building jar: D:\sandbox\stendhal-0.66\build\lib\stendhal-data-0.66.jar
            [jar] Building jar: D:\sandbox\stendhal-0.66\build\lib\stendhal-sound-data-0.66.jar


      Total time: 1 minute 36 seconds

      And here are the files that I used:

      D:\sandbox\stendhal-0.66>cd libs

      El volumen de la unidad D es DiscoGrande
      El número de serie del volumen es: B02B-8BAE

      Directorio de D:\sandbox\stendhal-0.66\libs

      10/02/2008  17:46    <DIR>          .
      10/02/2008  17:46    <DIR>          ..
      09/02/2007  20:05           245.274 commons-lang-2.3.jar
      01/02/2008  18:53         2.282.731 groovy-1.5.4.jar
      19/07/2007  17:13           161.477 junit-4.4.jar
      07/01/2008  19:44           719.950 jython.jar
      07/01/2008  19:44           199.140 log4j.jar
      07/01/2008  19:44           241.638 marauroa-2.4.jar
      07/01/2008  19:44           446.464 mysql-connector.jar
      17/05/2006  22:34           250.173 simple-3.1.3.jar
      15/07/2006  19:44           261.447 tiled.jar
                     9 archivos      4.808.294 bytes
                     2 dirs  13.269.823.488 bytes libres


      Hope it helps.




Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks