You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Joseph <pj...@gmail.com> on 2011/10/11 17:38:55 UTC

Tomcat 64 bit

Hi there,

I am using a Cocoon jar (Version 2.11) file compiled on a 32 bit XP in a 
64 bit Tomcat (Version: 7.0.22 ) and using Java 64 bit 
(jre-6u24-windows-x64)

It runs against a 32 bit Postgresql database (V8.4).

It all seems to work well unless I call some special functionality in 
the flowscript that has to create a file on disk.  It then fails with 
the error shown below:

Question: do I need to recompile cocoon in 64 bit--is that the cause of 
this error?

Paul


  java.io.FileNotFoundException: C:\Program Files\Apache Software 
Foundation\apache-tomcat-7.0.22\bin\bootstrap.jar;C:\Program 
Files\Apache Software 
Foundation\apache-tomcat-7.0.22\bin\tomcat-juli.jar;C:\Program 
Files\Apache Software 
Foundation\apache-tomcat-7.0.22\webapps\array\webtask\cds\Test_request.xml 
(The filename, directory name, or volume label syntax is incorrect)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at java.io.FileWriter.<init>(Unknown Source)
      at 
org.apache.cocoon.ojb.samples.bean.XMLFragmentBean.generateFragment(XMLFragmentBean.java:23)


The call at line 23 of XMLFragmentBean.generateFrament is:         
BufferedWriter out = new BufferedWriter(new FileWriter(outputFile));


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tomcat 64 bit

Posted by Jasha Joachimsthal <j....@onehippo.com>.
On 11 October 2011 17:38, Paul Joseph <pj...@gmail.com> wrote:

> Hi there,
>
> I am using a Cocoon jar (Version 2.11) file compiled on a 32 bit XP in a 64
> bit Tomcat (Version: 7.0.22 ) and using Java 64 bit (jre-6u24-windows-x64)
>
> It runs against a 32 bit Postgresql database (V8.4).
>
> It all seems to work well unless I call some special functionality in the
> flowscript that has to create a file on disk.  It then fails with the error
> shown below:
>
> Question: do I need to recompile cocoon in 64 bit--is that the cause of
> this error?
>
> Paul
>
>
>  java.io.FileNotFoundException: C:\Program Files\Apache Software
> Foundation\apache-tomcat-7.0.**22\bin\bootstrap.jar;C:\**Program
> Files\Apache Software Foundation\apache-tomcat-7.0.**
> 22\bin\tomcat-juli.jar;C:\**Program Files\Apache Software
> Foundation\apache-tomcat-7.0.**22\webapps\array\webtask\cds\**Test_request.xml
> (The filename, directory name, or volume label syntax is incorrect)
>     at java.io.FileOutputStream.open(**Native Method)
>     at java.io.FileOutputStream.<**init>(Unknown Source)
>     at java.io.FileOutputStream.<**init>(Unknown Source)
>     at java.io.FileWriter.<init>(**Unknown Source)
>     at org.apache.cocoon.ojb.samples.**bean.XMLFragmentBean.**
> generateFragment(**XMLFragmentBean.java:23)
>
>
> The call at line 23 of XMLFragmentBean.**generateFrament is:
> BufferedWriter out = new BufferedWriter(new FileWriter(outputFile));
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.**apache.org<us...@cocoon.apache.org>
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
It's also possible that the spaces in your path cause the problem.

Jasha Joachimsthal

Europe - Amsterdam - Oosteinde 11, 1017 WT Amsterdam - +31(0)20 522 4466
US - Boston - 1 Broadway, Cambridge, MA 02142 - +1 877 414 4776 (toll free)

www.onehippo.com

Re: Tomcat 64 bit

Posted by Fawzib Rojas <f_...@spectron-msim.com>.
If you run Tomcat from said folder (C:\Program Files\Apache Software 
Foundation\apache-tomcat-7.0.22\) all u need is to find the current 
working directory.

I think System.out.println(new File(".").getAbsolutePath()) will print 
the working directory. It will have the "." at the end (at least in 
windows), remember to remove it.

