Monday, 9 September 2013

Java: Massive Class Collision

Java: Massive Class Collision

I am working on a web service that talks to Apache HBase. The HBase Maven
artifact contains all sorts of web libraries, such as jersey-core, but I
am using Apache CXF. When I compile and run my app, I get a huge list of
JarClassLoader warnings. The result is I cannot initialize my class that
contains my HBase Connection.
$ java -jar target/myapp.one-jar.jar
JarClassLoader: Warning: Null manifest from input stream associated with:
lib/javax.inject-1.jar
JarClassLoader: Warning: org/apache/commons/collections/ArrayStack.class
in lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning: org/apache/commons/collections/Buffer.class in
lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/collections/BufferUnderflowException.class in
lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/collections/FastHashMap$1.class in
lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/collections/FastHashMap$CollectionView$CollectionViewIterator.class
in lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/collections/FastHashMap$CollectionView.class in
lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/collections/FastHashMap$EntrySet.class in
lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/collections/FastHashMap$KeySet.class in
lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/collections/FastHashMap$Values.class in
lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning: org/apache/commons/collections/FastHashMap.class
in lib/commons-collections-3.2.1.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/beanutils/BeanAccessLanguageException.class in
lib/commons-beanutils-1.7.0.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning:
org/apache/commons/beanutils/locale/LocaleBeanUtils$Descriptor.class in
lib/commons-beanutils-1.7.0.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning: org/apache/commons/beanutils/DynaProperty.class
in lib/commons-beanutils-1.7.0.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning: org/apache/commons/collections/FastHashMap.class
in lib/commons-beanutils-1.7.0.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
...
JarClassLoader: Warning: org/apache/commons/beanutils/LazyDynaClass.class
in lib/commons-beanutils-1.7.0.jar is hidden by
lib/commons-beanutils-core-1.8.3.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/Filter.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/FilterChain.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/FilterConfig.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/GenericServlet.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/http/Cookie.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
...
JarClassLoader: Warning: javax/servlet/Filter.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/FilterChain.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/FilterConfig.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/GenericServlet.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/http/Cookie.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/http/HttpServlet.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
JarClassLoader: Warning: javax/servlet/http/HttpServletRequest.class in
lib/servlet-api-2.5-6.1.14.jar is hidden by
lib/javax.servlet-3.0.0.v201112011016.jar (with different bytecode)
...
JarClassLoader: Warning: org/apache/jasper/EmbeddedServletOptions.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning: org/apache/jasper/JspC.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning: org/apache/jasper/JspCompilationContext.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning: org/apache/jasper/Options.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning: org/apache/jasper/compiler/BeanRepository.class
in lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar
(with different bytecode)
JarClassLoader: Warning:
org/apache/jasper/compiler/Collector$CollectVisitor.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning: org/apache/jasper/compiler/Collector.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning: org/apache/jasper/compiler/Compiler.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning:
org/apache/jasper/compiler/DefaultErrorHandler.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
JarClassLoader: Warning:
org/apache/jasper/compiler/Dumper$DumpVisitor.class in
lib/jasper-compiler-5.5.23.jar is hidden by lib/jsp-2.1-6.1.14.jar (with
different bytecode)
...
JarClassLoader: Warning: javax/ws/rs/Path.class in lib/jersey-core-1.8.jar
is hidden by lib/javax.ws.rs-api-2.0-m10.jar (with different bytecode)
JarClassLoader: Warning: javax/ws/rs/WebApplicationException.class in
lib/jersey-core-1.8.jar is hidden by lib/javax.ws.rs-api-2.0-m10.jar (with
different bytecode)
JarClassLoader: Warning: javax/ws/rs/core/Application.class in
lib/jersey-core-1.8.jar is hidden by lib/javax.ws.rs-api-2.0-m10.jar (with
different bytecode)
JarClassLoader: Warning: javax/ws/rs/core/CacheControl.class in
lib/jersey-core-1.8.jar is hidden by lib/javax.ws.rs-api-2.0-m10.jar (with
different bytecode)
JarClassLoader: Warning: javax/ws/rs/core/Cookie.class in
lib/jersey-core-1.8.jar is hidden by lib/javax.ws.rs-api-2.0-m10.jar (with
different bytecode)
JarClassLoader: Warning: javax/ws/rs/core/EntityTag.class in
lib/jersey-core-1.8.jar is hidden by lib/javax.ws.rs-api-2.0-m10.jar (with
different bytecode)
JarClassLoader: Warning: javax/ws/rs/core/GenericEntity.class in
lib/jersey-core-1.8.jar is hidden by lib/javax.ws.rs-api-2.0-m10.jar (with
different bytecode)
And my app blows up how do I fix this?

No comments:

Post a Comment