This discussion is archived
1 Reply Latest reply: Jun 19, 2013 3:31 PM by burleigh RSS

Java class is INVALID after successful compile of hashids.java

burleigh Newbie
Currently Being Moderated

A Java programmer has kindly ported the Hashids "library" to the Java platform, here:

https://github.com/peet/hashids.java

 

So I thought I'd compile it into our 11gR2 11.2.0.1 database, using SQL Developer.  At its top the java file reads:

 

set define off; -- added to avoid trouble with & characters

 

create or replace and compile

java source named "Hashids" as

 

import java.util.*;

 

public class Hashids {

...

}

 

The process looks to compile ok, with SQLD saying "anonymous block completed" but at the end the new object's status is INVALID.  From the scattered reading I did, I'd guess that there are unresolved dependencies somewhere -- perhaps from that import java.util.*.  I'm not convinced actually since the dox say that the Java classes are in PUBLIC and that those kinds of things are resolved more or less automatically.

 

This is a great tool, so I'd be really glad for some help with this.

 

Thank you.

  • 1. Re: Java class is INVALID after successful compile of hashids.java
    burleigh Newbie
    Currently Being Moderated

    "Nevermind."

     

    By using loadjava I was able to see that the class used String.isEmpty(), which I guess is not defined by the JVM in 11gR2.

     

    That may not get me very far, though: this code is a proper class, including overloaded constructors.  That means to me using the class would require instantiating an instance of it, then calling its methods.  It's not obvious that that could be done from within PL/SQL.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points