[OS] Java: how to start?

Jun Ma maj at northwestern.edu
Thu Jan 28 12:15:08 EST 2010


Olivier,
Regarding the Java parts of your questions, I am not sure how you downloaded 
the code and software.
Either you may have built it yourself from branches/OSjava or downloaded the 
a ready binary build "os-server-2.0.0.zip".

Either way, if you decide to use the Java as part of your software library, 
you should just look at only the OSCommon package,  i.e. 
org.optimizationservices.oscommon.*, which has all the similar classes and 
interfaces to the core C++ version to read, write OSxL files.

Your error message indicates to me that you may have downloaded and used 
os-server-2.0.0, which has other packages including services to run readily 
made/distributed solver executables.

Now, it does look like on COIN-OR we don't distribute an OSCommon.jar binary 
that includes all org.optimizationservices.oscommon classes.
We will discuss that and may put the build on soon.
But for now you can may either just include all the OSCommon classes on your 
classpath or zip up all the classes your self and call it whatever jar you 
want to name (preferably OSCommon.jar) and put the jar on the classpath.

I hope the general comments gives some insights. Otherwise please be more 
specific on your issues.

Jun

--------------------------------------------------
From: "Olivier Cailloux" <olivier.cailloux at ecp.fr>
Sent: Thursday, January 28, 2010 10:21 AM
To: <os at list.coin-or.org>
Cc: "Jun Ma @ NWU" <maj at northwestern.edu>
Subject: Re: [OS] Java: how to start?

> Horand Gassmann a écrit :
>> Quoting Olivier Cailloux <olivier.cailloux at ecp.fr>:
>>
>>> Oops, missing the xml file, sorry.
>>>
>>> Thank you for your fast answer.
>>>
>>> Kipp Martin a écrit :
>>>> Hi Olivier:
>>>>
>>>> First, thank you very much for your interest in OS.
>>>>
>>
>>> I made several more tries but am still unable to find what is my
>>> mistake. I am trying to input the following model.
>>> /* Decision variables */
>>> var gjb2 >=0;
>>> var gjb3 >=0;
>>> var s2 >= 0;
>>> var s3 >= 0;
>>> /* Objective function */
>>> minimize sumofslack: s2 + s3;
>>> /* Constraints */
>>> s.t. lowcat : gjb2 + s2 = 3;
>>> s.t. highcat : gjb3 - s3 - 0.1 = 3;
>>> end;
>>>
>>> Attached is the xml osil file I obtained with one of my tries. I don't
>>> see why it is incorrect. (It uses column layout instead of row but I
>>> also tried with row layout with no success.)
>>
>> I am not sure what you mean when you say "it is incorrect". The file is 
>> valid
>> under the OSiL schema and, from what I can tell, transcribes the given 
>> problem.
>> What sort of errors do you experience? Does the parser report an error? 
>> Is the
>> solution nonsensical?
> Indeed I should have included this. Running OSSolverService with this 
> input file produces the following error (while running it with the 
> parincLinear example file produces no error).
>
> ~$ ...OSSolverService -osil osil1.xml
> <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" 
> href="../stylesheets/OSrL.xslt"?>
> <osrl xmlns="os.optimizationservices.org" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="os.optimizationservices.org 
> http://www.optimizationservices.org/schemas/2.0/OSrL.xsd" >
> <general>
> <generalStatus type="error"/>
> <message>PARSER ERROR:  Input is either not valid or well formed: 
> improperly formed <instanceData> element
> Here are 20 characters currently being pointed to in the input string: 
> ?xml version="1.0" e
> See line number: 7
> </message>
> </general>
> <job>
> </job>
> </osrl>
>
> Olivier
>
> 



More information about the OS mailing list