Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-dev] REST API to GeoMesa using Jersey

In addition to that note that the client libs of hadoop may not need jersey...You may be able to exclude it like the hadoop-client pom does in 2.2.0:

https://github.com/apache/hadoop/blob/release-2.2.0/hadoop-client/pom.xml#L83-L93

It depends on what jersey is used for but we don't generally have the jersey jar installed with our hadoop/geomesa stack. You should be able to use maven to exclude the servlet/jersey/etc related web jars and use whatever container version you would like. For instance, we exclude servlet 2.5 all the time since our target environment is servlet 3.1 based.

Also try using the command "mvn dependency:tree" to find where jersey is coming from and exclude it or manage it to the version you're interested in!

-Andrew


On 10/15/2018 08:40 AM, Emilio Lahr-Vivaz wrote:
Hello,

Are you familiar with the maven shade plugin, and its ability to relocate classes? Classpath conflicts are a typical stumbling block with GeoMesa integration, due to the large number of dependencies. An easy way around that is to shade and relocate the conflicting libraries into an uber-jar, then depend on that uber-jar in your REST API. That way, you shouldn't 'see' the older version of jersey.

As an example, we do this with our HBase geoserver plugin, to hide the older version of guava required by HBase:

https://github.com/locationtech/geomesa/blob/master/geomesa-hbase/geomesa-hbase-gs-plugin/pom.xml#L118

Thanks,

Emilio

On 10/13/2018 07:05 AM, Maria Krommyda wrote:
Hello everyone,

I have encounter a very mind-blowing issue while trying to create a REST API for a Geomesa-Accumulo datastore using Jersey,
I am using Accumulo 1.7.3 with Hadoop 2.2.0 with geomesa-accumulo_2.11-1.3.5.
To the best of my knowledge Hadoop requires Jersey 1.9 which includes to the project dependencies.

I would like to use Jersey 2.17+ but when I include is in my project I get
java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder
which is expected(?) due to the fact that I have two Jersey version in the web libs.

When I remove the Jersey import, hoping to use the Jersey 1.9 already included by Hadoop I get 


javax.servlet.ServletException: Servlet.init() for servlet Sensorthing-Servlet threw exception
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.lang.Thread.run(Thread.java:748)


Please also find attached the pom.xml file that I use. 
Any ideas or suggestions regarding how to set up my pox.xml file so that the project can work are more than welcomed. 

Thank you very much for you time. 

Best regards,
Maria.


_______________________________________________
geomesa-dev mailing list
geomesa-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-dev



_______________________________________________
geomesa-dev mailing list
geomesa-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.locationtech.org/mailman/listinfo/geomesa-dev


Back to the top