Announcement

Collapse
No announcement yet.

import org.voltdb.ProcInfo yields "package does not exist"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • import org.voltdb.ProcInfo yields "package does not exist"

    I am trying to run some of the example projects included in volt community edition 3.5. When I try to compile them, I keep getting "package does not exist" errors. I know that I need to add these packages to my classpath. Where can I find the requisite libraries and how can I add them to the class path?

  • #2
    Which example project from the community edition are you trying to run?

    Ciao
    Stefano

    Comment


    • #3
      The run.sh scripts provided with the example projects should handle this for you, but if you want to know in general:

      To do the java compilation of stored procedures, prior to building a catalog, you should minimally only need the voltdb/voltdb-3.5.jar file in the CLASSPATH. You can optionally use any of the jar files in the lib directory, but most stored procedures do not need any additional libraries.

      To compile the catalog or start the database, no CLASSPATH is needed because the "voltdb ..." command uses the bin/voltdb script which handles it for you. To see what it uses, you can run `ps -ef | grep voltdb` after you've started the database. That will show the command line used to start the process.

      To compile and run a java client application, you need both the voltdb/voltdb-3.5.jar file and lib/guava-12.0.jar, in addition to any other java libraries you are using in your application.

      If you're using the run.sh scripts and still getting package does not exist errors, double-check that you are using 64-bit Sun JDK 6.

      Comment


      • #4
        I am running the ./run.sh file for the voltcache example located at /usr/share/voltdb/examples/voltcache

        If I open up the run.sh file, I see this javac command which is throwing the errors. If I check the directories referenced in the run.sh command, the .java files exist.

        javac -target 1.6 -source 1.6 -classpath $APPCLASSPATH -d obj \
        src/voltcache/*.java \
        src/voltcache/api/*.java \
        src/voltcache/procedures/*.java

        Here is the output of my $java -version command

        ahandler@ahandler-virtual-machine:/usr/share/voltdb/examples/voltcache$ java -version
        java version "1.6.0_27"
        OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.2)
        OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

        Comment


        • #5
          I reinstalled java 1.6 from Oracle. Here is the output of my java version command

          memsql@memsql-virtual-machine:~/voltdb/examples/voltcache$ java -version
          java version "1.6.0_37"
          Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
          Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

          When I run the run.sh in the voltcache example from the community edition 3.5 I am still getting package does not exist errors.

          Comment


          • #6
            Ok, that version of OpenJDK should be fine.

            One thing I mentioned earlier, about voltdb compile not needing classpath, is not entirely correct. As you see in the run.sh script, it does have the parameter "--classpath obj", which tells it where the pre-compile stored procedure .class files are.

            Are you getting errors from the javac command, or from the "voltdb compile" command? Can you provide the error output?

            Comment


            • #7
              This is the command that gives the errors:

              javac -target 1.6 -source 1.6 -classpath $APPCLASSPATH -d obj \
              src/voltcache/*.java \
              src/voltcache/api/*.java \
              src/voltcache/procedures/*.java

              The errors all look like this:

              src/voltcache/procedures/Replace.java:25: package org.voltdb does not exist
              import org.voltdb.ProcInfo;

              Comment


              • #8
                Thanks. It looks like this is a java problem. The org.voltdb.* packages are provided in the voltdb-*.jar file, so somehow that is not making it into APPCLASSPATH. Can you add 'echo $APPCLASSPATH' to the line above javac, and send that output as well?

                Comment


                • #9
                  Thanks for your help. I added echo $APPCLASSPATH above the javac command in the function srccompile() method in the run.sh file. Here is the output.

                  memsql@memsql-virtual-machine:~/voltdb-voltdb-3.3.0.3/examples/voltcache$ ./run.sh
                  :/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/commons-cli-1.2.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/commons-lang3-3.0.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/guava-12.0.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jetty-continuation-7.6.1.v20120215.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jetty-http-7.6.1.v20120215.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jetty-io-7.6.1.v20120215.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jetty-server-7.6.1.v20120215.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jetty-util-7.6.1.v20120215.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jline-2.10.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jna.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/jsch-0.1.50.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/log4j-1.2.16.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/protobuf-java-2.4.1.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/servlet-api-2.5.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/slf4j-api-1.6.2.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/slf4j-nop-1.6.2.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/snappy-java-1.0.5-M3.jar:/home/memsql/voltdb-voltdb-3.3.0.3/examples/voltcache/../../lib/zmq-2.1.11.jar
                  src/voltcache/Benchmark.java:48: package org.voltdb does not exist
                  import org.voltdb.CLIConfig;

                  Comment


                  • #10
                    Thanks, I think we're getting close to the source of the problem.

                    What do you get as output when you run these commands?

                    $ which voltdb

                    $ ls -1 /home/memsql/voltdb-voltdb-3.3.0.3/voltdb/voltdb-*.jar

                    Also, you mentioned earlier you were running VoltDB 3.5, but the classpath output is showing version 3.3.0.3. Why such an old version? If you are testing out VoltDB for the first time, you might as well download the latest version, which is currently 3.6.

                    I think what is happening is that somehow the voltdb-*.jar file isn't included in the classpath. Here is the part of the run.sh script that builds the CLASSPATH:

                    APPCLASSPATH=$CLASSPATH:$({ \
                    \ls -1 "$VOLTDB_VOLTDB"/voltdb-*.jar; \
                    \ls -1 "$VOLTDB_LIB"/*.jar; \
                    \ls -1 "$VOLTDB_LIB"/extension/*.jar; \
                    } 2> /dev/null | paste -sd ':' - )

                    If there was no voltdb-*.jar file, the "2> /dev/null" ignores this, so it looks like you're left with just the other lib/*.jar files in your CLASSPATH, which actually aren't even needed for compiling the stored procedures.

                    Comment


                    • #11
                      I agree that this looks like the source of the problem. Thank you again for your help.

                      I switched to version 3.3 after having trouble with 3.5. I thought perhaps I had gotten a bad download with a mistake in a command in the run.sh command or something so I would try 3.3. If you could post a link to a known good download where the jars and shell files and directories are all in the right place, that would be very helpful.

                      Here is the output of the commands. It looks like which voltdb does not return any output. It looks like the voltdb-*.jar might be missing. Again, maybe a link to a known good download for the community edition might be the best.

                      memsql@memsql-virtual-machine:~/voltdb-voltdb-3.3.0.3/examples/voltcache$ which voltdb
                      memsql@memsql-virtual-machine:~/voltdb-voltdb-3.3.0.3/examples/voltcache$ ls -1 /home/memsql/voltdb-voltdb-3.3.0.3/voltdb/voltdb-*.jar
                      ls: cannot access /home/memsql/voltdb-voltdb-3.3.0.3/voltdb/voltdb-*.jar: No such file or directory
                      memsql@memsql-virtual-machine:~/voltdb-voltdb-3.3.0.3/examples/voltcache$ sudo ls -1 /home/memsql/voltdb-voltdb-3.3.0.3/voltdb/voltdb-*.jar
                      [sudo] password for memsql:
                      ls: cannot access /home/memsql/voltdb-voltdb-3.3.0.3/voltdb/voltdb-*.jar: No such file or directory
                      memsql@memsql-virtual-machine:~/voltdb-voltdb-3.3.0.3/examples/voltcache$

                      Comment


                      • #12
                        It looks like the missing jar file is the problem. You should reinstall, since your installation seems to be incomplete.

                        You can download the latest Community Edition for Linux from our downloads page here:
                        http://voltdb.com/download/software

                        Once you've downloaded, you can follow the instructions in our Dev Center for installing VoltDB and running sample applications:
                        http://voltdb.com/dev-center/

                        Cheers,
                        Ben

                        Comment


                        • #13
                          Thanks Ben. Once I re-install, where should I expect to find the jar?

                          Abe

                          Comment


                          • #14
                            Assuming you install to $HOME, the jar file should be at $HOME/voltdb-3.6/voltdb/voltdb-3.6.jar. The run.sh script should just work, though.

                            Comment


                            • #15
                              It's working! Thanks.

                              Comment

                              Working...
                              X