3

我希望将 Java 库存储在我的 Oracle 数据库中。请注意,这是我第一次这样做。该库是pd4ml。它由两个 jar 组成,其中包含已编译的类。

  • pd4ml.jar
  • ss_css2.jar(pd4ml.jar 需要)

由于用 Toad 加载它们不起作用(Toad 说它们已成功加载,但它们没有出现在任何地方)我去了命令行(loadjava)并成功加载ss_css2.jar。它的所有类都被加载和编译。

第二个库pd4ml.jar也已加载,但有几个类无法编译。我运行 ojvmtc 来尝试解析引用。我收到以下消息:

找不到以下类:

javax/servlet/http/HttpServletResponseWrapper

org/zefer/pd4ml/npdf/parser/c

第一个,如果我的理解正确的话,应该是11g r2内置的JRE的一部分。浏览sys架构,它似乎不存在。

第二个是 jar 库的一部分。现在我不太确定编译后的 Java 的结构,我以前从来没有研究过它,但是我里面有几个 .class 文件org/zefer/pd4ml/npdf/parser/,它们是: c$_b, c$_c.... to c$_g. 没有唯一的c

当传递命令行参数或从 Eclipse 运行它时,该库在我的本地机器上运行良好,因此它应该可以工作。尝试在 Toad 中编译它们时没有显示特定的错误消息。我觉得这是一个依赖项/类路径问题。

关于我应该如何确保包含的类pd4ml.jar可以正确访问那些的任何提示ss_css2.jar,或任何潜在的调查原因?也许是一种从 Java 代码中获取详细错误消息的方法?

4

1 回答 1

0

The strange class names like c$_b, c$_c.... to c$_g are result of JAR file obfuscation. The obfuscation impacts only non-public classes, so it should not harm.

As I see, in your particular case javax/servlet/http/HttpServletResponseWrapper class is missing (and probably few more) - the classes can be found in servlet-api.jar. Just take the file from any J2EE (or Tomcat) distribution and add the file to your project/application.

In usual scenarios the servlet-api classes are required only when WebApp-specific PD4ML methods are called. And the methods are called only when pd4ml.jar is a part of a web application (that means servlet-api.jar is among the application resources).

As I see now, Oracle database Java sub-system scans for all referenced resources (even if they are not needed in a scenario) and panic if anything is missing.

于 2014-06-26T14:41:57.430 回答