I am facing this problem randomly: I have a table with latitude,longitude and location type columns where location column is having geometry type and the data is entered correctly and also I am able to get data back sometime but sometime I get a java.lang.IllegalArgumentException: Can't convert object of type org.postgresql.util.PGobject
This is the relevant part of my class
public List<Asset_Data> findMostRecentByAsset_ID(String device_address,
Integer trail) {
Query q2 = namedQuery("com.cliftonlabs.trakitdb.core.asset_data.findMostRecentByAsset_id");
Session s = factory.getCurrentSession();
String sql = q2.getQueryString();
SQLQuery q = s.createSQLQuery(sql);
q.setParameter("device_address", device_address);
q.setParameter("trail", trail);
q.addEntity(Asset_Data.class);
q.setParameter("device_address", device_address);
return list(q);
}
public List<Asset_Data> findMostRecentByAsset_IDList(
List<String> device_address_list,
Integer trail,
boolean queryGPSNullOnly) {
String queryString = "";
int n_assets = device_address_list.size();
if (n_assets == 0) {
// return early if we dont have anything to query
return new ArrayList<Asset_Data>();
}
String gpsQuery = queryGPSNullOnly
? " and longitude is null and latitude is null"
: " and longitude is not null and latitude is not null";
for (int i = 0; i < n_assets; i++) {
queryString += "(select * from asset_data where device_address=:asset_"
+ String.valueOf(i)
+ gpsQuery
+ " order by timestamp DESC limit :trail)";
if (n_assets > 1) {
if (i < (device_address_list.size() - 1)) {
queryString += " UNION ";
} else {
queryString += " order by device_address";
}
}
}
Session currentSession = currentSession();
String tenant = currentSession.getTenantIdentifier();
//Session session = null;
List<Asset_Data> r;
try{
//session = this.factory.withOptions().tenantIdentifier(tenant).openSession();
currentSession.setDefaultReadOnly(true);
Query query = currentSession.createSQLQuery(queryString).addEntity(Asset_Data.class);
query.setParameter("trail", trail);
for (int i = 0; i < device_address_list.size(); i++) {
query.setParameter("asset_" + String.valueOf(i),
device_address_list.get(i));
}
r = list(query);
}finally {
if(currentSession!=null)
{
//session.close();
currentSession.flush();
currentSession.setDefaultReadOnly(false);
}
}
return r;
}
And this is the error I get
ERROR [2022-08-26 03:59:14,854] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: 6a1e93a98391cc97
! java.lang.IllegalArgumentException: Can't convert object of type org.postgresql.util.PGobject
! at org.hibernate.spatial.dialect.postgis.PGGeometryValueExtractor.toJTS(PGGeometryValueExtractor.java:113) ~[hibernate-spatial-4.3.jar:4.3.0.Final]
! at org.hibernate.spatial.dialect.AbstractJTSGeometryValueExtractor.doExtract(AbstractJTSGeometryValueExtractor.java:50) ~[hibernate-spatial-4.3.jar:4.3.0.Final]
! at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.getRow(Loader.java:1514) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:725) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.processResultSet(Loader.java:952) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.doQuery(Loader.java:920) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.doList(Loader.java:2553) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.doList(Loader.java:2539) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.Loader.list(Loader.java:2364) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:353) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1873) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:311) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:141) ~[hibernate-core-4.3.5.Final.jar:4.3.5.Final]
! at io.dropwizard.hibernate.AbstractDAO.list(AbstractDAO.java:124) ~[classes/:na]
! at com.cliftonlabs.trakit_api_bundle.db.Asset_DataDAO.findMostRecentByAsset_IDList(Asset_DataDAO.java:165) ~[classes/:na]
! at com.cliftonlabs.trakit.appapi.resources.LiveResource.listMsgs(LiveResource.java:108) ~[classes/:na]
! at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
! at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
! at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
! at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
! at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.codahale.metrics.jersey.InstrumentedResourceMethodDispatchProvider$TimedRequestDispatcher.dispatch(InstrumentedResourceMethodDispatchProvider.java:30) ~[metrics-jersey-3.0.2.jar:3.0.2]
! at io.dropwizard.hibernate.UnitOfWorkRequestDispatcher.dispatch(UnitOfWorkRequestDispatcher.java:92) ~[classes/:na]
! at io.dropwizard.jersey.guava.OptionalResourceMethodDispatchAdapter$OptionalRequestDispatcher.dispatch(OptionalResourceMethodDispatchAdapter.java:37) ~[dropwizard-jersey-0.7.1.jar:0.7.1]
! at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) ~[jersey-server-1.18.1.jar:1.18.1]
! at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) ~[jersey-servlet-1.18.1.jar:1.18.1]
! at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540) ~[jersey-servlet-1.18.1.jar:1.18.1]
! at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715) ~[jersey-servlet-1.18.1.jar:1.18.1]
! at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) ~[javax.servlet-3.0.0.v201112011016.jar:na]
! at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49) ~[dropwizard-jetty-0.7.1.jar:0.7.1]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1515) ~[jetty-servlet-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83) ~[jetty-servlets-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:348) ~[jetty-servlets-9.0.7.v20131107.jar:9.0.7.v20131107]
! at io.dropwizard.jetty.BiDiGzipFilter.doFilter(BiDiGzipFilter.java:127) ~[dropwizard-jetty-0.7.1.jar:0.7.1]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486) ~[jetty-servlet-9.0.7.v20131107.jar:9.0.7.v20131107]
! at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:29) ~[dropwizard-servlets-0.7.1.jar:0.7.1]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486) ~[jetty-servlet-9.0.7.v20131107.jar:9.0.7.v20131107]
! at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:44) ~[dropwizard-jersey-0.7.1.jar:0.7.1]
! at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39) ~[dropwizard-jersey-0.7.1.jar:0.7.1]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486) ~[jetty-servlet-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:248) ~[jetty-servlets-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:211) ~[jetty-servlets-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486) ~[jetty-servlet-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519) ~[jetty-servlet-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448) ~[jetty-servlet-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:175) ~[metrics-jetty9-3.0.2.jar:3.0.2]
! at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51) ~[dropwizard-jetty-0.7.1.jar:0.7.1]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:92) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:162) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.Server.handle(Server.java:446) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:271) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
! at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:246) ~[jetty-server-9.0.7.v20131107.jar:9.0.7.v20131107]
These are the dependencies in my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cliftonlabs</groupId>
<artifactId>trakitng_app_api</artifactId>
<version>1.7.1-SNAPSHOT</version>
<scm>
<connection>scm:git:https://git.cliftonlabs.com/trak-it/app-api.git</connection>
<url>https://git.cliftonlabs.com/trak-it/app-api.git</url>
</scm>
<repositories>
<repository>
<id>OSGEO GeoTools repo</id>
<url>https://download.osgeo.org/webdav/geotools</url>
</repository>
<repository>
<id>Hibernate Spatial repo</id>
<url>https://www.hibernatespatial.org/repository</url>
</repository>
</repositories>
<dependencies>
<!-- VScode only -->
<dependency>
<groupId>com.cliftonlabs</groupId>
<artifactId>trakit_api_bundle</artifactId>
<version>1.3.5-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/../trakit-api-bundle/target/trakit_api_bundle-1.3.5-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-hibernate</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-spdy</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-auth</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-assets</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-migrations</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-views-freemarker</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-views-mustache</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.178</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-testing</artifactId>
<version>${dropwizard.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jackson</artifactId>
<version>0.9.0-rc2</version>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.4.0</version>
</dependency>
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
<version>0.3m</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>com.google.code.geocoder-java</groupId>
<artifactId>geocoder-java</artifactId>
<version>0.9</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>0.12.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>com.yammer.dropwizard</groupId> -->
<!-- <artifactId>dropwizard-core</artifactId> -->
<!-- <version>0.6.2</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>net.logstash.logback</groupId> -->
<!-- <artifactId>logstash-logback-encoder</artifactId> -->
<!-- <version>3.4</version> -->
<!-- </dependency> -->
<dependency>
<groupId>net.devlab722</groupId>
<artifactId>logstash-logback-encoder-bundle</artifactId>
<version>0.6.2</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>io.federecio</groupId>
<artifactId>dropwizard-swagger</artifactId>
<version>0.5.2</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.18.1</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jdbi</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sns</artifactId>
<version>1.10.44</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>9.0.7.v20131107</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.0.7.v20131107</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<version>8.1.14.v20131031</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-server</artifactId>
<version>9.0.7.v20131107</version>
</dependency>
<dependency>
<groupId>com.bendb.dropwizard</groupId>
<artifactId>dropwizard-redis</artifactId>
<version>1.0.0-0</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jackson</artifactId>
<version>0.9.0-rc2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
<version>2.8.4</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>${amazon.aws.sdk.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>${amazon.aws.sdk.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
<version>2.8.4</version>
<type>jar</type>
</dependency>
<!--<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>${amazon.aws.sdk.version}</version>
</dependency> -->
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.18.1</version>
</dependency>
</dependencies>
<properties>
<dropwizard.version>0.7.1</dropwizard.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<amazon.aws.sdk.version>1.10.77</amazon.aws.sdk.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.6</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.cliftonlabs.trakit.appapi.AppApiApplication</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId>
<executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal>
</goals> </execution> </executions> </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>../trakit-api-bundle/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<shortRevisionLength>6</shortRevisionLength>
<format>{0}_{1,date,yyyy-MM-dd_HH.mm.ss}</format>
<items>
<item>scmVersion</item>
<item>timestamp</item>
</items>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}-${project.version}_${buildNumber}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>version.txt</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>version.txt</exclude>
</excludes>
</resource>
</resources>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
build-helper-maven-plugin
</artifactId>
<versionRange>
[1.9.1,)
</versionRange>
<goals>
<goal>add-source</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Can anybody tell me where I'm wrong please.
Thanks.