Skip to content

Instantly share code, notes, and snippets.

View shawnjohnson's full-sized avatar

Shawn Johnson shawnjohnson

View GitHub Profile
@shawnjohnson
shawnjohnson / console.log
Created December 20, 2016 01:28
stacktrace after adding custom objectmapper
2016-12-19 20:25:08,042 WARN io.katharsis.servlet.AbstractKatharsisServlet - Katharsis Invoker exception.
io.katharsis.invoker.KatharsisInvokerException: com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: io.katharsis.response.CollectionResponseContext["response"]->io.katharsis.response.JsonApiResponse["entity"]->org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl["facets"])
at io.katharsis.invoker.KatharsisInvoker.invoke(KatharsisInvoker.java:63)
at io.katharsis.servlet.AbstractKatharsisServlet.service(AbstractKatharsisServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterCha
@shawnjohnson
shawnjohnson / ElasticsearchTemplate.java
Created December 19, 2016 19:46
Refactor return to allow for logging of complete query
private SearchResponse doSearch(SearchRequestBuilder searchRequest, SearchQuery searchQuery) {
...
if(searchQuery.getQuery() != null) {
searchRequest.setQuery(searchQuery.getQuery());
}
// Print full query before sending
if(logger.isDebugEnabled()) {
logger.debug("doSearch searchRequest:\n"+ searchRequest.toString());
}
@shawnjohnson
shawnjohnson / tomcat
Created August 15, 2016 22:28
Tomcat 8 Service init script
#!/bin/bash
#
# tomcat8
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat8
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
@shawnjohnson
shawnjohnson / add-proxy-certificate.sh
Created August 11, 2016 18:27
inject custom 'proxy' certificate to docker-for-mac beta (1.12.0-rc4-beta20 build:10404)
#!/bin/bash
if [ "$#" -ne 2 ] || ! [ -d "$1" ]; then
echo "Usage: $0 /Path/To/Certificate CERT_NAME" >&2
exit 1
fi
# This assumes the cert is in the same directory as the script
source="$( cd $1 && pwd )"
# ca-certificate of the VM