1. 개요

가우스 관련 오류 내용이다.

2. 오류

  • 가우스를 처음 설치한 디렉토리와 어플리케이션이 실행되는 디렉토리가 다를 때
  • 예를 들어 이클립스 wst 환경일 때
SEVERE: [GAUCE] GauceFilter: °¡¿?½º 4.0 ¼­¹? ¶???¼¾½º¸? °?????´? ?ß ¿?·?°¡ ¹ß????¿´½?´?´?.
com.gauce.engine.H: °¡¿?½º ¼­¹? 4.0?? ¼³?¡?? ?ð·º??¸®(C:\workspace\testProject\WebContent\WEB-INF) ??¿??? ?ð·º??¸®¿¡¼­ °¡¿?½º¸? ½????? ¼? ¾ø½?´?´?. C:\project_box\nwpms\WebContent\nwpms\WEB-INF
	at com.gauce.filter.GauceFilter.A(Unknown Source)

3. 원인

GauceFilter에 관련 로직이 들어있다.

    Object localObject1 = new File(localFile1, "lib");
    File[] arrayOfFile = ((File)localObject1).listFiles();
    URL[] arrayOfURL = new URL[arrayOfFile.length];
    for (int i = 0; i < arrayOfFile.length; i++) {
      arrayOfURL[i] = arrayOfFile[i].toURL();
    }
    URLClassLoader localURLClassLoader = new URLClassLoader(arrayOfURL, getClass().getClassLoader());
    Class localClass = localURLClassLoader.loadClass("cryptix.jce.provider.CryptixCrypto");
    Provider localProvider = (Provider)localClass.newInstance();
    Security.addProvider(localProvider);
    String str1 = new D().toString();
    if (str1.length() == 0) {
      throw new H(this.sm.getString("GauceFilter.checkLicense.noPrivateKey"));
    }
    byte[] arrayOfByte1 = new BASE64Decoder().decodeBuffer(str1);
    File localFile2 = new File(localFile1, ".registry");
    if (!localFile2.exists()) {
      throw new FileNotFoundException(this.sm.getString("GauceFilter.checkLicense.noRegistry", localFile2.getName()));
    }
    FileInputStream localFileInputStream1 = new FileInputStream(localFile2);
    byte[] arrayOfByte3 = new byte[localFileInputStream1.available()];
    localFileInputStream1.read(arrayOfByte3);
    localFileInputStream1.close();
    String str2 = new String(arrayOfByte3, "8859_1");
    byte[] arrayOfByte2 = new BASE64Decoder().decodeBuffer(str2);
    ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream();
    int j = 0;
    KeyFactory localKeyFactory = KeyFactory.getInstance("RSA");
    PKCS8EncodedKeySpec localPKCS8EncodedKeySpec = new PKCS8EncodedKeySpec(arrayOfByte1);
    RSAPrivateKey localRSAPrivateKey = (RSAPrivateKey)localKeyFactory.generatePrivate(localPKCS8EncodedKeySpec);
    Cipher localCipher = Cipher.getInstance("RSA/ECB/PKCS#1");
    localCipher.init(2, localRSAPrivateKey);
    int k = localCipher.getBlockSize();
    int m = 0;
    while (m < arrayOfByte2.length)
    {
      j = arrayOfByte2.length - m <= k ? arrayOfByte2.length - m : k;
      localByteArrayOutputStream.write(localCipher.doFinal(arrayOfByte2, m, j));
      m += k;
    }
    ByteArrayInputStream localByteArrayInputStream = new ByteArrayInputStream(localByteArrayOutputStream.toByteArray());
    Properties localProperties1 = new Properties();
    localProperties1.load(localByteArrayInputStream);
    String str3 = localProperties1.getProperty("gauce.install.os");
    if (!str3.equals(System.getProperty("os.name"))) {
      throw new H(this.sm.getString("GauceFilter.checkLicense.differentOS"));
    }
    String str4 = localProperties1.getProperty("gauce.install.dir");
    if (!str4.equals(localFile1.getCanonicalPath())) {
      throw new H(this.sm.getString("GauceFilter.checkLicense.differentDir", str4, localFile1.getCanonicalPath()));
    }
    Document localDocument = null;
    File localFile3 = new File(localFile1, "license/license.gauce");
    if (!localFile3.exists()) {
      throw new FileNotFoundException(this.sm.getString("GauceFilter.checkLicense.noLicense", localFile3.getName()));
    }
    FileInputStream localFileInputStream2 = new FileInputStream(localFile3);
    InputSource localInputSource = new InputSource(localFileInputStream2);
    DocumentBuilderFactory localDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
    localDocumentBuilderFactory.setNamespaceAware(true);
    DocumentBuilder localDocumentBuilder = localDocumentBuilderFactory.newDocumentBuilder();
    try
    {
      localDocument = localDocumentBuilder.parse(localInputSource);
    }
    catch (Exception localException)
    {
      throw new SAXException(this.sm.getString("GauceFilter.checkLicense.invalidLicenseFormat"), localException);
    }