RE: Use JSPC

2005-06-23 Thread Karasek-XID, Nicolas
Ok, I tried the simple hello world jsp, with the same result.
Adding the path to my jars and/or classes lead to the same issue.
I also removed my tomcat 5.5.9 installed from windows installer to use the the 
zipped archived (it contain a jspc.bat script) without success.
Another try was to use ant from command line, with the same result.
I cant figure out what I'm missing as I'm not so experimented in j2ee.
Anyway I'm still trying to make jspc work...


-Original Message-
From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
Sent: mercredi 22 juin 2005 15:27
To: 'Tomcat Users List'
Subject: AW: Use JSPC


What I think is missing is the Webapplication classes in your classpath, so:
 fileset dir=${webapp.path}/lib 
   include name=*.jar/ 
 /fileset 
 fileset dir=${webapp.path}/classes 
   include name=**/*.class/ 
 /fileset 
But I didn't test this on my System.

But narrow it down I would do the following:
Just write a simple Hello world jsp and remove all other Jsps from your
application.
Try to get jasper working with this file, if it's working fine, then you
know an application specfic calls is not picked up.
If the Hello world jsp does not work, you know it's a Tomcat/JRE class
which is missing.

Cheers

Bernhard

 target name=jspc 
 
 taskdef classname=org.apache.jasper.JspC name=jasper2  
   classpath id=jspc.classpath 
 pathelement location=${java.home}/../lib/tools.jar/ 
 fileset dir=${tomcat.home}/bin 
   include name=*.jar/ 
 /fileset 
 fileset dir=${tomcat.home}/server/lib 
   include name=*.jar/ 
 /fileset 
 fileset dir=${tomcat.home}/common/lib 
   include name=*.jar/ 
 /fileset 
   /classpath 
 /taskdef 
 
 jasper2 
  validateXml=false 
  uriroot=${webapp.path} 
  
 webXmlFragment=${webapp.path}/WEB-INF/generated_web.xml 
  outputDir=${webapp.path}/WEB-INF/src / 
 
   /target
 
 However If someone see a point to check...
 
 -Original Message-
 From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
 Sent: mercredi 22 juin 2005 11:07
 To: 'Tomcat Users List'
 Subject: AW: Use JSPC
 
 Hi Nicolas,
 
 what jspc basically needs, is acces to all the internal 
 tomcat libraries,
 as you see from the ant script:
 ${tomcat.home}/bin/*.jar
 ${tomcat.home}/server/lib/*.jar
 ${tomcat.home}/common/lib/*.jar
 
 As well as all the libraries from you web application.
 So what I did was just installing (unzipping) Tomcat on my 
 deployment
 machine, just in order to the able to do the precomplation. I 
 think you can
 also just download the deployer distribution
 (http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi) this
 should contain all the stuff you need for the deployment. But 
 I don't have
 experience with the deployer application.
 
 Conerning you web application: You need to include all the classes and
 libraries in the classpath as well, but it doesn't have to be under
 ${tomcat.home}/webapps it can be anywhere on your deployment machine.
 Maybe what's missing is that you have to include the /WEB-INF/classes
 directory too in your ant script.
 It's not in mine because I only use jar files in my webapp.
 
 Good luck!
 
 Bernhard
 
 
  -Ursprüngliche Nachricht-
  Von: Karasek-XID, Nicolas [mailto:[EMAIL PROTECTED]
  Gesendet: Mittwoch, 22. Juni 2005 10:26
  An: Tomcat Users List
  Betreff: RE: Use JSPC
  
  
  Hi bernhard,
  
  Just a few dumb questions on this, I still have problem to 
  generate servlets source files from jsp.
  From a previous message you sent on this subject in another 
  thread I guess I have a classpath problem in my jspc task ( 
  NullPointerException at 
  org.apache.jasper.JspCompilationContext.createCompiler(JspComp
  ilationContext.java:220) with tomcat 5.5.9).
  I think I have the correct values for getting tools.jar and 
  jasper jars in jspc.classpath.
  So, should the webapp be placed in tomcat webapps directory 
  in order to allow jspc work ? or maybe it doesn't matter ?
  Maybe someone have an idea on what I miss...
  
  -- 
  Nicolas
  
  
  -Original Message-
  From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
  Sent: jeudi 16 juin 2005 11:44
  To: 'Tomcat Users List'
  Subject: AW: Use JSPC
  
  Hi Mino,
  
  just one thing to add to the very good answer from Charl:
  I post you my ant sccript, which does all together precompiling and
  automatic generation of the web.xml file.
  You might take it as a basis for your stuff.
  
  Cheers
  
  Bernhard
  
  !-- do the precompilation --
  target name=jspc depends=get-properties-stage  
  mkdir dir=${webapproot}/src/
  
  !-- define the jasper task --
  taskdef classname=org.apache.jasper.JspC 
  name=jasper2 
  
  classpath id=jspc.classpath 
  pathelement
  location=${java.home}/../lib

RE: Use JSPC

2005-06-23 Thread Karasek-XID, Nicolas
Hurrey! I finally succeed to solve my problem. The way is not very orthodox but 
at least jsp are turned into servlets.
So I removed the classpath/classpath from the jasper taskdef markup and 
added the needed jars at hand into eclipse ant configuration.
For the one interested the concerned jars are :
- commons-logging-api.jar 
- commons-el.jar
- jasper-compiler.jar
- jasper-runtime.jar
- tools.jar from jdk
Moreover I included the folder of my class files.
It seems that the troubles came from the addition of classpath markup in jasper 
taskdef. Maybe a conflict with a previously added jars in ant classpath as I've 
seen lot of people using jspc without problem.


-Original Message-
From: Karasek-XID, Nicolas 
Sent: jeudi 23 juin 2005 15:43
To: Tomcat Users List
Subject: RE: Use JSPC

Ok, I tried the simple hello world jsp, with the same result.
Adding the path to my jars and/or classes lead to the same issue.
I also removed my tomcat 5.5.9 installed from windows installer to use the the 
zipped archived (it contain a jspc.bat script) without success.
Another try was to use ant from command line, with the same result.
I cant figure out what I'm missing as I'm not so experimented in j2ee.
Anyway I'm still trying to make jspc work...


-Original Message-
From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
Sent: mercredi 22 juin 2005 15:27
To: 'Tomcat Users List'
Subject: AW: Use JSPC


What I think is missing is the Webapplication classes in your classpath, so:
 fileset dir=${webapp.path}/lib 
   include name=*.jar/ 
 /fileset 
 fileset dir=${webapp.path}/classes 
   include name=**/*.class/ 
 /fileset 
