java - Add attachment in existing Jira Issue -


please me attach file in existing issue using jira java rest client.

my java code

fileinputstream filestreampath=new fileinputstream("c:\\users\\eswaranr\\downloads\\complete program.doc"); final issue issue = restclient.getissueclient().getissue("cps-150", pm); restclient.getissueclient().addattachment(pm, issue.getattachmentsuri(), filestreampath, "complete program.doc");   

my pom.xml

<dependencies>      <dependency>         <groupid>junit</groupid>         <artifactid>junit</artifactid>         <version>3.8.1</version>         <scope>test</scope>     </dependency>     <dependency>         <groupid>org.apache.commons</groupid>         <artifactid>commons-codec</artifactid>         <version>1.7</version>     </dependency>      <dependency>         <groupid>com.google.common</groupid>         <artifactid>guava</artifactid>         <version>14.0-rc1</version>     </dependency>      <dependency>         <groupid>org.codehaus.jettison</groupid>         <artifactid>jettison</artifactid>         <version>1.0.1</version>     </dependency>      <dependency>         <groupid>org.apache.commons</groupid>         <artifactid>commons-logging</artifactid>         <version>4.0.6</version>     </dependency>      <dependency>         <groupid>org.apache.commons</groupid>         <artifactid>commons-httpclient</artifactid>         <version>3.1</version>     </dependency>      <dependency>         <groupid>com.sun.jersey</groupid>         <artifactid>jersey-apache-client</artifactid>         <version>1.9.1</version>     </dependency>      <dependency>         <groupid>com.sun.jersey</groupid>         <artifactid>jersey-core</artifactid>         <version>1.16</version>     </dependency>      <dependency>         <groupid>com.sun.jersey</groupid>         <artifactid>jersey-client</artifactid>         <version>1.17.1</version>     </dependency>      <dependency>         <groupid>com.sun.jersey</groupid>         <artifactid>jersey-bundle</artifactid>         <version>1.17</version>     </dependency>      <dependency>         <groupid>org.joda.time</groupid>         <artifactid>joda-time</artifactid>         <version>2.0</version>     </dependency>      <dependency>         <groupid>com.atlassian.jira</groupid>         <artifactid>jira-rest-java-client</artifactid>         <version>1.1-m02</version>     </dependency>     <dependency>         <groupid>au.com.bytecode</groupid>         <artifactid>opencsv</artifactid>         <version>2.3</version>     </dependency>     <dependency>         <groupid>com.sun.jersey.contribs</groupid>         <artifactid>jersey-multipart</artifactid>         <version>1.12</version>         <systempath>d:\jira\api\jersey-multipart-1.12.jar</systempath>         <scope>system</scope>     </dependency>     <dependency>         <groupid>org.codehaus.jackson</groupid>         <artifactid>jackson-core-asl</artifactid>         <version>1.9.6</version>     </dependency>     <dependency>         <groupid>org.codehaus.jackson</groupid>         <artifactid>jackson-mapper-asl</artifactid>         <version>1.9.6</version>     </dependency>     <dependency>         <groupid>org.codehaus.jackson</groupid>         <artifactid>jackson-jaxrs</artifactid>         <version>1.9.6</version>     </dependency>     <dependency>         <groupid>org.codehaus.jackson</groupid>         <artifactid>jackson-xc</artifactid>         <version>1.9.6</version>     </dependency>     <dependency>         <groupid>org.jvnet</groupid>         <artifactid>mimepull</artifactid>         <version>1.6</version>     </dependency>  </dependencies> 

and getting following error:

jul 11, 2013 12:44:57 pm com.sun.jersey.api.client.requestwriter$requestentitywriterimpl <init> severe: message body writer java class com.sun.jersey.multipart.multipart, , java type class com.sun.jersey.multipart.multipart, , mime media type multipart/form-data; boundary=boundary_1_1319874444_1373526897746 not found jul 11, 2013 12:44:57 pm com.sun.jersey.api.client.requestwriter$requestentitywriterimpl <init> severe: registered message body writers compatible mime media type are: */* ->   com.sun.jersey.core.impl.provider.entity.formprovider   com.sun.jersey.core.impl.provider.entity.stringprovider   com.sun.jersey.core.impl.provider.entity.bytearrayprovider   com.sun.jersey.core.impl.provider.entity.fileprovider   com.sun.jersey.core.impl.provider.entity.inputstreamprovider   com.sun.jersey.core.impl.provider.entity.datasourceprovider   com.sun.jersey.core.impl.provider.entity.xmljaxbelementprovider$general   com.sun.jersey.core.impl.provider.entity.readerprovider   com.sun.jersey.core.impl.provider.entity.documentprovider   com.sun.jersey.core.impl.provider.entity.streamingoutputprovider   com.sun.jersey.core.impl.provider.entity.sourceprovider$sourcewriter   com.sun.jersey.json.impl.provider.entity.jsonjaxbelementprovider$general   com.sun.jersey.json.impl.provider.entity.jsonarrayprovider$general   com.sun.jersey.json.impl.provider.entity.jsonobjectprovider$general   com.sun.jersey.json.impl.provider.entity.jsonwithpaddingprovider   com.sun.jersey.core.impl.provider.entity.xmlrootelementprovider$general   com.sun.jersey.core.impl.provider.entity.xmllistelementprovider$general   com.sun.jersey.json.impl.provider.entity.jsonrootelementprovider$general   com.sun.jersey.json.impl.provider.entity.jsonlistelementprovider$general   com.sun.jersey.json.impl.provider.entity.jacksonproviderproxy 

i dont know want overcome issue.
can 1 tell me missed in code?

changed pom.xml dependencies follwoing pom.xml , working fine

https://maven-us.nuxeo.org/nexus/content/groups/public/com/atlassian/jira/jira-rest-java-client/1.1-m02/jira-rest-java-client-1.1-m02.pom


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -