java - issue with maven dependency? -



java - issue with maven dependency? -

trying execute twilio java api fails follows:

18:17:35.270 [main] debug o.a.h.c.protocol.requestaddcookies - cookiespec selected: best-match 18:17:35.296 [main] debug o.a.h.c.protocol.requestauthcache - auth cache not set in context 18:17:35.297 [main] debug o.a.h.impl.client.defaulthttpclient - reopening direct connection. 18:17:35.297 [main] debug o.a.h.impl.client.defaulthttpclient - effort 1 execute request java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ com.twilio.sdk.appengineclientconnection.flush(appengineclientconnection.java:197) @ org.apache.http.protocol.httprequestexecutor.dosendrequest(httprequestexecutor.java:258) @ org.apache.http.protocol.httprequestexecutor.execute(httprequestexecutor.java:123) @ org.apache.http.impl.client.defaultrequestdirector.tryexecute(defaultrequestdirector.java:645) @ org.apache.http.impl.client.defaultrequestdirector.execute(defaultrequestdirector.java:464) @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:820) @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:754) @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:732) @ com.twilio.sdk.twiliorestclient.request(twiliorestclient.java:410) @ com.twilio.sdk.twiliorestclient.saferequest(twiliorestclient.java:581) @ com.twilio.sdk.resource.list.messagelist.create(messagelist.java:70) @ ws.smssender.main(smssender.java:34) caused by: com.google.apphosting.api.apiproxy$callnotfoundexception: api bundle 'urlfetch' or phone call 'fetch()' not found. @ com.google.apphosting.api.apiproxy.makesynccall(apiproxy.java:98) @ com.google.appengine.api.urlfetch.urlfetchserviceimpl.fetch(urlfetchserviceimpl.java:37) ... 16 more 18:17:35.334 [main] debug o.a.h.impl.client.defaulthttpclient - closing connection.

i think has dependency issue in maven. here's pom.xml:

<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.wat</groupid> <artifactid>ws</artifactid> <version>0.0.1-snapshot</version> <packaging>jar</packaging> <name>ws</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <repositories> <repository> <id>foursquareapijava</id> <name>foursquare v2 api java repository</name> <url>http://foursquare-api-java.googlecode.com/svn/repository</url> </repository> </repositories> <dependencies> <dependency> <groupid>com.yammer.dropwizard</groupid> <artifactid>dropwizard-core</artifactid> <version>0.6.2</version> </dependency> <dependency> <groupid>com.yammer.dropwizard</groupid> <artifactid>dropwizard-auth</artifactid> <version>0.6.2</version> </dependency> <dependency> <groupid>com.googlecode.libphonenumber</groupid> <artifactid>libphonenumber</artifactid> <version>6.1</version> </dependency> <dependency> <groupid>net.vz.mongodb.jackson</groupid> <artifactid>mongo-jackson-mapper</artifactid> <version>1.4.2</version> </dependency> <dependency> <groupid>com.twilio.sdk</groupid> <artifactid>twilio-java-sdk</artifactid> <version>3.4.5</version> <scope>compile</scope> </dependency> <dependency> <groupid>org.mongodb</groupid> <artifactid>mongo-java-driver</artifactid> <version>2.12.0-rc2</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.datatype</groupid> <artifactid>jackson-datatype-joda</artifactid> <version>2.1.1</version> </dependency> <dependency> <groupid>fi.foyt</groupid> <artifactid>foursquare-api</artifactid> <version>1.0.2</version> </dependency> <dependency> <groupid>org.scribe</groupid> <artifactid>scribe</artifactid> <version>1.1.0</version> </dependency> <!-- <dependency> <groupid>org.apache.mahout</groupid> <artifactid>mahout-core</artifactid> <version>0.9</version> </dependency> <dependency> <groupid>org.apache.mahout</groupid> <artifactid>mahout-integration</artifactid> <version>0.9</version> </dependency> --> </dependencies> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.3.2</version> <configuration> <archive> <manifest> <adddefaultimplementationentries>true</adddefaultimplementationentries> </manifest> </archive> </configuration> </plugin> <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>ws.wsservice</mainclass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>

here's output mvn dependency:tree -dverbose

