Skip to content

Instantly share code, notes, and snippets.

View eslick's full-sized avatar

Ian Eslick eslick

View GitHub Profile
@eslick
eslick / datomic-schema.clj
Last active May 6, 2016 02:56
One solution to integrating Schema and Datomic
(in-ns test
(:require
[schema.macros :as macros]
[schema.utils :as sutils]))
;; Wrapper type needed because Entity values do not implement
;; IPersistentMap interface
(defrecord EntitySchema
[schema]
Schema
@eslick
eslick / gist:0e1f7696de8b55a1f81c
Created August 13, 2014 22:37
Immutant exceptions after restarting queue on Immutant 1.1.3
22:34:03,045 WARN [org.hornetq.core.client] (MSC service thread 1-2) HQ212002: Timed out waiting for handler to complete processing
22:34:03,056 ERROR [stderr] (Thread-13638 (HornetQ-client-global-threads-396177756)) java.lang.NullPointerException
22:34:03,056 ERROR [stderr] (Thread-13638 (HornetQ-client-global-threads-396177756)) at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:91)
22:34:03,057 ERROR [stderr] (Thread-13638 (HornetQ-client-global-threads-396177756)) at org.immutant.messaging.MessageProcessor.onMessage(MessageProcessor.java:51)
22:34:03,058 ERROR [stderr] (Thread-13638 (HornetQ-client-global-threads-396177756)) at org.projectodd.polyglot.messaging.BaseMessageProcessor.onMessage(BaseMessageProcessor.java:132)
22:34:03,058 ERROR [stderr] (Thread-13638 (HornetQ-client-global-threads-396177756)) at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1085)
22:34:03,059 ERROR [stderr] (Thread-13638 (HornetQ-client-globa
@eslick
eslick / project.clj
Created March 30, 2014 20:48
project.clj snippet for working around XML expansion bug
:profiles {;; PRODUCTION
:prod {:jvm-opts ["-Xms512M" "-Xmx2G" "-server" "-Djdk.xml.entityExpansionLimit=0"
"-XX:+UseConcMarkSweepGC" "-XX:+CMSIncrementalMode"]}}
@eslick
eslick / out.log
Created March 30, 2014 20:46
Datomic + DDB Interaction stack trace; caused by JDK limitation in XML expansion
16:57:27.147 ERROR com.amazonaws.http.AmazonHttpClient - Unable to unmarshall response (ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.)
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:219) ~[na:1.6.0_27]
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.<init>(XMLStreamReaderImpl.java:189) ~[na:1.6.0_27]
at com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:277) ~[na:1.6.0_27]
at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:129) ~[na:1.6.0_27]
at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLEventReader(XM
{
:node "ip-10-226-117-71",
:ns "switchboard.api.synchronize",
:thread-id 397,
:app 1
:mtx 3292,
:atx 2154,
:dts 1395756593391,
:date #inst "2014-03-25T14:09:53.390-00:00",
:auth #uuid "532cb9c1-39cc-486e-9e34-62d154d0fb84",
(p/subscribe [:test] :printer)
(p/subscribe #{:test} :printer
(async/map> #(select-keys % [:ts :value]) (async/chan)))
@eslick
eslick / gist:8447415
Created January 16, 2014 00:15
Output from running upstart script
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /var/lib/immutant/current/jboss
JAVA: java
JAVA_OPTS: -server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=
org.jboss.byteman -Djava.awt.headless=true
@eslick
eslick / gist:8420061
Created January 14, 2014 15:26
Interesting stack trace from my CI server from lein immutant test AFTER a successful test run (0 failures, etc).
Stopping JBoss
java.io.IOException: Premature EOF
at sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:565)
at sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:609)
at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:696)
@eslick
eslick / gist:7087091
Created October 21, 2013 16:54
Switchboard project.clj
(defproject switchboard "0.8.0-SNAPSHOT"
:description "Real-Time Healthcare"
:url "http://swb.io"
:license {:name "To Be Determined"}
:min-lein-version "2.0.0"
:main ^{:skip-aot true} switchboard.server
:resource-paths ["config", "resources"]
:aliases {"cas-dev" ["trampoline" "run" "-m" "switchboard.db.cassandra-test/start-embedded-server"]}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/core.async "0.1.242.0-44b1e3-alpha"]
@eslick
eslick / gist:7086897
Created October 21, 2013 16:42
Lein deps tree for pedestal-based immutant app
Bacon:switchboard eslick$ lein deps :tree
WARNING!!! possible confusing dependencies found:
[io.pedestal/pedestal.service "0.2.1"] -> [org.slf4j/slf4j-api "1.7.2"]
overrides
[com.datomic/datomic-pro "0.8.4143"] -> [org.slf4j/jul-to-slf4j "1.7.5"] -> [org.slf4j/slf4j-api "1.7.5"]
and
[com.datomic/datomic-pro "0.8.4143"] -> [org.slf4j/log4j-over-slf4j "1.7.5"] -> [org.slf4j/slf4j-api "1.7.5"]
and
[com.datomic/datomic-pro "0.8.4143"] -> [org.slf4j/jcl-over-slf4j "1.7.5"] -> [org.slf4j/slf4j-api "1.7.5"]