How to set java.awt.headless Java property for jc_molconvert

User 0908c5ccdd

26-02-2007 15:44:15

Please could somebody help me with setting the Java system property java.awt.headless?





I would like to use the jc_molconvertb operator and I read on the instructions that "to enable image generation (for jc_molconvertb),


the Java system property java.awt.headless must be set to true for Tomcat (-Djava.awt.headless=true)"








I tried typing
Code:
C:\Tomcat\bin>java -Djava.awt.headless=true
at the command prompt but I got a usage error as below:





Usage: java [-options] class [args...]


(to execute a class)


or java -jar [-options] jarfile [args...]


(to execute a jar file)





where options include:


-hotspot to select the "hotspot" VM


If present, the option to select the VM must be first.


The default VM is -hotspot.





-cp -classpath <directories and zip/jar files separated by ;>


set search path for application classes and resources


-D<name>=<value>


set a system property


-verbose[:class|gc|jni]


enable verbose output


-version print product version and exit


-showversion print product version and continue


-? -help print this help message


-X print help on non-standard options






Can somebody help please?

ChemAxon aa7c50abf8

26-02-2007 16:04:30

Which Tomcat version do you have?

User 0908c5ccdd

26-02-2007 16:27:33

Hi





It's Tomcat v4.1.34





Thanks


FTM

ChemAxon aa7c50abf8

26-02-2007 17:11:01

The CATALINA_OPTS environment variable has to include this system property (in addition to the -server and -Xmx<your-heap-requirement> options):


Code:
SET CATALINA_OPTS="-server -Xmx1000m -Djava.awt.headless=true"
.





Your question implies that you have not yet set either the -server or the -Xmx option. I strongly recommend to set at least the former one, because that may make a big difference in speed. You will also need to set the -Xmx option when starting to search in structure tables holding more than a couple of thousand compounds.





Peter

User 0908c5ccdd

26-02-2007 17:31:25

I created the CATALINA_OPTS system variable from Control Panel / System / Environment Variables / New. I added the Variable Value of -server -Xmx1000m -Djava.awt.headless=true





Please forgive me, I have not changed many environment variables and I am quite new to this. I have re-started Tomcat in a new Command Prompt window, with no apparent errors. Is this all I need to do to get the jc_molconverb operator to work?





In a PL/SQL procedure to convert BLOB to file I have the line





Code:
select jc_molconvertb(cd_smiles, 'jpeg')


into l_blob


from jchemistry


where cd_id = 203;






If I know that the environment variable is now correctly set then I can concentrate on if it is my options_outputformat setting that is incorrect. I still am unable to read the output JGP file. I am pretty sure that the rest of the PL/SQL is ok as it works fine with a stored MS Word file.

ChemAxon aa7c50abf8

26-02-2007 21:43:10

Quote:
I still am unable to read the output JGP file.
I am not sure I understand what you mean. Your SQL statement executes successfully, you create a file from the output, but the file is not readable? Is there an error message you get?





Please, try executing the following statement in sqlplus or toad or Oracle SQL developer:


Code:
select dbms_lob.getlength(jc_molconvertb(cd_smiles, 'jpeg'))


from jchemistry


where cd_id = 203;





What does it report?





Peter

User 0908c5ccdd

27-02-2007 09:59:29

The PL/SQL procedure runs OK and saves a JPG file. However I am unable to open the file. I ran the code you suggested and the output was as below:





Code:
SQL> select dbms_lob.getlength(jc_molconvertb(cd_smiles, 'jpeg')) from jchemistry where cd_id = 203;





DBMS_LOB.GETLENGTH(JC_MOLCONVERTB(CD_SMILES,'JPEG'))


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


                                                7025








I guess this means that the jc_molconvertb operator is working OK and that there must be a problem in my PL/SQL code.


Perhaps it is due to line feeds being added when I write chunks of the BLOB to file. I will keep trying.





Many thanks.

ChemAxon aa7c50abf8

27-02-2007 10:22:31

Quote:
I guess this means that the jc_molconvertb operator is working OK
Yes, the operator appears to work properly to the extent that -Djava.awt.headless=true is now correctly set on the Tomcat side and a stream of 7025 bytes is generated by the operator. (In my environment I get back a jpeg file which I can properly display.) It is my bet as well that your PL/SQL code needs to be looked at more closely.





Peter