But I didn't test this on my System.

But narrow it down I would do the following:
Just write a simple Hello world jsp and remove all other Jsps from your
application.
Try to get jasper working with this file, if it's working fine, then you
know an application specfic calls is not picked up.
If the Hello world jsp does not work, you know it's a Tomcat/JRE class
which is missing.

Cheers

Bernhard

 target name=jspc 
 
 taskdef classname=org.apache.jasper.JspC name=jasper2  
   classpath id=jspc.classpath 
 pathelement location=${java.home}/../lib/tools.jar/ 
 fileset dir=${tomcat.home}/bin 
   include name=*.jar/ 
 /fileset 
 fileset dir=${tomcat.home}/server/lib 
   include name=*.jar/ 
 /fileset 
 fileset dir=${tomcat.home}/common/lib 
   include name=*.jar/ 
 /fileset 
   /classpath 
 /taskdef 
 
 jasper2 
  validateXml=false 
  uriroot=${webapp.path} 
  
 webXmlFragment=${webapp.path}/WEB-INF/generated_web.xml 
  outputDir=${webapp.path}/WEB-INF/src / 
 
   /target
 
 However If someone see a point to check...
 
 -Original Message-
 From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
 Sent: mercredi 22 juin 2005 11:07
 To: 'Tomcat Users List'
 Subject: AW: Use JSPC
 
 Hi Nicolas,
 
 what jspc basically needs, is acces to all the internal 
 tomcat libraries,
 as you see from the ant script:
 ${tomcat.home}/bin/*.jar
 ${tomcat.home}/server/lib/*.jar
 ${tomcat.home}/common/lib/*.jar
 
 As well as all the libraries from you web application.
 So what I did was just installing (unzipping) Tomcat on my 
 deployment
 machine, just in order to the able to do the precomplation. I 
 think you can
 also just download the deployer distribution
 (http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi) this
 should contain all the stuff you need for the deployment. But 
 I don't have
 experience with the deployer application.
 
 Conerning you web application: You need to include all the classes and
 libraries in the classpath as well, but it doesn't have to be under
 ${tomcat.home}/webapps it can be anywhere on your deployment machine.
 Maybe what's missing is that you have to include the /WEB-INF/classes
 directory too in your ant script.
 It's not in mine because I only use jar files in my webapp.
 
 Good luck!
 
 Bernhard
 
 
  -Ursprüngliche Nachricht-
  Von: Karasek-XID, Nicolas [mailto:[EMAIL PROTECTED]
  Gesendet: Mittwoch, 22. Juni 2005 10:26
  An: Tomcat Users List
  Betreff: RE: Use JSPC
  
  
  Hi bernhard,
  
  Just a few dumb questions on this, I still have problem to 
  generate servlets source files from jsp.
  From a previous message you sent on this subject in another 
  thread I guess I have a classpath problem in my jspc task ( 
  NullPointerException at 
  org.apache.jasper.JspCompilationContext.createCompiler(JspComp
  ilationContext.java:220) with tomcat 5.5.9).
  I think I have the correct values for getting tools.jar and 
  jasper jars in jspc.classpath.
  So, should the webapp be placed in tomcat webapps directory 
  in order to allow jspc work ? or maybe it doesn't matter ?
  Maybe someone have an idea on what I miss...
  
  -- 
  Nicolas
  
  
  -Original

RE: Use JSPC

2005-06-22 Thread Karasek-XID, Nicolas
Hi bernhard,

Just a few dumb questions on this, I still have problem to generate servlets 
source files from jsp.
From a previous message you sent on this subject in another thread I guess I 
have a classpath problem in my jspc task ( NullPointerException at 
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:220)
 with tomcat 5.5.9).
I think I have the correct values for getting tools.jar and jasper jars in 
jspc.classpath.
So, should the webapp be placed in tomcat webapps directory in order to allow 
jspc work ? or maybe it doesn't matter ?
Maybe someone have an idea on what I miss...

-- 
Nicolas


-Original Message-
From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
Sent: jeudi 16 juin 2005 11:44
To: 'Tomcat Users List'
Subject: AW: Use JSPC

Hi Mino,

just one thing to add to the very good answer from Charl:
I post you my ant sccript, which does all together precompiling and
automatic generation of the web.xml file.
You might take it as a basis for your stuff.

Cheers

Bernhard

!-- do the precompilation --
target name=jspc depends=get-properties-stage  
mkdir dir=${webapproot}/src/

!-- define the jasper task --
taskdef classname=org.apache.jasper.JspC name=jasper2 

classpath id=jspc.classpath 
pathelement
location=${java.home}/../lib/tools.jar/ 
fileset dir=${tomcat.home}/bin 
include name=*.jar/ 
/fileset 
fileset dir=${tomcat.home}/server/lib 
include name=*.jar/ 
/fileset 
fileset dir=${tomcat.home}/common/lib 
include name=*.jar/ 
/fileset
fileset
dir=${webapproot}${webappname}/WEB-INF/lib 
include name=*.jar/
/fileset
/classpath
/taskdef 

!-- execute jasper, creates the servlet source files --
jasper2 
validateXml=false 
uriroot=${webapproot}${webappname} 
 
webXmlFragment=${webapproot}${webappname}/WEB-INF/generated_web.xml 
outputDir=${webapproot}/src / 

!-- compile the source files --
javac destdir=${webapproot}${webappname}/WEB-INF/classes
optimize=off
debug=on failonerror=false
srcdir=${webapproot}/src 
excludes=**/*.smap
classpath
pathelement
location=${webapproot}${webappname}/WEB-INF/classes/
pathelement
location=${tomcat.home}/common/classes/
pathelement
location=${tomcat.home}/shared/classes/
fileset dir=${tomcat.home}/common/lib
include name=*.jar/
/fileset
fileset dir=${tomcat.home}/shared/lib
include name=*.jar/
/fileset
fileset dir=${tomcat.home}/bin 
include name=*.jar/ 
/fileset 
fileset
dir=${webapproot}${webappname}/WEB-INF/lib 
include name=*.jar/
/fileset
/classpath
include name=** /
exclude name=tags/** /
/javac

!-- Load your precompiled snippet into a property --
loadfile property=precompiled

srcFile=${webapproot}${webappname}/WEB-INF/generated_web.xml
encoding=ISO-8859-1/

!-- Now replace the web.xml with a predifined snippet --
replace file=${webapproot}${webappname}/WEB-INF/web.xml
value=${precompiled}
replacetoken![CDATA[!-- precompile include
--]]/replacetoken
/replace
/target 

 -Ursprüngliche Nachricht-
 Von: Charl Gerber [mailto:[EMAIL PROTECTED]
 Gesendet: Donnerstag, 16. Juni 2005 11:24
 An: Tomcat Users List
 Betreff: Re: Use JSPC
 
 
 If you have the generated java files, you can compile
 them like any other java class (remember to setup your
 classpath correctly, including some jars in the Tomcat
 libraries).
 
 Trickier to figure out first time round is to
 dynamically create the web.xml settings. Every .jsp
 now effectively becomes a servlet which needs

RE: Use JSPC

2005-06-22 Thread Karasek-XID, Nicolas
Assuming an configuration problem on my PC to be the cause of my problem,  I 
did successively:
- desinstall tomcat 5.5.9 (there was one to test the web app)
- desinstall jdk 1.5.0_03 and an anterior jdk 1.4
- install jdk 1.5.0_03, with standard directories option
- install tomcat

After that I did a copy/paste in my build.xml of the jspc task found at 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html

target name=jspc 

taskdef classname=org.apache.jasper.JspC name=jasper2  
  classpath id=jspc.classpath 
pathelement location=${java.home}/../lib/tools.jar/ 
fileset dir=${tomcat.home}/bin 
  include name=*.jar/ 
/fileset 
fileset dir=${tomcat.home}/server/lib 
  include name=*.jar/ 
/fileset 
fileset dir=${tomcat.home}/common/lib 
  include name=*.jar/ 
/fileset 
  /classpath 
/taskdef 

jasper2 
 validateXml=false 
 uriroot=${webapp.path} 
 webXmlFragment=${webapp.path}/WEB-INF/generated_web.xml 
 outputDir=${webapp.path}/WEB-INF/src / 

  /target

First attempt, it still throw a NullPointerException ( 
java.lang.NullPointerException at 
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:220
 ) but I remarked a problem.
The ant task assume that the presence of tools.jar at:

pathelement location=${java.home}/../lib/tools.jar/

But the jdk 1.5 on windows install the following directories :
C:
  +Program Files
 +Java
   +jdk1.5.0_03
   +jre1.5.0_03
and make point ${java.home} to c:/Program Files/Java/jre1.5.0_03 and so cannot 
find tools.jar at ${java.home}/../lib/tools.jar

ok, no problem. As I didn't want to modify the copy/pasted task from 
jasper-howto, I decided to use the jre shipped with jdk at c:/Program 
Files/Java/jdk1.5.0_03/jre.
So I removed the jre from system, added the registry key for 1.5 - removed 
during jre desinstall - that point to the correct JavaHome, RuntimeLib and try 
again with a corrected ${java.home}.

Unfortunately this second attempt failed too. NullPointerException is back . 
Aargh.
For information, I set ${tomcat.home} to C:/Program Files/Apache Software 
Foundation/Tomcat 5.5 and the webapp.path is set to the directory 
c:/eclipse/workspace/myWebApp/build which has the following structure :

+build
  +WEB-INF
+classes
my_classes_files
+lib
   my_libs
+src
   my_source_files
web.xml
  +META-INF
context.xml
  +some_jsp_directories
index.jsp
error.jsp
   
so I arrived to a conclusion: it seems that I have 2 left hands :o)
However If someone see a point to check...

-- 
Nicolas

-Original Message-
From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
Sent: mercredi 22 juin 2005 11:07
To: 'Tomcat Users List'
Subject: AW: Use JSPC

Hi Nicolas,

what jspc basically needs, is acces to all the internal tomcat libraries,
as you see from the ant script:
${tomcat.home}/bin/*.jar
${tomcat.home}/server/lib/*.jar
${tomcat.home}/common/lib/*.jar

As well as all the libraries from you web application.
So what I did was just installing (unzipping) Tomcat on my deployment
machine, just in order to the able to do the precomplation. I think you can
also just download the deployer distribution
(http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi) this
should contain all the stuff you need for the deployment. But I don't have
experience with the deployer application.

Conerning you web application: You need to include all the classes and
libraries in the classpath as well, but it doesn't have to be under
${tomcat.home}/webapps it can be anywhere on your deployment machine.
Maybe what's missing is that you have to include the /WEB-INF/classes
directory too in your ant script.
It's not in mine because I only use jar files in my webapp.

Good luck!

Bernhard


 -Ursprüngliche Nachricht-
 Von: Karasek-XID, Nicolas [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 22. Juni 2005 10:26
 An: Tomcat Users List
 Betreff: RE: Use JSPC
 
 
 Hi bernhard,
 
 Just a few dumb questions on this, I still have problem to 
 generate servlets source files from jsp.
 From a previous message you sent on this subject in another 
 thread I guess I have a classpath problem in my jspc task ( 
 NullPointerException at 
 org.apache.jasper.JspCompilationContext.createCompiler(JspComp
 ilationContext.java:220) with tomcat 5.5.9).
 I think I have the correct values for getting tools.jar and 
 jasper jars in jspc.classpath.
 So, should the webapp be placed in tomcat webapps directory 
 in order to allow jspc work ? or maybe it doesn't matter ?
 Maybe someone have an idea on what I miss...
 
 -- 
 Nicolas
 
 
 -Original Message-
 From: Bernhard Slominski [mailto:[EMAIL PROTECTED] 
 Sent: jeudi 16 juin 2005 11:44
 To: 'Tomcat Users List'
 Subject: AW: Use JSPC
 
 Hi Mino,
 
 just one thing to add to the very good answer from Charl:
 I post you my ant sccript

RE: Use JSPC

2005-06-20 Thread Akoulov, Alexandre [IT]
Hi Mino,

that is what we do:
a) generate java files with JspC compiler
b) compile java files with javac compiler
c) copy class files to the required location (ie class directory under WEB-INF )


Hope it helps,

Sasha.

-Original Message-
From: Giacomino Raccuia [mailto:[EMAIL PROTECTED]
Sent: Thursday, 16 June 2005 7:13 PM
To: tomcat-user@jakarta.apache.org
Subject: Use JSPC


Hi,
I'd like to compile the JSP pages when I upload some new files on server 
(tomcat 4.0.3) . I use the utility JSPC, but this generate only java 
file but not the class file. I read that JRun has JSPC with -compile 
argument while my JSPC utilty doesn't have thi argument.
Is possible to generate class file with tomcat and JSPC? Or there is 
another utility to use?

Thanks in advance.
Bye
Mino


-
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]



RE: Use JSPC

2005-06-20 Thread Charl Gerber
And remember to update your web.xml with the servlet
and servlet mapping elements for the generated
classes. It looks a bit daunting at first, but the
examples on the Tomcat site will be a good help and
once done, it it actually quite straigtforward. Its
done automatically by an ant script, in case you
thought you had to do it manually (well, you could
I guess) .

Charl


--- Akoulov, Alexandre [IT]
[EMAIL PROTECTED] wrote:

 Hi Mino,
 
 that is what we do:
 a) generate java files with JspC compiler
 b) compile java files with javac compiler
 c) copy class files to the required location (ie
 class directory under WEB-INF )
 
 
 Hope it helps,
 
 Sasha.
 
 -Original Message-
 From: Giacomino Raccuia
 [mailto:[EMAIL PROTECTED]
 Sent: Thursday, 16 June 2005 7:13 PM
 To: tomcat-user@jakarta.apache.org
 Subject: Use JSPC
 
 
 Hi,
 I'd like to compile the JSP pages when I upload some
 new files on server 
 (tomcat 4.0.3) . I use the utility JSPC, but this
 generate only java 
 file but not the class file. I read that JRun has
 JSPC with -compile 
 argument while my JSPC utilty doesn't have thi
 argument.
 Is possible to generate class file with tomcat and
 JSPC? Or there is 
 another utility to use?
 
 Thanks in advance.
 Bye
 Mino
 
 

-
 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]
 
 


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



Re: Use JSPC

2005-06-16 Thread Charl Gerber
If you have the generated java files, you can compile
them like any other java class (remember to setup your
classpath correctly, including some jars in the Tomcat
libraries).

Trickier to figure out first time round is to
dynamically create the web.xml settings. Every .jsp
now effectively becomes a servlet which needs to be
added to your web.xml. Using ant its all done
automatically, but getting it set up first time round
can be tricky.

Charl


--- Giacomino Raccuia [EMAIL PROTECTED]
wrote:

 Hi,
 I'd like to compile the JSP pages when I upload some
 new files on server 
 (tomcat 4.0.3) . I use the utility JSPC, but this
 generate only java 
 file but not the class file. I read that JRun has
 JSPC with -compile 
 argument while my JSPC utilty doesn't have thi
 argument.
 Is possible to generate class file with tomcat and
 JSPC? Or there is 
 another utility to use?
 
 Thanks in advance.
 Bye
 Mino
 
 

-
 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]