Question
· Mar 14, 2016

[SOLVED] Compiling projections after creating

[SOLVED]

added 

>/tmp/compilew.log &>/tmp/compilew.log ; tail /tmp/compilew.log

to redirect the output to the stdout. Somehow the javac has wierd behavior with the output on errors and verbose information.

Hi,

i want the JAVA-Projections and wrappers to compile after Caché created the files. The creation of the files works 100%.

My addition to createProjection in our Projectionclass is following:

if ($g(%jrodebug)=1) {
!,"...compile:"
!,"DEVICE : "_$g(%qdev)
!,"$IO : "_$IO
#dim cPathTranslated = $tr(classname,".","/")
#dim cClassnamePath = $p(cPathTranslated,"/",1,$l(cPathTranslated,"/")-1)_"/"
#dim cClassname = $p(cPathTranslated,"/",$l(cPathTranslated,"/"))
//w !,"Classname=" _ cClassname
//w !,"Path= "_cClassnamePath
!,"-----JAVA Kompiler Aufruf-----"
!,"javac /pum/pmssys/system7/java/cache/wrappers/"_cClassnamePath_"Execute"_cClassname_"* -d /pum/online/system7/JSP/WEB-INF/classes/.",!
!,"javac /pum/pmssys/system7/java/cache/projections/"_cClassnamePath_cClassname_".java -d /pum/online/system7/JSP/WEB-INF/classes/.",!
"--------------------------------"
!,"Ergebnis:"
#dim wrappercomp = "sudo -u root ssh 10.8.8.99 /usr/bin/javac /pum/pmssys/system7/java/cache/wrappers/"_cClassnamePath_"Execute"_cClassname_"* -d /pum/online/system7/JSP/WEB-INF/classes/."
#dim projcomp = "sudu -u root ssh 10.8.8.99 /usr/bin/javac /pum/pmssys/system7/java/cache/projections/"_cClassnamePath_cClassname_".java -d /pum/online/system7/JSP/WEB-INF/classes/."
#dim tSatz, tSatz2
#dim olddev = $IO
wrappercomp:("QR")
wrappercomp tSatz olddev !,tSatz
wrappercomp
projcomp:("QR")
projcomp
olddev

Problem is as soon as I want to read the output of javac using "u wrappercomp" Studio getting a network error. 

I don't know why I can write the "-----JAVA " stuff out to console and can't read the output of the javac and writing it out to the Studio. 

Here is the output in Studio if I quit right after the $IO debugging outputs:

Compilation started on 03/14/2016 16:42:01 with qualifiers 'cukfv /checkuptodate=expandedonly'
Compiling class Online.Queries.PerQueries3
Compiling table Online_Queries.PerQueries3
Compiling routine Online.Queries.PerQueries3.1
Generating Java Binding: /pum/pmssys/system7/java/cache/projections/Online/Queries/PerQueries3.java
Generating S7 Wrappers for Online.Queries.PerQueries3...
...access class: PerQueries3
...executes:
...selects: Angebotssuche KalenderSubmissionAktuell KalenderTermineJeZeitraum VersandadressenJeAuftragsmappe
...dyn.queries:
...finished.
...compile:
DEVICE : |TCP|1972|28274
$IO : |TCP|1972|28274
Compilation finished successfully in 1.064s.

Any ideas?

Discussion (2)2
Log in or sign up to continue

If your READ from wrappercomp raises an error (e.g. end of file) you don't have anything in place to catch this error, CLOSE wrappercomp and USE olddev once more. I suggest you add some code (for example a TRY/CATCH block) to do this, and also to tell you what the error was. That information might help you find out why the wrappercomp pipe didn't work as you expected.