Astyanax deployment fails on Tomcat 7 #256

Closed
marko-asplund opened this Issue Mar 28, 2013 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

marko-asplund commented Mar 28, 2013

When I create a Maven based webapp project that uses Astyanax client the app fails to deploy on Tomcat 7 because servlet-api.jar is pulled in as a transitive dependency. Here's the error message:

INFO: Deploying web application archive /Users/foo/projects/abc/apache-tomcat-7.0.37/webapps/abc-profile-service.war
Mar 28, 2013 1:15:52 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/Users/foo/projects/abc/apache-tomcat-7.0.37/webapps/abc-profile-service/WEB-INF/lib/servlet-api-2.5-20081211.j
ar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Mar 28, 2013 1:15:52 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/Users/foo/projects/abc/apache-tomcat-7.0.37/webapps/abc-profile-service/WEB-INF/lib/servlet-api-2.5.jar) - jar
not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Contributor

marko-asplund commented Mar 29, 2013

Here's a list of dependencies that get pulled in just by the basic Astyanax client libs:

antlr-2.7.7.jar
antlr-3.2.jar
antlr-runtime-3.2.jar
astyanax-cassandra-1.56.31.jar
astyanax-core-1.56.31.jar
astyanax-recipes-1.56.31.jar
astyanax-thrift-1.56.31.jar
avro-1.4.0-cassandra-1.jar
cassandra-all-1.2.3.jar
cassandra-thrift-1.2.3.jar
commons-cli-1.1.jar
commons-codec-1.5.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
compress-lzf-0.8.4.jar
concurrentlinkedhashmap-lru-1.3.jar
guava-11.0.1.jar
high-scale-lib-1.1.2.jar
httpclient-4.0.1.jar
httpcore-4.0.1.jar
jackson-core-asl-1.9.2.jar
jackson-mapper-asl-1.9.2.jar
jamm-0.2.5.jar
jbcrypt-0.3m.jar
jettison-1.2.jar
jetty-6.1.22.jar
jetty-util-6.1.22.jar
jline-1.0.jar
joda-time-1.6.2.jar
json-simple-1.1.jar
jsr305-1.3.9.jar
libthrift-0.7.0.jar
log4j-1.2.16.jar
logback-classic-1.0.9.jar
logback-core-1.0.9.jar
lz4-1.1.0.jar
metrics-core-2.0.3.jar
netty-3.2.4.Final.jar
org.apache.servicemix.bundles.commons-csv-1.0-r706900_3.jar
servlet-api-2.5-20081211.jar
servlet-api-2.5.jar
slf4j-api-1.7.2.jar
slf4j-log4j12-1.7.2.jar
snakeyaml-1.6.jar
snappy-java-1.0.4.1.jar
snaptree-0.1.jar
stax-api-1.0.1.jar
stringtemplate-3.2.jar
uuid-3.2.jar

There's a lot of stuff and each can potentially cause conflicts for app developers.

I think the list of dependencies should be trimmed down to a minimum.

Contributor

marko-asplund commented Mar 29, 2013

This issue could be solved in Astyanax but also Cassandra could provide a utility API for client API providers.
Created an issue in Cassandra Jira:

https://issues.apache.org/jira/browse/CASSANDRA-5405

If you find this to be useful, please vote for the Jira issue.

elandau closed this Mar 30, 2013

Contributor

marko-asplund commented Mar 31, 2013

what was the resolution for this issue?

did you find it irrelevant?
or is it fixed in Astyanax?

Member

elandau commented Apr 1, 2013

I think it's irrelevant for Astyanax. Astyanax has to pull in cassandra as a dependency. I suppose you could exclude offending jars in your build system.

My understanding is that Astyanax as a client depends on the Thrift library and protocol. Does Astyanax need the Cassandra server libraries? May be as a starting point, enhance the dependency POM in Issue #266 with un needed as excludes. We can help with this with some guidance. Astyanax is a good library would benefit to tighten the dependencies and eliminate some of unneeded bloat.

@marko-asplund marko-asplund pushed a commit to marko-asplund/astyanax that referenced this issue Jun 26, 2013

marko asplund workaround for issue #256 453770b

@marko-asplund marko-asplund pushed a commit to marko-asplund/astyanax that referenced this issue Jun 26, 2013

marko asplund workaround for issue #256 273bd2c

@marko-asplund marko-asplund pushed a commit to marko-asplund/astyanax that referenced this issue Jun 26, 2013

marko asplund issue #256: update Cassandra classes list 45aa1bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment