build failure - package org.apache.commons.io does not exist

5,931 views
Skip to first unread message

Joel Hughes

unread,
Jan 10, 2018, 10:42:24 AM1/10/18
to foam-framework-discuss
Morning

Encountering the following building foam:

[INFO] Compiling 448 source files to /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/target/foam-1.0-SNAPSHOT/WEB-INF/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/BlobStore.java:[4,29] package org.apache.commons.io does not exist
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/nanos/blob/HttpBlobService.java:[16,29] package org.apache.commons.io does not exist
...
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/nanos/http/FileWebAgent.java:[9,31] package org.apache.commons.text does not exist

Using the documented build process: cd src; ./gen.sh; cd ../build; cp ../tools/pom.xml .; mvn compile; mvn package

Can someone verify that the pom.xml is as it should be?

Thanks
Joel 

Joel Hughes

unread,
Jan 10, 2018, 12:17:01 PM1/10/18
to foam-framework-discuss
Added the apache.commons packages to the pom did not help.

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>1.2</version>
        </dependency>

Joel Hughes

unread,
Jan 10, 2018, 2:27:19 PM1/10/18
to foam-framework-discuss
Ok, passed the apache errors, adding commons-io and commons-text did work, the problem was the 'cp ../tools/pom.xml' was not copying the updated pom (figure that one out later). 

How are you building - an automated system or by hand?

So now:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/HttpServletRequestBlob.java:[14,8] foam.blob.HttpServletRequestBlob is not abstract and does not override abstract method getSize() in foam.blob.Blob
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/HttpServletRequestBlob.java:[62,15] getSize() in foam.blob.HttpServletRequestBlob cannot implement getSize() in foam.blob.Blob
  return type long is not compatible with int
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/HttpServletRequestBlob.java:[30,3] method does not override or implement a method from a supertype
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/HttpServletRequestBlob.java:[40,24] cannot find symbol
  symbol:   method slice(int,long)
  location: variable buffer of type foam.blob.Buffer
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/HttpServletRequestBlob.java:[43,29] cannot find symbol
  symbol:   method getData()
  location: variable buffer of type foam.blob.Buffer
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/HttpServletRequestBlob.java:[53,13] cannot find symbol
  symbol:   method setData(java.nio.ByteBuffer)
  location: variable buffer of type foam.blob.Buffer
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/HttpServletRequestBlob.java:[61,3] method does not override or implement a method from a supertype
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/nanos/blob/HttpBlobService.java:[101,14] no suitable method found for closeQuietly(foam.blob.InputStreamBlob)
    method org.apache.commons.io.IOUtils.closeQuietly(java.io.Reader) is not applicable
      (argument mismatch; foam.blob.InputStreamBlob cannot be converted to java.io.Reader)
    method org.apache.commons.io.IOUtils.closeQuietly(java.io.Writer) is not applicable
      (argument mismatch; foam.blob.InputStreamBlob cannot be converted to java.io.Writer)
    method org.apache.commons.io.IOUtils.closeQuietly(java.io.InputStream) is not applicable
      (argument mismatch; foam.blob.InputStreamBlob cannot be converted to java.io.InputStream)
    method org.apache.commons.io.IOUtils.closeQuietly(java.io.OutputStream) is not applicable
      (argument mismatch; foam.blob.InputStreamBlob cannot be converted to java.io.OutputStream)
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/dao/index/TreePlan.java:[28,22] method select in class foam.dao.index.TreeNode cannot be applied to given types;
  required: foam.dao.index.TreeNode,foam.dao.Sink,long,long,foam.mlang.order.Comparator,foam.mlang.predicate.Predicate,foam.dao.index.Index,boolean
  found: foam.dao.index.TreeNode,foam.dao.Sink
  reason: actual and formal argument lists differ in length
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/RestBlobService.java:[91,14] cannot find symbol
  symbol:   method close(java.net.HttpURLConnection)
  location: class org.apache.commons.io.IOUtils
[ERROR] /Users/jhughes/workspace/jbbmobile/repos/sesad/node_modules/foam2/build/foam/blob/RestBlobService.java:[128,14] cannot find symbol
  symbol:   method close(java.net.HttpURLConnection)
  location: class org.apache.commons.io.IOUtils
[INFO] 11 errors

Joel Hughes

unread,
Jan 11, 2018, 4:21:42 PM1/11/18
to Adam Van Ymeren, foam-framework-discuss
Hi Adam
Yes, still deploying to appengine.
Appreciate your help.
Joel 

On Thu, Jan 11, 2018 at 4:17 PM, Adam Van Ymeren <ad...@vany.ca> wrote:
Joel Hughes <joel.l...@gmail.com> writes:

> Ok, passed the apache errors, adding commons-io and commons-text did
> work, the problem was the 'cp ../tools/pom.xml' was not copying the
> updated pom (figure that one out later).

Most of the code is being copied and built with a separate
private repo all in one go.

I'm currently on the task of fixing foam2 to build properly on its
own.  Are you still deploying on appengine?

Joel Hughes

unread,
Jan 12, 2018, 1:28:47 PM1/12/18
to Adam Van Ymeren, foam-framework-discuss
Hi Adam
I'm OK with just a jar file. I use gradle to build out my war as I have more than just the foam jar. 

Joel 

On Fri, Jan 12, 2018 at 1:24 PM, Adam Van Ymeren <ad...@vany.ca> wrote:
Joel Hughes <joel.l...@gmail.com> writes:

> Hi Adam
> Yes, still deploying to appengine.

Okay so I pushed a Makefile which builds foam2 into a jar and generates
a script for running nanos. ( I got sick of dealign with maven ).

This doesn't entirely help you as this is for running nanos not building
a WAR for appengine.

I'm going for a late lunch but will think more on your situation and
come up with something.



Joel Hughes

unread,
Jan 12, 2018, 4:30:35 PM1/12/18
to Adam Van Ymeren, foam-framework-discuss
Are you sure you committed/pushed your changes?

Under Ubuntu with 'make foam2':
'No rule to make target 'foam2'.

The Makefile has a target for nanos, but nothing for foam2. 

And on macos, unable to find gmake for brew, and I'm hesitant to install gnu coreutils.
Running make reports the same missing rule. 

Joel

On Fri, Jan 12, 2018 at 3:42 PM, Adam Van Ymeren <ad...@vany.ca> wrote:
Joel Hughes <joel.l...@gmail.com> writes:

> Hi Adam
> I'm OK with just a jar file. I use gradle to build out my war as I
> have more than just the foam jar.

Okay try pulling foam2 and running "make foam2".  Or if you're on a Mac run
"brew install gmake" and then run "gmake foam2"

It should produce a .foam2-build/foam2.jar that you can use in your
project.

Let me know if it doesn't work for you.

Reply all
Reply to author
Forward
0 new messages