Cannot compile OpenEMM; Spring framework is missing?

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

pmw
Posts: 2
Joined: Thu Oct 27, 2011 2:47 am

Cannot compile OpenEMM; Spring framework is missing?

Post by pmw » Thu Oct 27, 2011 1:07 pm

I would like to run OpenEMM on 64-bit Gentoo. Following the install instructions, I downloaded the source package and tried to compile it. The compilation ran into many errors, starting like this:

Code: Select all

    [mkdir] Created dir: /home/pmw/openemm/build/OpenEMM-2011-bin/webapps/openemm/WEB-INF/classes
    [javac] /home/pmw/openemm/OpenEMM-2011-src/openemm_build.xml:55: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last;
 set to false for repeatable builds   
    [javac] Compiling 575 source files to /home/pmw/openemm/build/OpenEMM-2011-bin/webapps/openemm/WEB-INF/classes
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/ActionOperation.java:26: package org.springframework.context does not
 exist
    [javac] import org.springframework.context.ApplicationContext;
    [javac]                                   ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/ActionOperation.java:34: cannot find symbol
    [javac] symbol  : class ApplicationContext
    [javac] location: class org.agnitas.actions.ActionOperation
    [javac]     public abstract boolean executeOperation(ApplicationContext con, int companyID, HashMap params);
    [javac]                                              ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/EmmAction.java:29: package org.springframework.context does not exist
    [javac] import org.springframework.context.ApplicationContext;
    [javac]                                   ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/EmmAction.java:52: cannot find symbol
    [javac] symbol  : class ApplicationContext
    [javac] location: interface org.agnitas.actions.EmmAction
    [javac]     boolean executeActions(ApplicationContext con, HashMap params);
    [javac]                            ^
    [javac] /home/pmw/openemm/src/OpenEMM-2011-src/src/java/org/agnitas/actions/impl/EmmActionImpl.java:31: package org.springframework.context does not exist
    [javac] import org.springframework.context.ApplicationContext;
    [javac]                                   ^
Please advise.

maschoff
Site Admin
Posts: 2177
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: Cannot compile OpenEMM; Spring framework is missing?

Post by maschoff » Sat Oct 29, 2011 4:59 pm

Did you download the JARs tarball of OpenEMM and set the path in oe.home accordingly? (See line 10 of build script)
OpenEMM Maintainer

pmw
Posts: 2
Joined: Thu Oct 27, 2011 2:47 am

Re: Cannot compile OpenEMM; Spring framework is missing?

Post by pmw » Sun Oct 30, 2011 2:34 am

Thank you, that solved the problem. I was missing the JARs tarball.

bhcuong2008
Posts: 26
Joined: Fri Apr 11, 2014 3:56 pm

Re: Cannot compile OpenEMM; Spring framework is missing?

Post by bhcuong2008 » Sun Jun 15, 2014 8:58 am

I compile OpenEMM 2013 R2, everything seems to be ok. But it occurs an issue as follow,

===
[exec] gcc -I../lib -I/home/oe/include -pthread -c -o bav.o bav.c
[exec] In file included from bav.h:25:0,
[exec] from bav.c:30:
[exec] ../lib/agn.h:139:2: error: expected identifier before numeric constant
[exec] make: *** [bav.o] Error 1
[exec] Result: 2

BUILD FAILED
/home/oe/src/OpenEMM-2013_R2-src/openemm_build.xml:148: Warning: Could not find resource file "/home/oe/src/OpenEMM-2013_R2-src/src/c/bav/bav" to copy.
===

When opening file agn.h, line 139, I see this. I dont know why. I compile on ubuntu 12.04 64bit.
===
typedef enum { /*{{{*/
false,
true
/*}}}*/
} bool_t;
===

ud
Posts: 141
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Re: Cannot compile OpenEMM; Spring framework is missing?

Post by ud » Mon Jun 16, 2014 6:35 am

Looks like some other include file already defines "false", 'true" or "bool_t". So please try these steps:
- Change to the source directory for bav.c
- Start the command: gcc -E -I../lib -I/home/oe/include -pthread -c -o bav.i bav.c
- Look into the file "bav.i" for the occurrence of bool_t to see where and how it is defined.

-- ud

bhcuong2008
Posts: 26
Joined: Fri Apr 11, 2014 3:56 pm

Re: Cannot compile OpenEMM; Spring framework is missing?

Post by bhcuong2008 » Mon Jun 16, 2014 9:07 am

Hi ud,

I follow your advice. I see just one occurrence defined in this file. And one definition in agn.h (line 139). What should I do next?

Here is my bav.i file,
https://drive.google.com/file/d/0B59EBc ... sp=sharing

Thank you.

ud
Posts: 141
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Re: Cannot compile OpenEMM; Spring framework is missing?

Post by ud » Mon Jun 16, 2014 11:01 am

If you modify bav.c and insert these two lines just before the inclusion of bav.h:

#undef false
#udnef true

then it should compile.

-- ud

Same as a unified context diff:

--- bav.c.orig 2014-06-16 11:58:04.897116499 +0200
+++ bav.c 2014-06-16 11:58:21.215021164 +0200
@@ -29,6 +29,8 @@
# include <regex.h>
# include <netinet/in.h>
# include "libmilter/mfapi.h"
+# undef false
+# undef true
# include "bav.h"

# define SOCK_PATH "var/run/bav.sock"

bhcuong2008
Posts: 26
Joined: Fri Apr 11, 2014 3:56 pm

Re: Cannot compile OpenEMM; Spring framework is missing?

Post by bhcuong2008 » Mon Jun 16, 2014 11:32 am

Hi ud,

It's successful :)

Thank you very much.

Post Reply