Re: [Open Babel] Java API: Can't use OB anymore due to UnsatisfiedLinkError

2014-03-20 Thread Joos Kiener
Found the issue:

I recently installed Avogadro which ships with a different version of
openbabel-2.dll. Because Avogadro adds PATH information to System variables
in contrast to OpenBabel which uses user variables for PATH, the
openbabel-2.dll in Avogadro is picked up first.

My solution is to manually add the path to the openbabel installation to
System PATH BEFORE Avogadro.



--
View this message in context: 
http://forums.openbabel.org/Java-API-Can-t-use-OB-anymore-due-to-UnsatisfiedLinkError-tp4657311p4657313.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


[Open Babel] Java API: Can't use OB anymore due to UnsatisfiedLinkError

2014-03-19 Thread Joos Kiener
I'm constantly getting an 

UnsatisfiedLinkError: C:\Program Files\OpenBabel-2.3.2\openbabel_java.dll:
The specified procedure could not be found

exception when calling 

System.loadLibrary(openbabel_java);

This used to work previously on the same laptop. Now it has been couple of
weeks since I last used the Java API so I have no clue what change might
have affected this. PATH is set correctly. I also tried System.load with
abolsute path to dll and the result is the same exception.

I also re-installed openbabel (and restarted) but to no avail. 

Does anyone here have an idea what could be causing this? A dependency
loaded by openbabel_java.dll (or openbable-2.dll)?



--
View this message in context: 
http://forums.openbabel.org/Java-API-Can-t-use-OB-anymore-due-to-UnsatisfiedLinkError-tp4657311.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Java API: Can't use OB anymore due to UnsatisfiedLinkError

2014-03-19 Thread Joos Kiener
I just realized that the python extensions fails with the same error:

 import pybel
Traceback (most recent call last):
  File stdin, line 1, in module
  File C:\Python27\lib\site-packages\pybel.py, line 52, in module
import openbabel as ob
  File C:\Python27\lib\site-packages\openbabel.py, line 37, in module
_openbabel = swig_import_helper()
  File C:\Python27\lib\site-packages\openbabel.py, line 33, in
swig_import_helper
_mod = imp.load_module('_openbabel', fp, pathname, description)
*ImportError: DLL load failed: The specified procedure could not be found.*



--
View this message in context: 
http://forums.openbabel.org/Java-API-Can-t-use-OB-anymore-due-to-UnsatisfiedLinkError-tp4657311p4657312.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Java API: setting OBConformerScore will crash application

2013-12-05 Thread Joos Kiener
Hi Noel,

Here a link to a zip file containing the compiled jar, mols.smi and windows
cmd file:

https://drive.google.com/file/d/0B1KuZlTEmhZNV2l5clhoVlZ5blk/edit?usp=sharing

This application fails on 2 different Windows 7 PCs (one 32, the other 64
bit but both run java and OB 32-bit).

I now realized that in some cases I actually get an error log file
generated:

https://drive.google.com/file/d/0B1KuZlTEmhZNeTVWdU9hemQ0U2c/edit?usp=sharing

Hope that helps. 



--
View this message in context: 
http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4657029.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Java API: setting OBConformerScore will crash application

2013-12-02 Thread Joos Kiener
It seems not possible to create a simple application were this issue happens.
As a context I'm reading in molecules, generating 3D coordinates and then
generate the Spectrophore. In a simple script-like snippet this works. 

In the complete application the results are written to an output file, there
are cli-options but fundamentally it does not do anything different and the
code for conformer searching is the same. But here it always fails with a
java error. And commenting

conformerSearch.SetScore(score);

reproducibly fixes the issue.

I will investigate further to try to find a simple example to demonstrate
this.



--
View this message in context: 
http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656960.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Java API: setting OBConformerScore will crash application

2013-12-02 Thread Joos Kiener
Geoff Hutchison wrote
 When you say does not allow any options to be set, do you mean the
 OBConformerScore isn't set?

No I meant that the options are not exposed as cli parameters and hence it
runs with default parameters (eg. nr of conformers, nr of children,
mutability,...)



--
View this message in context: 
http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656968.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


Re: [Open Babel] Java API: setting OBConformerScore will crash application

2013-12-02 Thread Joos Kiener
This is confusing. This issue is some weird memory issue. At the end of this
post is the most simple code I could come up with that reproduces the
problem for me.

I can make the code work by removing or commenting just any of the following
lines (only one of them is enough):

-  conformerSearch.SetScore(score); // will then use default
OBRMSDConformerScore

-  String str = StringUtils.join(strArray, ',');

For the StringUtils part, the length of the array matters. 5000 still works,
8000 does not. However in my original application I completely removed that
and it still has the issue. This tells me it is some weird memory problem
that can be caused by generating long strings (but not limited to this).
This issue then breaks OBEnergyConformerScore but not the default
OBRMSDConformerScore.

The error code from event viewer according to my google search means heap
corruption.

See below the mentioned code. It has a dependency on
org.apache.commons.lang3.

code
package conformergenerator;

import org.apache.commons.lang3.StringUtils;
import org.openbabel.OBBuilder;
import org.openbabel.OBConformerScore;
import org.openbabel.OBConformerSearch;
import org.openbabel.OBConversion;
import org.openbabel.OBEnergyConformerScore;
import org.openbabel.OBMol;

public class App {

public static void main(String[] args) {

System.loadLibrary(openbabel_java);

System.out.println(Create OBMol from smiles);
OBConversion conv = new OBConversion();
OBMol mol = new OBMol();
conv.SetInFormat(smi);

boolean hasNext = conv.ReadFile(mol, mols.smi);

String[] strArray = buildArray(1);
while (hasNext) {
System.out.println(Adding Hydrogens);
mol.AddHydrogens();
System.out.println(Generate 3D coordinates);
OBBuilder builder = new OBBuilder();
builder.Build(mol);

System.out.println(Generate Conformers);
OBConformerSearch conformerSearch = new OBConformerSearch();
OBConformerScore score = new OBEnergyConformerScore();
conformerSearch.SetScore(score);

if (!conformerSearch.Setup(mol)) {
String message = Generating conformers failed.;
throw new IllegalArgumentException(message);
}
conformerSearch.Search();
conformerSearch.GetConformers(mol);

String str = StringUtils.join(strArray, ',');
// the idea would be to add this as property to mol
// but not required for the code to fail

hasNext = conv.Read(mol);
}
System.out.println(Success!!!);
}

private static String[] buildArray(int numElements) {
String[] a = new String[numElements];
for (int i = 0; i  numElements; i++) {
a[i] = a;
}
return a;
}
}
/code



--
View this message in context: 
http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958p4656970.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


[Open Babel] Java API: setting OBConformerScore will crash application

2013-11-30 Thread Joos Kiener
Just using 

codeOBConformerSearch conformerSearch = new OBConformerSearch();/code

works. However I want to use different scoring than RMSD, which seems to be
the default (not really documented).

If I do this
code
OBConformerSearch conformerSearch = new OBConformerSearch();
OBConformerScore score = new OBEnergyConformerScore();
conformerSearch.SetScore(score);
/code

The application will always crash. Any ideas how I can solve this issue?
(Windows 7)



--
View this message in context: 
http://forums.openbabel.org/Java-API-setting-OBConformerScore-will-crash-application-tp4656958.html
Sent from the General discussion mailing list archive at Nabble.com.

--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
___
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss