[
https://issues.apache.org/jira/browse/PHOENIX-3261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15496383#comment-15496383
]
Doug Holubek commented on PHOENIX-3261:
---------------------------------------
This issue can be closed.
For anyone who might be interested: my issue was I was using the
phoenix-4.4.0.2.3.4.0-3485-client.jar exported from the hortonworks cluster I'm
using. The fix was to use the core jar from the horton works repo and exclude
several packages. Below are the changes I made to my pom.xml file to get the
driver working in a java web app that has in Jersey 2 and CXF 3 without
classpath conflicts.
<phoenix.version>4.4.0.2.3.4.0-3485</phoenix.version>
...
<dependency>
<groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-core</artifactId>
<version>${phoenix.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<artifactId>jetty-util</artifactId>
<groupId>org.mortbay.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>jetty</artifactId>
<groupId>org.mortbay.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>jetty-sslengine</artifactId>
<groupId>org.mortbay.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>jersey-core</artifactId>
<groupId>com.sun.jersey</groupId>
</exclusion>
<exclusion>
<artifactId>jersey-server</artifactId>
<groupId>com.sun.jersey</groupId>
</exclusion>
<exclusion>
<artifactId>jersey-json</artifactId>
<groupId>com.sun.jersey</groupId>
</exclusion>
<exclusion>
<artifactId>jaxb-impl</artifactId>
<groupId>com.sun.xml.bind</groupId>
</exclusion>
</exclusions>
</dependency>
...
<repositories>
<repository>
<id>hortonworks</id>
<url>http://repo.hortonworks.com/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
> Phoenix includes a JAXB version that conflicts with CXF 3.0.x dependencies
> --------------------------------------------------------------------------
>
> Key: PHOENIX-3261
> URL: https://issues.apache.org/jira/browse/PHOENIX-3261
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.4.0
> Reporter: Doug Holubek
> Priority: Blocker
>
> Phoenix jars seem to bundle an older version of JAXB. The DEPENDENCIES file
> in the .jar's META-INF seems to show that Phoenix is including
> jaxb-impl-2.2.3-1. According to This CXF jira issue
> https://issues.apache.org/jira/browse/CXF-5894
> (with same exception stack trace) CXF needs 2.10.x or higher. Since Phoenix
> is built with the classes inside the jar I can't exclude Phoenix's older
> version of JAXB via Maven.
> (exert from DEPEDENCIES file inside Phoenix jar - seems to be the same across
> many Phoenix versions.)
> From: 'Oracle Corporation' (http://www.oracle.com/)
> - jersey-client (https://jersey.java.net/jersey-client/)
> com.sun.jersey:jersey-client:bundle:1.9
> License: CDDL 1.1 (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> License: GPL2 w/ CPE (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> - jersey-core (https://jersey.java.net/jersey-core/)
> com.sun.jersey:jersey-core:bundle:1.9
> License: CDDL 1.1 (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> License: GPL2 w/ CPE (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> - jersey-json (https://jersey.java.net/jersey-json/)
> com.sun.jersey:jersey-json:bundle:1.9
> License: CDDL 1.1 (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> License: GPL2 w/ CPE (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> - jersey-server (https://jersey.java.net/jersey-server/)
> com.sun.jersey:jersey-server:bundle:1.9
> License: CDDL 1.1 (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> License: GPL2 w/ CPE (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> - jersey-guice (https://jersey.java.net/jersey-contribs/jersey-guice/)
> com.sun.jersey.contribs:jersey-guice:jar:1.9
> License: CDDL 1.1 (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> License: GPL2 w/ CPE (http://glassfish.java.net/public/CDDL+GPL_1_1.html)
> - JAXB RI (http://jaxb.java.net/) com.sun.xml.bind:jaxb-impl:jar:2.2.3-1
> License: CDDL 1.1 (https://glassfish.java.net/public/CDDL+GPL_1_1.html)
> License: GPL2 w/ CPE (https://glassfish.java.net/public/CDDL+GPL_1_1.html)
> - JAXB API bundle for GlassFish V3 (https://jaxb.dev.java.net/)
> javax.xml.bind:jaxb-api:jar:2.2.2
> License: CDDL 1.1
> (https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html) License: GPL2 w/
> CPE (https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html)
> When trying to initialize a soap client with CXF 3.0.9 I get the following
> exception when staring my web application.
> Caused by: java.lang.NoSuchFieldError: REFLECTION
> at
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:93)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:473)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:319)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:248)
> at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:235)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:432)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
> at
> org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:347)
> at
> org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:345)
> at
> org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:246)
> at
> org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:472)
> at
> org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:327)
> at
> org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
> at
> org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:467)
> at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:712)
> at
> org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:527)
> at
> org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:261)
> at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
> at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
> at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
> at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)
> at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
> at
> org.apache.cxf.jaxws.spring.JaxWsProxyFactoryBeanDefinitionParser$JAXWSSpringClientProxyFactoryBean.create(JaxWsProxyFactoryBeanDefinitionParser.java:79)
> at
> org.apache.cxf.jaxws.spring.JaxWsProxyFactoryBeanDefinitionParser$JAXWSSpringClientProxyFactoryBean.getObject(JaxWsProxyFactoryBeanDefinitionParser.java:83)
> at
> org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
> ... 49 more
> As a side note there is a similar problem here:
> https://issues.apache.org/jira/browse/MAPREDUCE-6042?jql=text%20~%20%22jaxb%20conflict%22
> ...does Phoenix need jaxb to build? Can it be removed? If not can jaxb be a
> dependency in its pom.xml instead of included in a monolithic jar?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)