2 Replies Latest reply: Jan 16, 2013 2:55 AM by 984586 RSS

    error: class not found in import in pl/sql developer

    984586
      hi everybody!
      i need help please.

      so this is a problem:
      i try to compile java source in pl/sql developer & i get an error like this - Class com.sun.org.apache.xerces.internal.impl.dv.util.Base64 not found in import.
      i downloaded Base64.class file from

      http://www.jarvana.com/jarvana/view/commons-codec/commons-codec/1.4/commons-codec-1.4.jar!/org/apache/commons/codec/binary/Base64.class?classDetails=ok
      & tried to use loadjava doing this
      loadjava -force -user login/pwd@databasename -resolve c:\Base64.class & class was succesfully loaded because i selected row from all_objects and see that it is invalid status. i gave to my

      user all privilegies with admin options & tried again. but class was steel invalid.
      then i did
      loadjava -noverify -force -user login/pwd@databasename -resolve c:\Base64.class and class was succesfully uploaded with valid status
      but error Class com.sun.org.apache.xerces.internal.impl.dv.util.Base64 not found in import is steel here when i compiling.
      here is the code:
      import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
      import java.io.*;
      import java.security.Key;
      import java.security.KeyStore;
      import java.security.PrivateKey;
      import java.security.Signature;
      import java.security.cert.Certificate;
      public class Sign {
      public static void main(String[] args) throws Exception {
      // TODO code application logic here
      BufferedReader reader = new BufferedReader(new FileReader("/buffer/cert.p12"));
      StringBuilder fullText = new StringBuilder();
      String line = reader.readLine();
      while (line != null) {
      fullText.append(line);
      line = reader.readLine();
      }
      KeyStore p12 = KeyStore.getInstance("pkcs12");
      p12.load(new FileInputStream("/buffer/cert.p12"), "Hfrtnf$5".toCharArray());

      //????????? ????????? ????, ??? ????? ????? ???????????? alias ? ??????
      //Key key = p12.getKey("my kkb key", "ryba-mech".toCharArray());
      Key key = (Key) p12.getKey("my kkb key", "Hfrtnf$5".toCharArray());
      Certificate userCert = (Certificate) p12.getCertificate("my kkb key");
      String base64Cert = new String(Base64.encode(userCert.getEncoded()));
      //signing
      Signature signer = Signature.getInstance("SHA1withRSA");
      signer.initSign((PrivateKey) key);
      signer.update(fullText.toString().getBytes());
      byte[] digitalSignature = signer.sign();
      String base64sign = new String(Base64.encode(digitalSignature));
      String base64Xml = new String(Base64.encode(fullText.toString().getBytes()));

      System.out.println("<certificate>" + base64Cert+"</certificate>");
      System.out.println("<xmlBody>" + base64Xml+"</xmlBody>");
      System.out.println("<signature>" + base64sign+"</signature>");
      }
      }

      i need community`s help! thanks!