SOLVED - Custom abbrev groups using MarvinBeans?

User 9d72be7cd4

05-05-2007 00:36:33

SOLVED - Wow...5 min after posting this.





I had another instance of Msketch running in JVM. Once I killed it and reloaded, it worked.





Strange. Must have been a cache issue with the 2nd instance versus the one I was using.





-------------------------------


Original Problem:


Trying to create custom abbrevgroup using MarvinBeans:





In MarvinSketch bean parameter I add:





abbrevgroups=mydefault.abbrevgroup


Placing file mydefault.abbrevgroup in same folder as MarvinBeans.jar





Also tried placing mydefault.abbrevgroup into the MarvinBeans.jar in the chemaxon.marvin folder and chemaxon.marvin.templates folder





I've tried:





abbrevgroups=chemaxon/marvin/mydefault.abbrevgroup


abbrevgroups=chemaxon/marvin/templates/mydefault.abbrevgroup





with the file located in all three places.





In every case, I get this error:





Code:
Cannot form valid URL for molecule file loading.


Filename: <WHATEVERPATH I PUT FOR abbrevgroup>


Internal molecule id:66048






The Msketch bean continues to load and then works fine...but with the default abbrevgroup, not my custom one.





mydefault.abbrevgroup is exactly like the regular default.abbrevgroups except I added BOH2 as:





Code:
B(OH)2   B(O)O   1   leftname=(OH)2B






I also tried adding it directly to default.abbrevgroups in the JAR but this ended up creating a SHA1 error - assuming its making sure the file hasn't changed by getting a SHA1 hash.





So, how to correctly reference and load a custom abbrevgroup file using the MarvinBeans? Where to place the mydefault.abbrevgroup? and should this file contain ALL abbrevgroups desired, or only additional ones to the default?





The STACKtrace error output is:





Code:
java.net.MalformedURLException: no protocol: chemaxon/marvin/templates/mydefault.abbrevgroup


   at java.net.URL.<init>(Unknown Source)


   at java.net.URL.<init>(Unknown Source)


   at java.net.URL.<init>(Unknown Source)


   at chemaxon.marvin.util.MolLoader.init(Unknown Source)


   at chemaxon.marvin.util.MolLoader.<init>(Unknown Source)


   at chemaxon.marvin.common.swing.MolPanel.createLoader(Unknown Source)


   at chemaxon.marvin.common.swing.MolPanel.startLoader(Unknown Source)


   at chemaxon.marvin.sketch.swing.SketchPanel.startTmplLoad(Unknown Source)


   at chemaxon.marvin.sketch.swing.SketchPanel.setProperties(Unknown Source)


   at chemaxon.marvin.beans.MarvinPane.setParams(Unknown Source)


   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)


   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)


   at java.lang.reflect.Method.invoke(Unknown Source)


   at com.servoy.j2db.develop.property.n.setValueAt(Unknown Source)


   at javax.swing.JTable.setValueAt(Unknown Source)


   at javax.swing.JTable.editingStopped(Unknown Source)


   at javax.swing.AbstractCellEditor.fireEditingStopped(Unknown Source)


   at com.servoy.j2db.util.a9.focusLost(Unknown Source)


   at com.servoy.j2db.util.w.int(Unknown Source)


   at com.servoy.j2db.util.w$a.focusLost(Unknown Source)


   at java.awt.AWTEventMulticaster.focusLost(Unknown Source)


   at java.awt.Component.processFocusEvent(Unknown Source)


   at java.awt.Component.processEvent(Unknown Source)


   at java.awt.Container.processEvent(Unknown Source)


   at java.awt.Component.dispatchEventImpl(Unknown Source)


   at java.awt.Container.dispatchEventImpl(Unknown Source)


   at java.awt.Component.dispatchEvent(Unknown Source)


   at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)


   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)


   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)


   at java.awt.Component.dispatchEventImpl(Unknown Source)


   at java.awt.Container.dispatchEventImpl(Unknown Source)


   at java.awt.Component.dispatchEvent(Unknown Source)


   at java.awt.EventQueue.dispatchEvent(Unknown Source)


   at java.awt.SentEvent.dispatch(Unknown Source)


   at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(Unknown Source)


   at java.awt.DefaultKeyboardFocusManager.sendMessage(Unknown Source)


   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)


   at java.awt.Component.dispatchEventImpl(Unknown Source)


   at java.awt.Container.dispatchEventImpl(Unknown Source)


   at java.awt.Window.dispatchEventImpl(Unknown Source)


   at java.awt.Component.dispatchEvent(Unknown Source)


   at java.awt.EventQueue.dispatchEvent(Unknown Source)


   at java.awt.SequencedEvent.dispatch(Unknown Source)


   at java.awt.EventQueue.dispatchEvent(Unknown Source)


   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)


   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)


   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)


   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)


   at java.awt.EventDispatchThread.run(Unknown Source)

ChemAxon 7c2d26e5cf

07-05-2007 14:26:02

The "abbrevgroups" parameter works for me.


Code:
sketchPane.setParams("abbrevgroups=def.abbrevgroup");



Take care that the base directory of your abbreviation file have to be in CLASSPATH.


By the above example (if "dev.abbrevgroup" is in "marvinbeans/lib/"), "marvinbeans/lib" have to be enumerated in the CLASSPATH.