No announcement yet.

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

  • 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?



    • #3
      The 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 scripts and still getting package does not exist errors, double-check that you are using 64-bit Sun JDK 6.


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

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

        javac -target 1.6 -source 1.6 -classpath $APPCLASSPATH -d obj \
        src/voltcache/*.java \
        src/voltcache/api/*.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)


        • #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 in the voltcache example from the community edition 3.5 I am still getting package does not exist errors.


          • #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 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?


            • #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 \

              The errors all look like this:

              src/voltcache/procedures/ package org.voltdb does not exist
              import org.voltdb.ProcInfo;


              • #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?


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

                  memsql@memsql-virtual-machine:~/voltdb-voltdb-$ ./
                  src/voltcache/ package org.voltdb does not exist
                  import org.voltdb.CLIConfig;


                  • #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-*.jar

                    Also, you mentioned earlier you were running VoltDB 3.5, but the classpath output is showing version 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 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.


                    • #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 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-$ which voltdb
                      memsql@memsql-virtual-machine:~/voltdb-voltdb-$ ls -1 /home/memsql/voltdb-voltdb-*.jar
                      ls: cannot access /home/memsql/voltdb-voltdb-*.jar: No such file or directory
                      memsql@memsql-virtual-machine:~/voltdb-voltdb-$ sudo ls -1 /home/memsql/voltdb-voltdb-*.jar
                      [sudo] password for memsql:
                      ls: cannot access /home/memsql/voltdb-voltdb-*.jar: No such file or directory


                      • #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:

                        Once you've downloaded, you can follow the instructions in our Dev Center for installing VoltDB and running sample applications:



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



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


                            • #15
                              It's working! Thanks.