Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  No version in manifest

    Posted 07/10/15 02:52 AM

    Originally posted by: JorisK


    I'm developing a Java application which invokes CP optimizer 12.6.2. When I run the application from within my develop environment, either javaIDEA or Eclipse, everything works well. However, when I use either javaIDEA or Eclipse to produce a JAR file from my application, I get the following error when I try to execute the Jar file:

    > java -Djava.library.path=/opt/ILOG/CPLEX_Studio1262/cpoptimizer/bin/x86-64_linux/:/opt/ILOG/CPLEX_Studio1262/opl/bin/x86-64_linux/ -jar ./bikesharing.jar ./data/instances/example.txt
    No version in manifest (not in a jar?), trying 1260
    No version in manifest (not in a jar?), trying 1260
    Native code library failed to load: ensure the appropriate library (opl1260.dll/.so) is in your path.
    Exceptions:
    no opl1260 in java.library.path
    no opl_lang_wrap_cpp in java.library.path
    no opl_core_wrap_cpp_java1260 in java.library.path
    no opl_core_wrap_cpp in java.library.path
    no cp_oaas1260 in java.library.path
    no cp_oaas in java.library.path
    no cp_wrap_cpp_java1260 in java.library.path
    no cp_wrap_cpp in java.library.path
    no concert_wrap_cpp_java1260 in java.library.path
    no concert_wrap_cpp in java.library.path
    
    Exception in thread "main" java.lang.ExceptionInInitializerError
            at ilog.concert.cppimpl.IloEnv.<init>(IloEnv.java:49)
            at ilog.concert.IloModelerImpl.<init>(IloModelerImpl.java:34)
            at ilog.cp.IloCP.<init>(IloCP.java:125)
            at ilog.cp.IloCP.<init>(IloCP.java:118)
            at algorithms.exact.cp.CPModelBuilder.buildModel(CPModelBuilder.java:45)
            at algorithms.exact.cp.CPModelBuilder.<init>(CPModelBuilder.java:33)
            at algorithms.exact.cp.CP.<init>(CP.java:27)
            at benchmark.CPBenchmark.main(CPBenchmark.java:26)
    Caused by: java.lang.RuntimeException: Native code library failed to load: ensure the appropriate library (opl1260.dll/.so) is in your path.
    Exceptions:
    no opl1260 in java.library.path
    no opl_lang_wrap_cpp in java.library.path
    no opl_core_wrap_cpp_java1260 in java.library.path
    no opl_core_wrap_cpp in java.library.path
    no cp_oaas1260 in java.library.path
    no cp_oaas in java.library.path
    no cp_wrap_cpp_java1260 in java.library.path
    no cp_wrap_cpp in java.library.path
    no concert_wrap_cpp_java1260 in java.library.path
    no concert_wrap_cpp in java.library.path
    
            at ilog.concert.IloJNILoader.loadJNI(IloJNILoader.java:88)
            at ilog.concert.cppimpl.concert_wrapJNI.<clinit>(concert_wrapJNI.java:15)
            ... 8 more
    

     

    I would highly appreciate it if someone could tell me a work-around to resolve this problem.  I get the exact same problem with CP optimicer 12.6.1. I'm running Linux. Here is someone else who has the exact same issue under Windows: http://stackoverflow.com/questions/30211341/ibm-optimization-studio-cplex-opl-jar-returns-wrong-version


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: No version in manifest

    Posted 07/10/15 05:53 AM

    Originally posted by: Olivier OUDOT


    Hello Joris,

    The origin of your problem seems to be the 'manifest.mf' file in your jar. May be you have simply forgot to add one, or it is wrong.

    It should be like this:

        Manifest-Version: 1.0
        Main-Class: <full name of your main class>
        Class-Path: <list of jar files used by your program, in particular ILOG.CP.jar>

    See https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html for more details.


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: No version in manifest

    Posted 07/10/15 09:08 AM

    Originally posted by: JorisK


    Hi Olivier,

    It must be something different. I've been been successfully creating JARs using CP Optimizer 12.5.1, and 12.6. However, 12.6.1 and 12.6.2 don't work. I've tried switching machines as well. Is there a quick work around? I need to be able to run some code today. The fact that I cannot create a working JAR file is very troublesome.

    The Jar contains a manifest:

    Manifest-Version: 1.0
    Main-Class: benchmark.CPBenchmark

     

    This manifest is identical to the manifest in a CP project using CP Optimizer 12.5.1 and is automatically generated by eclipse/javaIDEA. The project with CP optimizer 12.5.1 works fine.

    So far I've found quite a few people having the problem I've outlined above. Is there someone who managed to call CP Optimizer 12.6.2 using a JAR?

     

    Here is another post of the same issue: https://www.ibm.com/developerworks/community/forums/html/topic?id=efeff3bf-b040-4f6c-a01d-82a1b374ecfd&ps=25

    Could it be that there's something wrong with the versioning of the JARs in CP Optimizer? At least this is what the message seems to claim.


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: No version in manifest

    Posted 07/13/15 02:57 AM

    Originally posted by: SergeyPolyakovskiy


    Hi Joris,

    I still have the question open indeed. Somehow, I have solved the question for me for Windows. What I do is exporting jar with the option "Copy required libraries into a sub-folder next to the generated JAR" in Eclipse. I get a subfolder with the libraries therefore. Then my path in the batch file is like

    java -Djava.library.path="C:\Program Files\IBM\ILOG\CPLEX_Studio1262\cplex\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio1262\cpoptimizer\bin\x64_win64" -classpath d:\file.jar; Main.Entry …

    You can try to adopt the same for Linux. Let me know please then whether it works out.

    All the best,

    Sergey


    #CPOptimizer
    #DecisionOptimization