1

I have looked at a few links which seems related with no luck: *How to solve this java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream? *RESTEasy Client + NoSuchMethodError

The exception reads:

Caused by: java.lang.NoSuchMethodError: org.apache.commons.io.output.DeferredFileOutputStream.(ILjava/lang/String;Ljava/lang/String;Ljava/io/File;)V at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:554) at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524)

The dependencies I have are:

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.0</version>
    </dependency>

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-client</artifactId>
        <version>3.0.7.Final</version>
    </dependency>

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson-provider</artifactId>
        <version>3.0.7.Final</version>
    </dependency>

System is running on JDK 1.7, JBoss 5.1 GA with ESB modules.

Thanks

Community
  • 1
  • 1
PalinDrone
  • 21
  • 1
  • 6

2 Answers2

0

You are missing a dependency. You need to add commons-io to your pom.xml:

<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>1.4</version>
</dependency>
badera
  • 1,495
  • 2
  • 24
  • 49
  • Hi Badera; as you can see I have version 2.0 of commons-io already as a dependency (runtime and compile-time). I have tried before using version 1.4 and 2.4 with the same result – PalinDrone Nov 30 '15 at 10:54
  • Thanks badera, seems to work.Dont know why this did not have an effect earlier (I may have had two different versions of commons-io included with the wrong one in the EAR lib). – PalinDrone Nov 30 '15 at 11:38
  • Oh, I see that you have had already included this dependency. I just answered, what helped me as I have had the same problem... However, the solution is definitely add properly this dependency... – badera Nov 30 '15 at 11:53
  • Unfortunately this keeps popping up now and again (same maven dependencies still on commons-io 1.4); I would appreciate any other ideas of how to solve this. – PalinDrone Dec 02 '15 at 11:21
  • I was running this on JBoss 5.1.0 GA with ESB; found the DeferredFileOutputStream class in deployers/esb.deployer/lib/commons-io-1.3.jar. When I replaced this with version 1.4 of commons-io, this exception disappeared. Now I have `java.lang.NoSuchMethodError: javax.ws.rs.core.Response.close()V` failure – PalinDrone Dec 02 '15 at 12:02
0

Late but but last update.. this method was found inside the JBoss application server; when I replaced this jar inside JBoss with the same (was using v1.4) then there was no more exceptions such as above

PalinDrone
  • 21
  • 1
  • 6