On 10/11/2011 1:28 PM, Paul Joseph wrote:
> Hi Andy,
>
> Thank you very much for your crystal clear explanation, I get it now.
>
> Following your suggestion, I traced back the code and find that the 
> function below is the culprit.  I wrote it in an attempt to return the 
> "root directory" of the Tomcat application, and it has somehow managed 
> to work in 32 bit Tomcat over numerous installations.
>
> i.e. the function below, typically returns: "C:\Program Files\Apache 
> Software Foundation\apache-tomcat-7.0.22\", but is not working 
> apparently for this present 64 bit install, though on looking at it 
> after seven years, I must say I wonder how it has worked so long.
>
> Is there a more direct way to get this same info.?  Once I get this 
> string, I simply tack on the remaining part of the path to where I 
> would like to write the file.
>
> Thanks much!
> Paul
>
>   private static final String FILE_SEPARATOR = File.separator;
>
>   private String getRootDirAbsolutePath() {
>       SystemUtils systemBean = new SystemUtils();
>       String javaClassPath = systemBean.JAVA_CLASS_PATH;
>       String osName = systemBean.OS_NAME;
>       if(osName.equals("Linux")){
>           int index = javaClassPath.lastIndexOf(":");
>           javaClassPath=javaClassPath.substring(index+1, 
> javaClassPath.length());
>       }
>       String oneDirUp = 
> javaClassPath.substring(0,javaClassPath.lastIndexOf(FILE_SEPARATOR));
>       String twoDirsUp = 
> oneDirUp.substring(0,oneDirUp.lastIndexOf(FILE_SEPARATOR));
>       String rootDirAbsolutePath = twoDirsUp + FILE_SEPARATOR
>       return rootDirAbsolutePath;
>   }
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tomcat 64 bit

Posted by Paul Joseph <pj...@gmail.com>.
Hi Andy,

Thank you very much for your crystal clear explanation, I get it now.

Following your suggestion, I traced back the code and find that the 
function below is the culprit.  I wrote it in an attempt to return the 
"root directory" of the Tomcat application, and it has somehow managed 
to work in 32 bit Tomcat over numerous installations.

i.e. the function below, typically returns: "C:\Program Files\Apache 
Software Foundation\apache-tomcat-7.0.22\", but is not working 
apparently for this present 64 bit install, though on looking at it 
after seven years, I must say I wonder how it has worked so long.

Is there a more direct way to get this same info.?  Once I get this 
string, I simply tack on the remaining part of the path to where I would 
like to write the file.

Thanks much!
Paul

   private static final String FILE_SEPARATOR = File.separator;

   private String getRootDirAbsolutePath() {
       SystemUtils systemBean = new SystemUtils();
       String javaClassPath = systemBean.JAVA_CLASS_PATH;
       String osName = systemBean.OS_NAME;
       if(osName.equals("Linux")){
           int index = javaClassPath.lastIndexOf(":");
           javaClassPath=javaClassPath.substring(index+1, 
javaClassPath.length());
       }
       String oneDirUp = 
javaClassPath.substring(0,javaClassPath.lastIndexOf(FILE_SEPARATOR));
       String twoDirsUp = 
oneDirUp.substring(0,oneDirUp.lastIndexOf(FILE_SEPARATOR));
       String rootDirAbsolutePath = twoDirsUp + FILE_SEPARATOR
       return rootDirAbsolutePath;
   }


On 10/11/2011 12:13 PM, Andy Stevens wrote:
> Hi Paul,
>
> Cocoon can't be compiled in 32 or 64 bit as such; it's java so is 
> compiled to platform-independent java byte code.  The byte code is run 
> on a jvm, an architecture-specific application, and if you're using a 
> jvm with a "just-in-time" compiler that translates the byte code (or 
> parts of it) to native machine code to increase performance then that 
> will end up running 32 or 64 bit instructions.  But it's all at 
> runtime, nothing you can do about when building Cocoon.
>
> Judging by the error message, you're trying to open a path 
> ("C:\Program Files\Apache Software
> Foundation\apache-tomcat-7.0.22\bin\bootstrap.jar;C:\Program
> Files\Apache Software
> Foundation\apache-tomcat-7.0.22\bin\tomcat-juli.jar;\webtask\cds\Test_request.xml")as 
> a file, when obviously the string in question is a list of 3 
> semi-colonseparated filenames.  Unsurprisingly, it complains at this 
> "The filename,directory name, or volume label syntax is incorrect" as 
> I believe semicolonsaren't valid characters in windows filenames (and 
> unlikely to be found evenif they were).  My guess would be an error in 
> whatever bit of your code orsitemap is supplying the outputFile to the 
> XMLFragmentBean, if you can sendthe relevant bit of code I may be able 
> to be more 
> specific.Regards,Andy--http://original.justgiving.com/AndyStevens-Bikeathon2011Raising 
> money for Leukaemia Research----- Original Message -----From: "Paul 
> Joseph" <pj...@gmail.com>To: <us...@cocoon.apache.org>Sent: Tuesday, 
> October 11, 2011 4:38 PMSubject: Tomcat 64 bit> Hi there,>> I am using 
> a Cocoon jar (Version 2.11) file compiled on a 32 bit XP in a64 bit 
> Tomcat (Version: 7.0.22 ) and using Java 64 
> bit(jre-6u24-windows-x64)>> It runs against a 32 bit Postgresql 
> database (V8.4).>> It all seems to work well unless I call some 
> special functionality in theflowscript that has to create a file on 
> disk.  It then fails with the errorshown below:>> Question: do I need 
> to recompile cocoon in 64 bit--is that the cause ofthis error?>> 
> Paul>>>  java.io.FileNotFoundException: C:\Program Files\Apache 
> SoftwareFoundation\apache-tomcat-7.0.22\bin\bootstrap.jar;C:\Program 
> Files\ApacheSoftware 
> Foundation\apache-tomcat-7.0.22\bin\tomcat-juli.jar;C:\ProgramFiles\Apache 
> SoftwareFoundation\apache-tomcat-7.0.22\webapps\array\webtask\cds\Test_request.xml(The 
> filename, directory name, or volume label syntax is incorrect)>      
> at java.io.FileOutputStream.open(Native Method)>      at 
> java.io.FileOutputStream.<init>(Unknown Source)>      at 
> java.io.FileOutputStream.<init>(Unknown Source)>      at 
> java.io.FileWriter.<init>(Unknown Source)>      
> atorg.apache.cocoon.ojb.samples.bean.XMLFragmentBean.generateFragment(XMLFragmentBean.java:23)>>> 
> The call at line 23 of XMLFragmentBean.generateFrament 
> is:BufferedWriter out = new BufferedWriter(new 
> FileWriter(outputFile));>>> 
> ---------------------------------------------------------------------> 
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org> For 
> additional commands, e-mail: users-help@cocoon.apache.org>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tomcat 64 bit

