令人费解的ClojureScript错误:命名空间" com.cognitect.transit.util"已经宣布

时间:2015-09-12 16:33:32

标签: clojurescript nashorn

我正在尝试将ClojureScript应用程序加载到Nashorn中,并在加载ajax.core时加载:

(ns projectx.handlers
  (:require [ajax.core :as ajax]))

我的代码无法加载错误:

19664:6 Error: Namespace "com.cognitect.transit.util" already declared.
    at jdk.nashorn.internal.objects.NativeError.initException(NativeError.java:137)
    at jdk.nashorn.internal.objects.NativeError.<init>(NativeError.java:102)
    at jdk.nashorn.internal.objects.NativeError.<init>(NativeError.java:106)
    at jdk.nashorn.internal.objects.NativeError.<init>(NativeError.java:110)
    at jdk.nashorn.internal.objects.NativeError.constructor(NativeError.java:129)
    at jdk.nashorn.internal.scripts.Script$Recompilation$1945$602593A$\^eval\_.provide(<eval>:19664)
    at jdk.nashorn.internal.scripts.Script$Recompilation$2082$\^eval\_.:program$:split-9(<eval>:57262)
    at jdk.nashorn.internal.scripts.Script$1686$\^eval\_.:program(<eval>)
    at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:636)
    at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:229)
    at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:387)
    at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:437)
    ... 66 more

确实有问题的一行是:

goog.provide("com.cognitect.transit.util");

但是在那个文件中没有其他类似的那样。有什么想法会发生什么?

这些是项目中com.cognitect.transit.util的所有提及(如grep -R com.cognitect.transit.util .中所述):

