Announcement

Collapse
No announcement yet.

Problem compiling stored procedures

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

  • jjmartinez
    started a topic Problem compiling stored procedures

    Problem compiling stored procedures

    Dear all,

    I develop a stored procedure (AddConnections) into a Java package. The package of this class is com.mycompany.dbconnection. When I compile this class with javac, it creates a .class into the class path bin/com/mycompany/dbconnection/

    Into myFile.sql I add the next line: CREATE PROCEDURE FROM CLASS AddConnections;

    Then I compile with the command: sudo voltdb compile --classpath "./bin/com/mycompany/dbconnection/" -o myFile.jar myFile.sql
    (I compile from one folder and into this folder there is the folder called "bin")

    I'm using the last version of VoltDB (voltdb3.0)

    And it sends me the next error:

    Exception in thread "main" java.lang.NoClassDefFoundError: AddConnections (wrong name: com/mycompany/dbconnection/AddConnections)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :787)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:447)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:186)
    at org.voltdb.compiler.ProcedureCompiler.compileJavaP rocedure(ProcedureCompiler.java:148)
    at org.voltdb.compiler.ProcedureCompiler.compile(Proc edureCompiler.java:71)
    at org.voltdb.compiler.VoltCompiler.compileDatabaseNo de(VoltCompiler.java:804)
    at org.voltdb.compiler.VoltCompiler.compileXMLRootNod e(VoltCompiler.java:577)
    at org.voltdb.compiler.VoltCompiler.compileCatalog(Vo ltCompiler.java:545)
    at org.voltdb.compiler.VoltCompiler.compileInternal(V oltCompiler.java:395)
    at org.voltdb.compiler.VoltCompiler.compileFromDDL(Vo ltCompiler.java:332)
    at org.voltdb.compiler.VoltCompiler.main(VoltCompiler .java:1452)
    ERROR: Command "/usr/bin/java ..." failed with return code 256
    "


    Can anyone help me? Thanks in advance

    Best Regards, Jesús.

  • jjmartinez
    replied
    Thanks to John Hugg, we've fixed the error

    There was a problem with the classpath: On the one hand, into myFile.sql we need to write the complete path of my stored procedure; In the other hand, when we compile, we need only write the /bin path --> sudo voltdb compile --classpath "./bin/" -o myFile.jar myFile.sql

    Best Regards, Jesús.

    Leave a comment:


  • jjmartinez
    replied
    Thanks to John Hugg, we've fixed the error

    There was a problem with the classpath: On the one hand, into myFile.sql we need to write the complete path of my stored procedure; In the other hand, when we compile, we need only write the /bin path --> sudo voltdb compile --classpath "./bin/" -o myFile.jar myFile.sql

    Best Regards, Jesús.

    Leave a comment:

Working...
X