[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Running external programs like 'fop' from lmi

From: Greg Chicares
Subject: [lmi] Running external programs like 'fop' from lmi
Date: Wed, 13 Jun 2007 12:45:09 +0000
User-agent: Thunderbird (Windows/20070221)

In the past, we ran programs like 'fop' in a fairly plain way:
 - a new console window pops up
 - stuff scrolls by
 - the console window vanishes

Usually the "stuff" was innocuous:

  [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
  [INFO] FOP 0.20.5
  [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
  [INFO] building formatting object tree
  [INFO] setting up fonts
  [INFO] [1]

but sometimes it wasn't:

  Problem executing command
  [INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
  [ERROR] javax.xml.transform.TransformerConfigurationException: 
javax.xml.transform.TransformerException: "padding-left" attribute is not 
allowed on the xsl:text element!

  Exit code 2 from command 'CMD /c /fop-0.20.5/fop -xsl 
"/opt/lmi/data/variable_annuity.xsl" -xml "/var/opt/lmi/spool/unnamed2.xml" 

yet, either way, it vanished too quickly for anyone to read it.

Just suppressing the console unconditionally would have been
easy, but that's not the right way. If it's trying to explain
some error, we shouldn't stifle it. If the oil light on your
car's instrument panel flashes intermittently, and usually it
doesn't indicate a real problem but sometimes it does, then
you don't tape a piece of cardboard over it to hide the thing;
you don't cut the wire to the light; no, you...have it fixed.
Fixed so that it lights up when there's a problem, and doesn't
when there isn't.

With cvs as of 20070613T0003Z, that's what I've tried to do.

For example, the "[ERROR]" above was copied and pasted from a
messagebox with Ctrl-C. If a user copied, pasted, and emailed
that to us, we'd know where to look for the problem.

But run something that just works, and you see no console and
no messagebox.

Using the highest privilege level, you can do
  alt-T Y
to run any command you like. Let's try 'xxx':

  Lmi_wx Error
  Execution of command 'xxx' failed (error 2: the system cannot find the file 

That's from wx itself. Let's try 'ls --xxx':

  Problem executing command
  ls: unrecognized option `--xxx'
  Try `ls --help' for more information.
  Exit code 1 from command 'ls --xxx'.

But 'echo Hello' runs silently. You never see any output,
because nothing is shown unless the command failed ('ls --xxx')
or couldn't be run at all ('xxx'). Thus, this isn't a general
facility for running shell commands and viewing their output;
its purpose is to show all output iff there's an error, and
  alt-T Y
is intended only for testing that.

This code is used for authenticating the system at startup
(by invoking 'md5sum') as well as for generating output via
apache 'fop'. I haven't looked at any authentication output
because I've set up my own system so that it never expires and
never actually authenticates anything.

I'd like to release this at the end of this month. I'm still
dissatisfied with a few details, but instead of listing them
here I think it better to ask others if they see anything that
calls for improvement.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]