./.idea/workspace.xml:        <option value="$PROJECT_DIR$/resources/public/js/server-side/com/cognitect/transit/util.js" />
./.idea/workspace.xml:    <entry file="jar://$MAVEN_REPOSITORY$/com/cognitect/transit-js/0.8.755/transit-js-0.8.755.jar!/com/cognitect/transit/util.js">
./resources/public/js/app/cljs_deps.js:goog.addDependency("../com/cognitect/transit/util.js", ['com.cognitect.transit.util'], ['goog.object']);
./resources/public/js/app/cljs_deps.js:goog.addDependency("../com/cognitect/transit/eq.js", ['com.cognitect.transit.eq'], ['com.cognitect.transit.util']);
./resources/public/js/app/cljs_deps.js:goog.addDependency("../com/cognitect/transit/types.js", ['com.cognitect.transit.types'], ['com.cognitect.transit.util', 'com.cognitect.transit.eq', 'goog.math.Long']);
./resources/public/js/app/cljs_deps.js:goog.addDependency("../com/cognitect/transit/impl/decoder.js", ['com.cognitect.transit.impl.decoder'], ['com.cognitect.transit.util', 'com.cognitect.transit.delimiters', 'com.cognitect.transit.caching', 'com.cognitect.transit.types']);
./resources/public/js/app/cljs_deps.js:goog.addDependency("../com/cognitect/transit/handlers.js", ['com.cognitect.transit.handlers'], ['com.cognitect.transit.util', 'com.cognitect.transit.types', 'goog.math.Long']);
./resources/public/js/app/cljs_deps.js:goog.addDependency("../com/cognitect/transit/impl/writer.js", ['com.cognitect.transit.impl.writer'], ['com.cognitect.transit.util', 'com.cognitect.transit.caching', 'com.cognitect.transit.handlers', 'com.cognitect.transit.types', 'com.cognitect.transit.delimiters', 'goog.math.Long']);
./resources/public/js/app/com/cognitect/transit/eq.js:goog.require("com.cognitect.transit.util");
./resources/public/js/app/com/cognitect/transit/eq.js:    util = com.cognitect.transit.util;
./resources/public/js/app/com/cognitect/transit/handlers.js:goog.require("com.cognitect.transit.util");
./resources/public/js/app/com/cognitect/transit/handlers.js:    util     = com.cognitect.transit.util,
./resources/public/js/app/com/cognitect/transit/impl/decoder.js:goog.require("com.cognitect.transit.util");
./resources/public/js/app/com/cognitect/transit/impl/decoder.js:    util    = com.cognitect.transit.util,
./resources/public/js/app/com/cognitect/transit/impl/writer.js:goog.require("com.cognitect.transit.util");
./resources/public/js/app/com/cognitect/transit/impl/writer.js:    util     = com.cognitect.transit.util,
./resources/public/js/app/com/cognitect/transit/types.js:goog.require("com.cognitect.transit.util");
./resources/public/js/app/com/cognitect/transit/types.js:    util  = com.cognitect.transit.util,
./resources/public/js/app/com/cognitect/transit/util.js:goog.provide("com.cognitect.transit.util");
./resources/public/js/app/com/cognitect/transit/util.js:var util    = com.cognitect.transit.util,
./resources/public/js/server-side/com/cognitect/transit/eq.js:goog.require("com.cognitect.transit.util");
./resources/public/js/server-side/com/cognitect/transit/eq.js:    util = com.cognitect.transit.util;
./resources/public/js/server-side/com/cognitect/transit/handlers.js:goog.require("com.cognitect.transit.util");
./resources/public/js/server-side/com/cognitect/transit/handlers.js:    util     = com.cognitect.transit.util,
./resources/public/js/server-side/com/cognitect/transit/impl/decoder.js:goog.require("com.cognitect.transit.util");
./resources/public/js/server-side/com/cognitect/transit/impl/decoder.js:    util    = com.cognitect.transit.util,
./resources/public/js/server-side/com/cognitect/transit/impl/writer.js:goog.require("com.cognitect.transit.util");
./resources/public/js/server-side/com/cognitect/transit/impl/writer.js:    util     = com.cognitect.transit.util,
./resources/public/js/server-side/com/cognitect/transit/types.js:goog.require("com.cognitect.transit.util");
./resources/public/js/server-side/com/cognitect/transit/types.js:    util  = com.cognitect.transit.util,
./resources/public/js/server-side/com/cognitect/transit/util.js:goog.provide("com.cognitect.transit.util");
./resources/public/js/server-side/com/cognitect/transit/util.js:var util    = com.cognitect.transit.util,
./resources/public/js/server-side.js:com.cognitect.transit.util = {};
./resources/public/js/server-side.js:com.cognitect.transit.util.objectKeys = "undefined" != typeof Object.keys ? function(a) {
./resources/public/js/server-side.js:com.cognitect.transit.util.isArray = "undefined" != typeof Array.isArray ? function(a) {
./resources/public/js/server-side.js:com.cognitect.transit.util.chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d";
./resources/public/js/server-side.js:com.cognitect.transit.util.randInt = function(a) {
./resources/public/js/server-side.js:com.cognitect.transit.util.randHex = function() {
./resources/public/js/server-side.js:  return com.cognitect.transit.util.randInt(15).toString(16);
./resources/public/js/server-side.js:com.cognitect.transit.util.randomUUID = function() {
./resources/public/js/server-side.js:  var a = (8 | 3 & com.cognitect.transit.util.randInt(14)).toString(16);
./resources/public/js/server-side.js:  return com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + "-" + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + "-4" + com.cognitect.transit.util.randHex() +
./resources/public/js/server-side.js:  com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + "-" + a + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + "-" + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() +
./resources/public/js/server-side.js:  com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex() + com.cognitect.transit.util.randHex();
./resources/public/js/server-side.js:com.cognitect.transit.util.btoa = function(a) {
./resources/public/js/server-side.js:  for (var b, c, d = 0, e = com.cognitect.transit.util.chars, f = "";a.charAt(d | 0) || (e = "\x3d", d % 1);f += e.charAt(63 & b >> 8 - d % 1 * 8)) {
./resources/public/js/server-side.js:com.cognitect.transit.util.atob = function(a) {
./resources/public/js/server-side.js:    d = com.cognitect.transit.util.chars.indexOf(d);
./resources/public/js/server-side.js:com.cognitect.transit.util.Uint8ToBase64 = function(a) {
./resources/public/js/server-side.js:  return com.cognitect.transit.util.btoa(d);
./resources/public/js/server-side.js:com.cognitect.transit.util.Base64ToUint8 = function(a) {
./resources/public/js/server-side.js:  a = com.cognitect.transit.util.atob(a);
./resources/public/js/server-side.js:    if (com.cognitect.transit.util.isArray(a)) {
./resources/public/js/server-side.js:      if (com.cognitect.transit.util.isArray(b) && a.length === b.length) {
./resources/public/js/server-side.js:      var c = 0, d = com.cognitect.transit.util.objectKeys(b).length, e;
./resources/public/js/server-side.js:    for (var c = com.cognitect.transit.util.objectKeys(a), d = 0;d < c.length;d++) {
./resources/public/js/server-side.js:  if (com.cognitect.transit.util.isArray(a)) {
./resources/public/js/server-side.js:      return a instanceof Date ? a.valueOf() : com.cognitect.transit.util.isArray(a) ? com.cognitect.transit.eq.hashArrayLike(a) : a.com$cognitect$transit$hashCode ? a.com$cognitect$transit$hashCode() : com.cognitect.transit.eq.hashMapLike(a);
./resources/public/js/server-side.js:  return b && !1 === b.preferBuffers || "undefined" == typeof Buffer ? "undefined" != typeof Uint8Array ? com.cognitect.transit.util.Base64ToUint8(a) : com.cognitect.transit.types.taggedValue("b", a) : new Buffer(a, "base64");
./resources/public/js/server-side.js:  if (null != b && "object" === typeof b && (c = com.cognitect.transit.util.objectKeys(b), d = c.length, a.size === d)) {
./resources/public/js/server-side.js:  return null != this._keys ? this._keys : com.cognitect.transit.util.objectKeys(this.map);
./resources/public/js/server-side.js:      return com.cognitect.transit.util.isArray(a) ? "^ " === a[0] ? this.decodeArrayHash(a, b, c, d) : this.decodeArray(a, b, c, d) : this.decodeHash(a, b, c, d);
./resources/public/js/server-side.js:  c = com.cognitect.transit.util.objectKeys(a);
./resources/public/js/server-side.js:com.cognitect.transit.handlers.ctorGuidProperty = "transit$guid$" + com.cognitect.transit.util.randomUUID();
./resources/public/js/server-side.js:  a = com.cognitect.transit.util.objectKeys(a);
./resources/public/js/server-side.js:  return com.cognitect.transit.util.Uint8ToBase64(a);
./resources/public/js/server-side.js:    if (com.cognitect.transit.util.isArray(a) || !a.forEach) {
./resources/public/js/server-side.js:  if (com.cognitect.transit.util.isArray(b)) {
./resources/public/js/server-side.js:        for (e = {}, f = com.cognitect.transit.util.objectKeys(b), c = 0;c < f.length;c++) {
./resources/public/js/server-side.js:    f = com.cognitect.transit.util.objectKeys(b);

0 个答案:

没有答案