I'm trying to deploy my custom plugin to jira and then the error occurs:
java.lang.ClassCastException: org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl cannot be cast to javax.xml.datatype.DatatypeFactory
The project is build with Maven and if I remove and exclude every
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
dependency
// I just paniced :)
logs inform about ClassNotFoundException
I have no idea what to do, so can anybody help?
Actually, I have no idea why this bug occured, but I rolled back and reconfigured all my pom files, and I believe that the issue was in incorrect api dependency. It concerns QuickBooks API v3, and now it works fine with
<dependency>
<groupId>com.intuit.code.devkit.v3</groupId>
<artifactId>ipp-v3-java-devkit</artifactId>
<version>2.3.2</version>
<scope>compile</scope>
</dependency>
And, probably, the problem was in one one these dependencies
<dependency>
<groupId>com.intuit</groupId>
<artifactId>ipp-java-devkit</artifactId>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>com.intuit.code.devkit</groupId>
<artifactId>ipp-java-qbhelper</artifactId>
<version>1.1.0</version>
</dependency>
Related
The pom for my main project declares a version of hadoop-client. A dependency declares a different version of hadoop-client. Which one actually ends up being used?
pom.xml for my main project:
<dependency>
<groupId>com.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.7.0</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.myown.group</groupId>
<artifactId>my-own-artifact</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
pom.xml for the library that my main project depends on:
<dependency>
<groupId>com.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.5.0</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Maven has a complex set of rules for version resolution, summarized as 'nearest wins'. One source of details is this post here. You can find out what Maven decided by using mvn dependency:list or mvn dependency:tree.
I have an existing dropwizard 0.7.0 service which I would like to document using Swagger. I am using the followind dependency for swagger from https://github.com/wordnik/swagger-core/wiki/JavaDropwizard-Quickstart
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.10</artifactId>
<version>1.3.0</version>
</dependency>
However when I add that dependency I get the following error:
java.lang.NoClassDefFoundError: com/google/common/collect/FluentIterable
at com.fasterxml.jackson.datatype.guava.GuavaTypeModifier.modifyType(GuavaTypeModifier.java:38)
The following post was helpful but my issue is with the dependencies.
How to use swagger with dropwizard .0.7.0
What should my POM contain? My dropwizard dependency is:
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>0.7.0</version>
</dependency>
Thank you
try this -
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.10</artifactId>
<version>1.3.5</version>
<exclusions>
<exclusion>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
</exclusion>
<exclusion>
<artifactId>commons-lang</artifactId>
<groupId>commons-lang</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
<exclusion>
<artifactId>paranamer</artifactId>
<groupId>com.thoughtworks.paranamer</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-databind</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<artifactId>javassist</artifactId>
<groupId>org.javassist</groupId>
</exclusion>
<exclusion>
<artifactId>joda-time</artifactId>
<groupId>joda-time</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
You need guava library during runtime, so add
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>17.0</version>
</dependency>
For swagger spec 2.0, please see the updated sample here:
https://github.com/swagger-api/swagger-core/tree/develop_2.0/samples/java-dropwizard
It has an updated application class for use with the 1.5.1-M1 swagger-core.
Use dropwizard-swagger.
Look at the Version Matrix in the Swagger's GitHub page. It includes this:
dropwizard-swagger Dropwizard Swagger API Swagger UI
----------------------------------------------------------
< 0.5 0.7.x 1.3.2 ?
0.5.x 0.7.x 1.3.12 v2.1.4-M1
0.6.x 0.8.0 1.3.12 v2.1.4-M1
0.7.x 0.8.0 1.5.1-M2 v2.1.4-M1
In your case you simply need :
<dependency>
<groupId>com.federecio</groupId>
<artifactId>dropwizard-swagger</artifactId>
<version>0.4</version>
</dependency>
I'm trying to upgrade the EJB module to work with JBoss AS 7 and after including all the libraries I thought might make a difference I'm sitll getting this error:
Error(20,33): package org.jboss.ejb3.annotation does not exist
on:
import org.jboss.ejb3.annotation.TransactionTimeout;
Can anyone tell me how to fix this?
Are you using Maven? If so, adding these dependencies to your POM may be helpful:
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>crc-jboss-client-all</artifactId>
<type>pom</type>
<version>5.1.0.GA</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.slf4j</groupId>
<artifactId>slf4j-jboss-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
Although you were using JDeveloper; I had the same issue doing a build with Maven. The dependency comes from jboss-annotations-ejb3.
Jon's answer didn't match the dependencies for jboss-annotations-ejb3. Therefore for Maven I added this to the pom.xml. May help some others.
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-annotations-ejb3</artifactId>
<version>4.2.2.GA</version>
</dependency>
I've seen some similar answer to this question perhaps but I feel my situation is different. I'm developing a spring MVC app working great so far, that is I included hadoop api in my project, when I included hadoop this exception started happening when I am trying to open the initial dashboard page which worked previously :
java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/
ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
org.apache.jsp.ServerInfo_jsp._jspInit(ServerInfo_jsp.java:63)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:158)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:9
Here is how my hadoop dependency looks like :
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>0.23.1-mr1-cdh4.0.0b2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>0.23.1-mr1-cdh4.0.0b2</version>
<exclusions>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
Once I add this to my app it's no longer usable and naturally without these dependecies things run very smooth. What am I missing here?
I think that your problem is that hadoop is including a version of the servlet API which is coming before the "correct" servlet API in the classpath. Hadoop has dependencies on Jetty, and jetty will in turn try to include a servlet API.
I have a project with a very similar setup, Spring MVC and Hadoop. I have the below exclusions for the hadoop dependency. Note that this might vary slightly depending on your hadoop distribution, I am using cloudera's. Since the servlet container you are using will usually ship with its own javax.servlet dependency, your exclusion needs to catch this case. I have only tested the below configuration with Jetty:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>${hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-api-2.1</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api-2.1</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
<exclusion>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler</artifactId>
</exclusion>
<exclusion>
<groupId>tomcat</groupId>
<artifactId>jasper-runtime</artifactId>
</exclusion>
<!-- other exclusions snipped for brevity -->
I recently had a similar experience with hadoop-core 1.2.1 in my web application. On top of the dependencies Paul Sanwald indicated, I excluded some org.eclipse.jetty dependendencies:
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-plus</artifactId>
</exclusion>
It's not completely clear to me whether every one of these had to be excluded, but I wanted to be sure no unneeded dependencies were getting in - I'm using Tomcat, which provides JSP and servlet libraries. jetty-servlet definitely had to go.
Mina seems to be deploying their artifacts as *.bundle files these days, which, at the very least, is annoying and at best downright evil.
If I depend on Mina in Maven like this:
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>${mina.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-beans</artifactId>
<version>${mina.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-jmx</artifactId>
<version>${mina.version}</version>
<type>jar</type>
</dependency>
...then I get the following error:
Multiple annotations found at this line:
- Missing artifact org.apache.mina:mina-integration-ognl:bundle:2.0.4
- Missing artifact org.apache.mina:mina-core:bundle:2.0.4
- Missing artifact org.apache.mina:mina-integration-beans:bundle:2.0.4
I'm not sure why it's still looking for *.bundle files instead of *.jar files. Why is it not looking for and finding the JAR files?
This is especially frustrating because I have projects which depend on this project and they all fail without the Mina JARs. Whatever happened to good-old Java JARs?
First i have found out that using only the core it works without any problem, but if you start to use mina-integration-bean or mina-integration-jmx you will get the problem. Furthermore i have found the following issue in the JIRA tracker of Mina project which exactly states your problem.
On the other hand you can exclude those bundle dependencies in maven like this:
<dependencies>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>2.0.4</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-beans</artifactId>
<version>2.0.4</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-ognl</artifactId>
<version>2.0.4</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-beans</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-jmx</artifactId>
<version>2.0.4</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.mina</groupId>
<artifactId>mina-integration-ognl</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>