Posted by Andy Stevens <in...@googlemail.com>.
Hi Paul,

Cocoon can't be compiled in 32 or 64 bit as such; it's java so is compiled 
to platform-independent java byte code.  The byte code is run on a jvm, an 
architecture-specific application, and if you're using a jvm with a 
"just-in-time" compiler that translates the byte code (or parts of it) to 
native machine code to increase performance then that will end up running 32 
or 64 bit instructions.  But it's all at runtime, nothing you can do about 
when building Cocoon.

Judging by the error message, you're trying to open a path ("C:\Program 
Files\Apache Software
 Foundation\apache-tomcat-7.0.22\bin\bootstrap.jar;C:\Program
 Files\Apache Software
 Foundation\apache-tomcat-7.0.22\bin\tomcat-juli.jar;C:\Program
 Files\Apache Software
 Foundation\apache-tomcat-7.0.22\webapps\array\webtask\cds\Test_request.xml")as a file, when obviously the string in question is a list of 3 semi-colonseparated filenames.  Unsurprisingly, it complains at this "The filename,directory name, or volume label syntax is incorrect" as I believe semicolonsaren't valid characters in windows filenames (and unlikely to be found evenif they were).  My guess would be an error in whatever bit of your code orsitemap is supplying the outputFile to the XMLFragmentBean, if you can sendthe relevant bit of code I may be able to be more specific.Regards,Andy--http://original.justgiving.com/AndyStevens-Bikeathon2011Raising money for Leukaemia Research----- Original Message -----From: "Paul Joseph" <pj...@gmail.com>To: <us...@cocoon.apache.org>Sent: Tuesday, October 11, 2011 4:38 PMSubject: Tomcat 64 bit> Hi there,>> I am using a Cocoon jar (Version 2.11) file compiled on a 32 bit XP in a64 bit Tomcat (Version: 7.0.22 ) and using Java 64 bit(jre
 -6u24-windows-x64)>> It runs against a 32 bit Postgresql database (V8.4).>> It all seems to work well unless I call some special functionality in theflowscript that has to create a file on disk.  It then fails with the errorshown below:>> Question: do I need to recompile cocoon in 64 bit--is that the cause ofthis error?>> Paul>>>  java.io.FileNotFoundException: C:\Program Files\Apache SoftwareFoundation\apache-tomcat-7.0.22\bin\bootstrap.jar;C:\Program Files\ApacheSoftware Foundation\apache-tomcat-7.0.22\bin\tomcat-juli.jar;C:\ProgramFiles\Apache SoftwareFoundation\apache-tomcat-7.0.22\webapps\array\webtask\cds\Test_request.xml(The filename, directory name, or volume label syntax is incorrect)>      at java.io.FileOutputStream.open(Native Method)>      at java.io.FileOutputStream.<init>(Unknown Source)>      at java.io.FileOutputStream.<init>(Unknown Source)>      at java.io.FileWriter.<init>(Unknown Source)>      atorg.apache.cocoon.ojb.samples.bean.XMLFragmentBean.generate
 Fragment(XMLFragmentBean.java:23)>>> The call at line 23 of XMLFragmentBean.generateFrament is:BufferedWriter out = new BufferedWriter(new FileWriter(outputFile));>>> ---------------------------------------------------------------------> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org> For additional commands, e-mail: users-help@cocoon.apache.org>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org