last login: tue jun 24 18:09:15 on ttys002 $ mvn dependency:tree -dverbose [info] scanning projects... [info] [info] using builder org.apache.maven.lifecycle.internal.builder.singlethreaded.singlethreadedbuilder thread count of 1 [info] [info] ------------------------------------------------------------------------ [info] building ws 0.0.1-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- maven-dependency-plugin:2.8:tree (default-cli) @ ws --- [info] com.wat:ws:jar:0.0.1-snapshot [info] +- com.yammer.dropwizard:dropwizard-core:jar:0.6.2:compile [info] | +- com.sun.jersey:jersey-core:jar:1.17.1:compile [info] | +- com.sun.jersey:jersey-server:jar:1.17.1:compile [info] | | +- asm:asm:jar:3.1:compile [info] | | \- (com.sun.jersey:jersey-core:jar:1.17.1:compile - omitted duplicate) [info] | +- com.sun.jersey:jersey-servlet:jar:1.17.1:compile [info] | | \- (com.sun.jersey:jersey-server:jar:1.17.1:compile - omitted duplicate) [info] | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile [info] | | \- (org.slf4j:slf4j-api:jar:1.7.2:compile - omitted conflict 1.7.4) [info] | +- com.yammer.metrics:metrics-servlet:jar:2.2.0:compile [info] | | +- (com.yammer.metrics:metrics-core:jar:2.2.0:compile - omitted duplicate) [info] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.1.1:compile - omitted conflict 2.1.4) [info] | +- com.yammer.metrics:metrics-jetty:jar:2.2.0:compile [info] | | +- (com.yammer.metrics:metrics-core:jar:2.2.0:compile - omitted duplicate) [info] | | \- (org.eclipse.jetty:jetty-server:jar:8.1.8.v20121106:compile - omitted conflict 8.1.10.v20130312) [info] | +- com.yammer.metrics:metrics-logback:jar:2.2.0:compile [info] | | +- (com.yammer.metrics:metrics-core:jar:2.2.0:compile - omitted duplicate) [info] | | +- (ch.qos.logback:logback-core:jar:1.0.7:compile - omitted conflict 1.0.10) [info] | | \- (ch.qos.logback:logback-classic:jar:1.0.7:compile - omitted conflict 1.0.10) [info] | +- com.yammer.metrics:metrics-jersey:jar:2.2.0:compile [info] | | +- (com.yammer.metrics:metrics-core:jar:2.2.0:compile - omitted duplicate) [info] | | +- com.yammer.metrics:metrics-annotation:jar:2.2.0:compile [info] | | \- (com.sun.jersey:jersey-server:jar:1.15:compile - omitted conflict 1.17.1) [info] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.1.4:compile [info] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.4:compile [info] | | \- (com.fasterxml.jackson.core:jackson-core:jar:2.1.4:compile - omitted conflict 2.1.1) [info] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.1.4:compile [info] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.1.4:compile - omitted duplicate) [info] | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.1.4:compile - omitted duplicate) [info] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.1.4:compile [info] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.1.4:compile - omitted duplicate) [info] | | \- (com.fasterxml.jackson.core:jackson-databind:jar:2.1.4:compile - omitted duplicate) [info] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.1.4:compile [info] | | \- (com.fasterxml.jackson.core:jackson-core:jar:2.1.4:compile - omitted duplicate) [info] | +- com.fasterxml.jackson.datatype:jackson-datatype-guava:jar:2.1.2:compile [info] | | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.1.2:compile - omitted conflict 2.1.4) [info] | | +- (com.fasterxml.jackson.core:jackson-core:jar:2.1.2:compile - omitted conflict 2.1.4) [info] | | \- (com.google.guava:guava:jar:11.0.2:compile - omitted conflict 14.0.1) [info] | +- net.sourceforge.argparse4j:argparse4j:jar:0.4.0:compile [info] | +- org.slf4j:slf4j-api:jar:1.7.4:compile [info] | +- org.slf4j:jul-to-slf4j:jar:1.7.4:compile [info] | | \- (org.slf4j:slf4j-api:jar:1.7.4:compile - omitted duplicate) [info] | +- ch.qos.logback:logback-core:jar:1.0.10:compile [info] | +- ch.qos.logback:logback-classic:jar:1.0.10:compile [info] | | +- (ch.qos.logback:logback-core:jar:1.0.10:compile - omitted duplicate) [info] | | \- (org.slf4j:slf4j-api:jar:1.7.2:compile - omitted conflict 1.7.4) [info] | +- org.slf4j:log4j-over-slf4j:jar:1.7.4:compile [info] | | \- (org.slf4j:slf4j-api:jar:1.7.4:compile - omitted duplicate) [info] | +- org.eclipse.jetty:jetty-server:jar:8.1.10.v20130312:compile [info] | | +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:compile [info] | | +- org.eclipse.jetty:jetty-continuation:jar:8.1.10.v20130312:compile [info] | | \- (org.eclipse.jetty:jetty-http:jar:8.1.10.v20130312:compile - omitted duplicate) [info] | +- org.eclipse.jetty:jetty-servlet:jar:8.1.10.v20130312:compile [info] | | \- org.eclipse.jetty:jetty-security:jar:8.1.10.v20130312:compile [info] | | \- (org.eclipse.jetty:jetty-server:jar:8.1.10.v20130312:compile - omitted duplicate) [info] | +- org.eclipse.jetty:jetty-http:jar:8.1.10.v20130312:compile [info] | | \- org.eclipse.jetty:jetty-io:jar:8.1.10.v20130312:compile [info] | | \- org.eclipse.jetty:jetty-util:jar:8.1.10.v20130312:compile [info] | +- com.google.guava:guava:jar:14.0.1:compile [info] | +- com.google.code.findbugs:jsr305:jar:2.0.1:compile [info] | +- org.hibernate:hibernate-validator:jar:4.3.1.final:compile [info] | | +- javax.validation:validation-api:jar:1.0.0.ga:compile [info] | | \- org.jboss.logging:jboss-logging:jar:3.1.0.cr2:compile [info] | +- joda-time:joda-time:jar:2.2:compile [info] | \- (com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.1.2:compile - omitted conflict 2.1.1) [info] +- com.yammer.dropwizard:dropwizard-auth:jar:0.6.2:compile [info] | \- (com.yammer.dropwizard:dropwizard-core:jar:0.6.2:compile - omitted duplicate) [info] +- com.googlecode.libphonenumber:libphonenumber:jar:6.1:compile [info] +- net.vz.mongodb.jackson:mongo-jackson-mapper:jar:1.4.2:compile [info] | +- (org.mongodb:mongo-java-driver:jar:2.7.2:compile - omitted conflict 2.12.0-rc2) [info] | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.3:compile (version managed 1.9.5) [info] | | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.3:compile [info] | +- de.undercouch:bson4jackson:jar:1.3.0:compile [info] | | +- (org.codehaus.jackson:jackson-core-asl:jar:1.7.4:compile - omitted conflict 1.9.3) [info] | | \- (org.codehaus.jackson:jackson-mapper-asl:jar:1.9.3:compile - version managed 1.7.4; omitted duplicate) [info] | \- javax.persistence:persistence-api:jar:1.0.2:compile [info] +- com.twilio.sdk:twilio-java-sdk:jar:3.4.5:compile [info] | +- org.apache.httpcomponents:httpclient:jar:4.1.2:compile [info] | | +- org.apache.httpcomponents:httpcore:jar:4.1.2:compile [info] | | +- commons-logging:commons-logging:jar:1.1.1:compile [info] | | \- (commons-codec:commons-codec:jar:1.4:compile - omitted duplicate) [info] | +- commons-lang:commons-lang:jar:2.6:compile [info] | +- com.googlecode.json-simple:json-simple:jar:1.1:compile [info] | \- (org.codehaus.jackson:jackson-mapper-asl:jar:1.9.3:compile - version managed 1.7.4; omitted duplicate) [info] +- org.mongodb:mongo-java-driver:jar:2.12.0-rc2:compile [info] +- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.1.1:compile [info] | +- com.fasterxml.jackson.core:jackson-core:jar:2.1.1:compile [info] | +- (com.fasterxml.jackson.core:jackson-databind:jar:2.1.1:compile - omitted conflict 2.1.4) [info] | \- (joda-time:joda-time:jar:2.1:compile - omitted conflict 2.2) [info] +- fi.foyt:foursquare-api:jar:1.0.2:compile [info] | +- org.json:json:jar:20090211:compile [info] | \- com.google.appengine:appengine-api-1.0-sdk:jar:1.6.5:compile [info] \- org.scribe:scribe:jar:1.1.0:compile [info] \- commons-codec:commons-codec:jar:1.4:compile [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 3.901 s [info] finished at: 2014-06-24t18:41:27-08:00 [info] final memory: 12m/183m [info] ------------------------------------------------------------------------ $

and code beingness executed:

package ws; import com.twilio.sdk.twiliorestclient; import com.twilio.sdk.twiliorestexception; import com.twilio.sdk.twiliorestresponse; import com.twilio.sdk.resource.factory.callfactory; import com.twilio.sdk.resource.factory.messagefactory; import com.twilio.sdk.resource.instance.*; import com.twilio.sdk.resource.list.accountlist; import com.twilio.sdk.resource.list.availablephonenumberlist; import com.twilio.sdk.resource.list.participantlist; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import java.util.*; public class smssender { // find business relationship sid , token @ twilio.com/user/account public static final string account_sid = "<hidden>"; public static final string auth_token = "<hidden>"; public static void main(string[] args) throws twiliorestexception { twiliorestclient client = new twiliorestclient(account_sid, auth_token); business relationship mainaccount = client.getaccount(); // send sms (using new messages endpoint) messagefactory messagefactory = mainaccount.getmessagefactory(); list<namevaluepair> messageparams = new arraylist<namevaluepair>(); messageparams.add(new basicnamevaluepair("to", "+hidden")); // replace valid phone number messageparams.add(new basicnamevaluepair("from", "+hidden")); // replace valid phone // number in business relationship messageparams.add(new basicnamevaluepair("body", "this test message!")); messagefactory.create(messageparams); } }

any ideas?

from twilio:

hi matthew,

thanks checking us.

it looks "foursquare-api" bringing in "appengine-api-1.0-sdk" dependency.

[info] +- fi.foyt:foursquare-api:jar:1.0.2:compile [info] | +- org.json:json:jar:20090211:compile [info] | \- com.google.appengine:appengine-api-1.0-sdk:jar:1.6.5:compile

you can seek excluding dependency, expect break "foursquare-api" library.

"twilio-java" not have hard dependency on app engine reason.

please allow know if have other questions.

alex chan twilio client back upwards www.twilio.com

updated pom.xml follows:

<dependency> <groupid>fi.foyt</groupid> <artifactid>foursquare-api</artifactid> <version>1.0.2</version> <exclusions> <exclusion> <!-- declare exclusion here --> <groupid>com.google.appengine</groupid> <artifactid>appengine-api-1.0-sdk</artifactid> </exclusion> </exclusions> </dependency>

java maven twilio

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -