Re: FOP 0.94 bin - Severe Exceptions on Solaris Box

2008-03-26 Thread Vincent Hennebert
Hi,

Sorry to wake up a bit late, but I’d like to bring some precisions.

First, there’s no particular differences between the .tar.gz and the
.zip distribution files. In both, the fop shell script is in unix format
(lines ending with LF), while the fop.bat, fop.cmd and fop.js script
files are in dos format (lines ending with CRLF). No need to convert
them with dos2unix, no need to privilege one distribution file over the
other one.

The reason of providing both .tar.gz and .zip files is that Windows
users will naturally choose the .zip file because they are more used to
this extension; while Unix users will tend to choose the .tar.gz file.
But both platforms can handle both formats (I think), and while the
.tar.gz format is smaller this does no longer make much difference with
nowadays’ download rates. It’s mainly historical now.

As to the shell script problem on Solaris:

Matt Healy wrote:
 On Thu, 20 Mar 2008, J.Pietschmann wrote:
 Matt Healy wrote:
 I went back and checked the script, and found that IFS is being set just
 to the newline character, and does not include spaces.

 This is intentional: it avoids splitting directorie names which
 contain spaces, which is rather common now especially on Windows.

 How about this as an alternative, then: simply move the assignment to
 (and export of) IFS to a point immediately *after* the evaluation of the
 command-line arguments.  In this way, the loop will appropriately
 differentiate between the arguments, rather than failing to break the
 evaluation of '$@' on the spaces between quoted values.

 In other words, rewrite:

 export IFS=
 
 for arg in $@ ; do
   . . . .
 done

 as:

 for arg in $@ ; do
   . . . .
 done
 export IFS=
 

This export statement does no longer appear in the 0.95beta release. It
seems that it was not needed anyway and it has been moved further down
in the script. Can you please try with the latest version and report
back on this list?

That said, this script looks quite complicated to me. It may make sense
to streamline it a bit. For example, I’m not sure the JAVACMD and
JAVA_HOME variables are still needed on modern Unix distribution. Also,
maybe we can expect bash to be installed by default on every platform
now? Perhaps even Python. If there are any volunteers...

snip/

HTH,
Vincent


-- 
Vincent HennebertAnyware Technologies
http://people.apache.org/~vhennebert http://www.anyware-tech.com
Apache FOP Committer FOP Development/Consulting

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FOP 0.94 bin - Severe Exceptions on Solaris Box

2008-03-21 Thread Newkid

Dear All,

On the top, thank you so much for the prompt response!

Let me allow to say what I've done so far..

I downloaded the fop-0.94-bin.tar and unzipped it in a windows machine. Then
I moved the unzipped files to Solaris box inside folder /var/fop. Under it,
when I tried to generate a test pdf by issuing the following command:

fop -xml test.xml -xsl test.xsl -pdf test.pdf

I got the first error -bash: fop.sh: command not found. I have set the
resepective PATH and it's gone but I got  the second error like No such
file or directory. After fixing the second issues, I got the error which
was related to FOP.sh i.e. IFS=^J is not an identifier.

After doing some R N D, I got rid of the issue by changing the line 25 of
fop.sh to:

IFS=
export IFS

At that time, I was successfully able to execute the fop.sh but NOT with
parameter.

In other approach of resolving the issue, I have taken the source
file(fop.sh) and convert it using dos2unix command by hoping that it will do
the magic as suggested in one of the thread. But all vain..

Please advice, what I have to do to get rid of it?

Once again, thank you so much for your time and valuable comments!

With Thanks!
Newkid


Matt Healy wrote:
 
 On Thu, 20 Mar 2008, J.Pietschmann wrote:
 Matt Healy wrote:
 I went back and checked the script, and found that IFS is being set just
 to the newline character, and does not include spaces.

 This is intentional: it avoids splitting directorie names which
 contain spaces, which is rather common now especially on Windows.
 
 How about this as an alternative, then: simply move the assignment to 
 (and export of) IFS to a point immediately *after* the evaluation of the 
 command-line arguments.  In this way, the loop will appropriately 
 differentiate between the arguments, rather than failing to break the 
 evaluation of '$@' on the spaces between quoted values.
 
 In other words, rewrite:
 
   export IFS=
   
   for arg in $@ ; do
 . . . .
   done
 
 as:
 
   for arg in $@ ; do
 . . . .
   done
   export IFS=
   
 
 The content within the for loop appears to be space-friendly, since it's 
 using escaped double-quotes to build up the content of the fop_exec_args 
 variable from the values of $arg, and no other potential file names are 
 being used in the loop.
 
 I think this should maintain the space-friendly nature of all of the 
 subsquent code, while letting the for loop parse the data in a way that 
 is compliant with Bourne shell under Solaris (and possibly other 
 platforms) where the current code does not.
 
 (Hopefully I haven't missed anything ;-)
 
 -mjh
 --
 Matthew J. Healy
 Computer Science  Information Technology Departments
 Golisano College of Computing and Information Sciences, RIT
 mailto:[EMAIL PROTECTED]
 http://www.cs.rit.edu/~mjh
 Voice: (585) 248-3425
 

 J.Pietschmann

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/FOP-0.94-bin---Severe-Exceptions-on-Solaris-Box-tp16175972p16194929.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



FOP 0.94 bin - Severe Exceptions on Solaris Box

2008-03-20 Thread Newkid
 on
SOLARIS, I received the above mentioned error.

Any tip would be deeply appreciated.!
Newkid


-- 
View this message in context: 
http://www.nabble.com/FOP-0.94-bin---Severe-Exceptions-on-Solaris-Box-tp16175972p16175972.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: FOP 0.94 bin - Severe Exceptions on Solaris Box

2008-03-20 Thread John Brown

Newkid wrote:
 
 Support Cell,
 
 Could you please advice what needs to be done to run the FOP 0.94 on a
 solaris box? I have set the CLASSPATH; Convert the FOP.sh file for UNIX; etc
 for all necessary files but when I tried to run FOP on Solaris it's showing
 the below error:
 

Maybe your conversion is incorrect?

 *
 -bash-3.00$ Fop -xml abc.xml -xsl abc.xsl -pdf abc.pdf
 
[output snipped - prints help screen as if fop were called without parameters]
 
 Mar 20, 2008 3:28:36 PM org.apache.fop.cli.Main startFOP
 SEVERE: Exception
 java.lang.IllegalArgumentException: Error creating InputHandler object.
 at
 org.apache.fop.cli.CommandLineOptions.createInputHandler(CommandLineOptions.java:818)
 at
 org.apache.fop.cli.CommandLineOptions.parse(CommandLineOptions.java:165)
 at org.apache.fop.cli.Main.startFOP(Main.java:154)
 at org.apache.fop.cli.Main.main(Main.java:197)
 **
 I even tried ./Fop -d -xml abc.xml -xsl abc.xsl -pdf abc.pdf as suggested in
 other but still NO use. Please help me out and let me know what needs to be
 done more to get rid of this issue.
 
 The same application is working fine on WINDOWS box but when I deployed on
 SOLARIS, I received the above mentioned error.

 Any tip would be deeply appreciated.!
 Newkid


Apparently you used the Windows distribution and tried to convert it
to Unix. Why not download the Unix distribution instead? The filename
ends with .tar.gz.

It is possible that they are *not* identical except for the scripts, and
it is possible that your modification of the Cygwin fop.sh to Unix was
not correct.

 
_
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FOP 0.94 bin - Severe Exceptions on Solaris Box

2008-03-20 Thread Matt Healy

John Brown wrote:

Newkid wrote:
  

Support Cell,

Could you please advice what needs to be done to run the FOP 0.94 on a
solaris box? I have set the CLASSPATH; Convert the FOP.sh file for UNIX; etc
for all necessary files but when I tried to run FOP on Solaris it's showing
the below error:




Maybe your conversion is incorrect?
  
For what it's worth, I've been able to reproduce Newkid's problem under 
Solaris, using the 0.94 binary distribution from UNIX-friendly packaging 
(i.e., compressed tarballs).  I get both the help output, and the 
severe failure being reported.


Additional details:

   * Java version: Java(TM) SE Runtime Environment (build
 1.6.0_05-b13), Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)
   * OS version:  SunOS kiev 5.10 Generic_125101-10 i86pc i386 i86pc
 Solaris
   * I /did/ need to make one change to the fop script in order to
 run it correctly: since the version of Bourne shell on my system
 doesn't allow export VARIABLE=VALUE syntax, I had to break the
 definition of the IFS variable out as a separate step from its
 export.  (*Note this detail:* we'll come back to it shortly)



What I found interesting is that if I run the fop script as sh -x 
./fop /inputFile/ /outputFile/, and look at the traced execution, it 
looks fairly reasonable.  In fact, if I take the command that's actually 
be run at the final step (via the exec call) and run it by hand, the 
processing works correctly.


   % # Start failed run, using fop script
   % sh -x ./fop readme.fo readme.pdf
   
   + eval exec /usr/local/jdk/bin/java   -classpath
   /home/ifac/mjh/pub/fop-0.94/lib/xmlgraphics-commons-1.2.jar:/home/ifac/mjh/pub/fop-0.94/lib/xml-apis-1.3.02.jar:/home/ifac/mjh/pub/fop-0.94/lib/xercesImpl-2.7.1.jar:/home/ifac/mjh/pub/fop-0.94/lib/xalan-2.7.0.jar:/home/ifac/mjh/pub/fop-0.94/lib/serializer-2.7.0.jar:/home/ifac/mjh/pub/fop-0.94/lib/commons-logging-1.0.4.jar:/home/ifac/mjh/pub/fop-0.94/lib/commons-io-1.3.1.jar:/home/ifac/mjh/pub/fop-0.94/lib/batik-all-1.6.jar:/home/ifac/mjh/pub/fop-0.94/lib/avalon-framework-4.2.0.jar:/home/ifac/mjh/pub/fop-0.94/build/fop.jar:/home/ifac/mjh/pub/fop-0.94/build/fop-sandbox.jar:/home/ifac/mjh/pub/fop-0.94/build/fop-hyph.jar:.= 
   org.apache.fop.cli.Main  readme.fo readme.pdf

   + exec /usr/local/jdk/bin/java -classpath
   
/home/ifac/mjh/pub/fop-0.94/lib/xmlgraphics-commons-1.2.jar:/home/ifac/mjh/pub/fop-0.94/lib/xml-apis-1.3.02.jar:/home/ifac/mjh/pub/fop-0.94/lib/xercesImpl-2.7.1.jar:/home/ifac/mjh/pub/fop-0.94/lib/xalan-2.7.0.jar:/home/ifac/mjh/pub/fop-0.94/lib/serializer-2.7.0.jar:/home/ifac/mjh/pub/fop-0.94/lib/commons-logging-1.0.4.jar:/home/ifac/mjh/pub/fop-0.94/lib/commons-io-1.3.1.jar:/home/ifac/mjh/pub/fop-0.94/lib/batik-all-1.6.jar:/home/ifac/mjh/pub/fop-0.94/lib/avalon-framework-4.2.0.jar:/home/ifac/mjh/pub/fop-0.94/build/fop.jar:/home/ifac/mjh/pub/fop-0.94/build/fop-sandbox.jar:/home/ifac/mjh/pub/fop-0.94/build/fop-hyph.jar:.=
   org.apache.fop.cli.Main readme.fo readme.pdf

   USAGE
   Fop [options] [-fo|-xml] infile [-xsl file]
   [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print]
   outfile
[OPTIONS]
 -ddebug mode
   . . . .
[Examples]
 Fop foo.fo foo.pdf
 Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)
 Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf
 Fop -xml foo.xml -xsl foo.xsl -foout foo.fo
 Fop foo.fo -mif foo.mif
 Fop foo.fo -rtf foo.rtf
 Fop foo.fo -print or Fop -print foo.fo
 Fop foo.fo -awt

   Mar 20, 2008 11:58:59 AM org.apache.fop.cli.Main startFOP
   SEVERE: Exception
   org.apache.fop.apps.FOPException: No output file specified
   at
   
org.apache.fop.cli.CommandLineOptions.checkSettings(CommandLineOptions.java:698)
   at
   org.apache.fop.cli.CommandLineOptions.parse(CommandLineOptions.java:145)
   at org.apache.fop.cli.Main.startFOP(Main.java:154)
   at org.apache.fop.cli.Main.main(Main.java:197)

   % # Run the final Java command by hand
   % /usr/local/jdk/bin/java -classpath
   
/home/ifac/mjh/pub/fop-0.94/lib/xmlgraphics-commons-1.2.jar:/home/ifac/mjh/pub/fop-0.94/lib/xml-apis-1.3.02.jar:/home/ifac/mjh/pub/fop-0.94/lib/xercesImpl-2.7.1.jar:/home/ifac/mjh/pub/fop-0.94/lib/xalan-2.7.0.jar:/home/ifac/mjh/pub/fop-0.94/lib/serializer-2.7.0.jar:/home/ifac/mjh/pub/fop-0.94/lib/commons-logging-1.0.4.jar:/home/ifac/mjh/pub/fop-0.94/lib/commons-io-1.3.1.jar:/home/ifac/mjh/pub/fop-0.94/lib/batik-all-1.6.jar:/home/ifac/mjh/pub/fop-0.94/lib/avalon-framework-4.2.0.jar:/home/ifac/mjh/pub/fop-0.94/build/fop.jar:/home/ifac/mjh/pub/fop-0.94/build/fop-sandbox.jar:/home/ifac/mjh/pub/fop-0.94/build/fop-hyph.jar:.=
   org.apache.fop.cli.Main readme.fo readme.pdf
   %


This made me suspect that the problem was someplace in the shell script 
and how it's managing things, rather than in the actual FOP (Java) code.



*Diagnosis:*
If you take another look at the output when the script is 

Re: FOP 0.94 bin - Severe Exceptions on Solaris Box

2008-03-20 Thread J.Pietschmann

Matt Healy wrote:

I went back and checked the script, and found that IFS is being set just
to the newline character, and does not include spaces.


This is intentional: it avoids splitting directorie names which
contain spaces, which is rather common now especially on Windows.

J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FOP 0.94 bin - Severe Exceptions on Solaris Box

2008-03-20 Thread Matt Healy

On Thu, 20 Mar 2008, J.Pietschmann wrote:

Matt Healy wrote:

I went back and checked the script, and found that IFS is being set just
to the newline character, and does not include spaces.


This is intentional: it avoids splitting directorie names which
contain spaces, which is rather common now especially on Windows.


OK, I can certainly see that.

But I would respectfully suggest that if it's effectively causing the 
fop shell script to fail when executed within a stock 
Unix-based environment to break, it may make sense to look for 
other/additional approaches to resolving this problem.


I'll have to noodle around with this and see what I can come up with that 
preserves the sensitivity to embedded spaces in file names while 
addressing the failure to correctly build the command (at least under 
Solaris).


-mjh
--
Matthew J. Healy
Computer Science  Information Technology Departments
Golisano College of Computing and Information Sciences, RIT
mailto:[EMAIL PROTECTED]
http://www.cs.rit.edu/~mjh
Voice: (585) 248-3425

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]