Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and startup issues #55

Closed
arenger opened this issue Dec 13, 2017 · 7 comments
Closed

Build and startup issues #55

arenger opened this issue Dec 13, 2017 · 7 comments

Comments

@arenger
Copy link

arenger commented Dec 13, 2017

Thank you for creating this geoserver extension... I'm excited to try it out!

I'm running into two different problems. First, mvn install -DskipTests=true -Dskip.integration.tests=true doesn't work for me, when running within the gt-elasticsearch directory. Maven can't find mil.nga.giat:joda-shaded. Is there a repository that I should add to my settings.xml?

Could not find artifact mil.nga.giat:joda-shaded:jar:2.12-SNAPSHOT in maven2-repository.dev.java.net (http://download.java.net/maven/2)

I tried downloading a pre-compiled binary from https://github.com/ngageoint/elasticgeo/releases (I downloaded 2.12.0-RC1), but when I add it to my WEB-INF/lib directory, restart, and attempt to add a new data source, the following error occurs:

org.apache.wicket.WicketRuntimeException: Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener targeted at org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1@210bc861 on component [AjaxSubmitLink [Component id = save]] threw an exception at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268) at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248) at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
...
Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258) ... 113 more Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
...

Likely stemming from an incompatibility of Jackson/json libraries.

Do you have any suggestions? I'm using GeoServer 2.12.0 and Java 1.8.0_151

@arenger
Copy link
Author

arenger commented Dec 13, 2017

Please disregard the first issue. I neglected the fact that joda-shaded is a peer directory to gs-web-elasticsearch... so I'm able to build it now.

However, I've still not resolved the issue regarding compatibility between pre-compiled binary 2.12.0-RC1 and GeoServer 2.12.0. The same stack trace is returned when using 2.12.0-RC1 and when building from 11812d8.

@arenger
Copy link
Author

arenger commented Dec 14, 2017

When I revert to 2.10.1-RC1 of this repository, it works with GeoServer 12.2. Now there are issues attempting the connection to ElasticSearch, so I'm downgrading my ElasticSearch version to 2.4.6, in effort to appease the TransportClient's connection preferences.

@sjudeng
Copy link
Contributor

sjudeng commented Dec 15, 2017

I'm not able to reproduce this. Is it on Linux, Windows or OS X? Is it a default GeoServer installation or have you installed other custom plugins? I tested without issue using GeoServer 2.12.1 (web archive/war) and elasticgeo-2.12.0 in Tomcat 8.5.24.

@arenger
Copy link
Author

arenger commented Dec 15, 2017

Thanks for replying, @sjudeng! I'm using Tomcat 8.0.47 and GeoServer 2.12.0 in a Docker environment. When I build the latest gs-web-elasticsearch jars I still receive the jackson ClassNotFound exceptions. However, when I build the 2.10.1-RC1 version of gs-web-elasticsearch it works fine. As for connecting to ElasticSearch, I resolved that issue too... I needed to enable transport client connections by adding transport.host: 0.0.0.0 to my elasticsearch.yml file. (Currently I'm using ElasticSearch 5.6.5)

Now the only problem I have is that the Layer Preview in GeoServer doesn't show any data, after I successfully add and publish an ElasticSearch datasource. I'm going to try a direct WFS query to see if I can hone in whether this is due to incompatibility or misconfiguration...

@arenger
Copy link
Author

arenger commented Dec 15, 2017

Here's a docker-compose, if you would like to build 2.12.0-RC1 of gs-web-elasticsearch and see if you can reproduce the jackson error:

version: '2'

services:

  geoserver:
    image: kartoza/geoserver:2.12.0
    hostname: geoserver
    ports:
      - "8080:8080"
    restart: unless-stopped
    user: root
    depends_on:
      - es

  es:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.6.5
    ports:
      - "9200:9200"

I double-checked just now (after rebuilding from master [11812d8]) and starting the containers fresh... and received the following stack trace:

org.apache.wicket.WicketRuntimeException: Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener...
  at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
  at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
  at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
  at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
...
Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
...  113 more
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
  at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:400)
...

@sjudeng
Copy link
Contributor

sjudeng commented Dec 16, 2017

I pushed an update that should resolve the issue. See ab4f003 and the 2.12.1-RC1 release.

GeoServer 2.12.0 added an older jackson-core-2.5.0 as a dependency, which conflicts with the version bundled in the plugin. The plugin appears to be compatible with the earlier Jackson but GeoServer isn't compatible with the newer version. For some reason when deploying through Docker the plugin (and newer Jackson) precedes the earlier Jackson on the classpath which causes the error.

@arenger
Copy link
Author

arenger commented Dec 18, 2017

Yep, it's fixed! I built from 2.12.1-RC1 and redeployed with GeoServer 2.12.0 and I'm able to add a new ElasticSearch datastore without error. Thanks @sjudeng!

@arenger arenger closed this as completed Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants