users@jersey.java.net

problem uploading file

From: captainbob <captainbob_at_free.fr>
Date: Wed, 14 Jul 2010 02:29:29 -0700 (PDT)

Hi,

i have a hard time trying to upload a file on my jersey server. I've
followed instruction from several sources without any succes.
My source code:

Client side:
<form action="http://localhost:8080/spiral-ws/assessment/uploadFile"
method="post" enctype="multipart/form-data">
<input type="file" name="file"/>
<button type="submit">Upload</button>
</form>

Server side:
@POST @Path("/uploadFile")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.TEXT_PLAIN)
public String upload(@FormDataParam("file") InputStream fileInpStr) throws
IOException {
          FileOutputStream fos = new FileOutputStream("myfile.tgz");
          IOUtils.copy(fileInpStr, fos);
       return "Done.";
}

Im using maven for this project, so according to
https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html#d4e1636
the jersey guide ,
I added the jersey-multipart dependency to my pom.xml.

But when my client contact my server im getting this error:

"java.lang.LinkageError: loader constraint violation: when resolving method
"javax.mail.internet.MimeMultipart.<init>(Ljavax/activation/DataSource;)V"
the class loader (instance of
org/jboss/classloader/spi/base/BaseClassLoader) of the current class,
com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider, and the
class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader)
for resolved class, javax/mail/internet/MimeMultipart, have different Class
objects for the type javax/activation/DataSource used in the signature"

It seems there is a conflict on MimeMultipart but I have really no clue what
to do to resolve it.
If someone had the solution and would be kind enough to share it. ^^
Thx.





-- 
View this message in context: http://jersey.576304.n2.nabble.com/problem-uploading-file-tp5291752p5291752.html
Sent from the Jersey mailing list archive at Nabble.com.