Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX/OPL Java interface with Tomcat

    Posted 10/20/10 08:32 PM

    Originally posted by: JamesNeuf


    Using the CPLEX 12.2 package.

    I have code that creates an OPLModel and solves it in CPLEX using the java interfaces and I am trying to run this inside tomcat. The code works just fine when I run it from command line assuming I have my LD_LIBRARY_PATH set properly. However, when I run this code through tomcat with all things being equal I get all sorts of strange behavior.

    Often times I get this error, and I am absolutely certain that the opl122.so is in the path since I print out both LD_LIBRARY_PATH and java.library.path right before the error:

    Native code library failed to load: ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.

    But sometimes it just works (finds the library) with no changes being made to the java code and I get this instead:

    1. A fatal error has been detected by the Java Runtime Environment:
    #
    1. SIGSEGV (0xb) at pc=0x00007f2cef874548, pid=25215, tid=139831058360080
    #
    1. JRE version: 6.0_18-b18
    2. Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 )
    3. Derivative: IcedTea6 1.8
    4. Distribution: Ubuntu lucid (development branch), package 6b18-1.8-0ubuntu1
    5. Problematic frame:
    6. C http://libopl122.so+0x1ad5548 _Z21IloStringHashFunctionPKcl+0x0
    #
    1. An error report file with more information is saved as:
    2. /tmp/hs_err_pid25215.log
    #
    1. If you would like to submit a bug report, please include
    2. instructions how to reproduce the bug and visit:
    3. https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
    4. The crash happened outside the Java Virtual Machine in native code.
    5. See problematic frame for where to report the bug.

    But by far the most common thing that happens is my code just immediately stops when I call OPLFactory.createCplex() or any other methods that use the OPL libraries. I get no errors, no exceptions, nothing other than the print statements that happen right before that call. It's like a System.exit() is being called from within the opl java libraries.

    I'm wondering if the cplex java libraries are doing weird things with custom class loaders or something to make sure people cannot circumvent the licensing?
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: CPLEX/OPL Java interface with Tomcat

    Posted 10/22/10 11:04 AM

    Originally posted by: SystemAdmin


    Dear JamesNeuf,

    Your post is on the wrong forum, I cannot move it but you need to post it to the CPLEX forum.

    Thanks

    Philippe
    #CPOptimizer
    #DecisionOptimization