RE: SQL Server 2000: JDBC

2005-09-30 Thread Karasek-XID, Nicolas


-Original Message-
From: sree kanth [mailto:[EMAIL PROTECTED] 
Sent: vendredi 30 septembre 2005 05:27
To: Tomcat Users List; Lalit Batra
Subject: Re: SQL Server 2000: JDBC

Hello lalit,
we too had the problem of connection reset by peer and then we changed
the
Driver.Now we are using SourceForge driver jtds.jar.May be this may
solve ur
problem.
If anyone can find a better alternative please inform us.
Regards,
Sreekanth


I did the same, changed to jtds. I don't know if jtds is the best
solution, but the main tips if you use SQL Server is *not* to use the
Microsoft driver. Hibernate developers also recommend not to use it...

-- 
Nicolas


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



RE: Pre-compiled JSPs?

2005-09-05 Thread Karasek-XID, Nicolas
Hi,

You need to insert in your web.xml the reference to the precompiled
servlets. Jasper can generate a web.xml fragment when turning JSP into
servlets. You can then insert the fragment into your web.xml
Something like this with ant:

!-- turn jsp into servlets --
jasper2 verbose=0
package=your.package
validateXml=false
uriroot=${webapp.path}
webXmlFragment=generated-web.xml
outputDir=${webapp.path}/WEB-INF/src /

!-- Load the precompiled snippet into a property --
loadfile property=precompiled
srcFile= generated-web.xml
encoding=ISO-8859-1 /

!-- Now replace the web.xml with a predefined snippet --
!-- copy web.xml --
replace file=web.xml value=${precompiled}
replacetokenlt;!-- jsp-servlets will be inserted here - do not remove
this line --gt;/replacetoken
/replace



-Original Message-
From: Richard Burman [mailto:[EMAIL PROTECTED] 
Sent: lundi 5 septembre 2005 12:44
To: Tomcat Users List
Subject: Pre-compiled JSPs?

Hi everyone,

I have a fairly elaborate problem but hope that some people out there
can help with it.

I am trying to take a large webapp and create pre-compiled JSPs. We
already compile the java into class files, then package in JARs, then
finally a WAR, but we would like to be able to package the JSPs into a
neat package, too.

The first hurdle was trying to circumvent the issue of when JSPs include
each other and a bean is used in both JSPs but can only be declared once
when the JSPs are combined. Thus, you have to leave out the bean
declaration in the second JSP but then it will not compile on it's own
because it has no knowledge of the bean. Fortunately, in the recent
Tomcat releases, it's possible to use the flag
'errorOnUseBeanInvalidClassAttribute' to ignore this problem.

Once the JSPs have been turned into Java classes by Jasper2, it's not
too hard to compile them into class files. But how do you deploy these
compiled classes so that Tomcat knows to use them? If the Whatever.jsp
file doesn't exist, how does Tomcat know where or how to find the
compiled JSP file? Should I put them in a JAR and deploy somewhere? Do I
need to change the web.xml or similar to inform Tomcat about this?

If anyone has any suggestions, advice or solutions to this, I would be
eternally grateful! :)

Thanks,
Richard.

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



redeploy problem

2005-08-09 Thread Karasek-XID, Nicolas
Hello,
I encounter an issue on redeploy ( ie undeploy/deploy a web archive)
I use jakarta ant task on windows XP and tomcat 5.5.9 to deploy the web 
archive. The ant task undeploy/deploy the application.
I also use sometime the undeploy link of tomcat manager which produce also the 
same error.
Does anyone encounter this on windows platform ? And was able to fix it ?


The produced error is :

code
INFO: Repli (undeploy) de l'application web ayant pour chemin de contexte 
/THEAPP
9 août 2005 08:49:05 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor 
processChildren
GRAVE: Exception invoking periodic operation: 
java.lang.NullPointerException
at 
org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:883)
at 
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1003)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1162)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
at java.lang.Thread.run(Thread.java:595)
/code

The context.xml file is :

code

?xml version=1.0 encoding=ISO-8859-1?
Context path=/THEAPP docBase=THEAPP debug=0 privileged=false
antiResourceLocking=true antiJARLocking=true

!-- define a datasource for THEAPP - Tomcat 5.5.x style --
!-- JDBC driver for SQL Server is jtds--
Resource name=jdbc/TheAppDB auth=Container
type=javax.sql.DataSource
factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
username=TheApp password=Pass
driverClassName=net.sourceforge.jtds.jdbc.Driver
url=jdbc:jtds:sqlserver://dbserver/TheApp maxWait=1 
maxActive=0
maxIdle=0 initialSize=5 minActive=5 /
Environment name=version type=java.lang.String value=3.1.0 /

/Context

/code

-- 
Nicolas

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



RE: tomcat list ant task queries

2005-06-23 Thread Karasek-XID, Nicolas
Hi Tim,
To prevent the Undeploy task failing to stop the process you can wrap it
in a TryCatch task from ant contrib.
Take a look at http://ant-contrib.sourceforge.net/

-- 
Nicolas

-Original Message-
From: Tim Diggins [mailto:[EMAIL PROTECTED] 
Sent: jeudi 23 juin 2005 13:28
To: Tomcat
Subject: tomcat list ant task queries

Hi -

(using ant to deploy an application for testing purposes)

Is there a way to use the list anttask to put the list of installed 
tasks into a property?

That way I could make a very flexible reload target which would check 
if the context was already in the list, and if it was then undeploy it, 
and then finally deploy it (otherwise the undeploy task generates an 
error which stops the process).

Or is there another (better) way to do this?

thanks in advance

Tim

-
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-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 to be

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

HTMLManager FAIL :

2005-05-26 Thread Karasek-XID, Nicolas
Hello,

With tomcat 5.5.4, I'm trying to deploy a war in tomcat manager and I'm
getting the following exception :

SEVERE: Exception invoking periodic operation: 
java.lang.NullPointerException
at
org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:87
5)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:98
3)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1139)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:29
2)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.j
ava:1293)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1553)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1562)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1542)
at java.lang.Thread.run(Unknown Source)

Any idea for this ? 

Note that the deploiement process work perfectly on another tomcat
(5.5.9) when I use the ant task.

-- 
Nicolas

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



Unable to pre-compile JSP with jspC ant task

2005-05-19 Thread Karasek-XID, Nicolas
Hello,

I'm trying to precompile jsp pages with Ant before deploying a Web
Archive.

The ant task I'm using is :

!--  definition of jspc task === --
taskdef classname=org.apache.jasper.JspC name=jasper2
classpath
path id=jspc.classpath
pathelement
location=${java.home}/../lib/tools.jar /
!--  My Jars, commented
= --
!--
fileset dir=${source.libs.dir}
include name=*.jar /
/fileset 
--
!--  End of My Jars
= --
fileset dir=${tomcat.home.dir}/server/lib
include name=*.jar /
/fileset
fileset dir=${tomcat.home.dir}/common/lib
include name=*.jar /
/fileset
fileset dir=${tomcat.home.dir}/bin
include name=commons-logging-api.jar
/
/fileset
/path
/classpath
/taskdef

Notice I commented the reference to the library directory.

The task is then used by:

!-- = --
!-- Compiles the jsp pages--
!-- = --
target name=jspc depends= description=Compile jsp pages with
jasper2
mkdir dir=${jspc.src.dir} /
jasper2 
verbose=1 
validateXml=false 
uriroot=${eclipse.my-app.dir}/web 
webXmlFragment=build/WEB-INF 
outputDir=build/WEB-INF/src /
javac destdir=${deploy.class.dir}
classpathref=jspc.classpath
src path=${jspc.src.dir}
/src
/javac
/target


When I launch the task, I got the following error on a jsp file:

org.apache.jasper.JasperException:
file:C:/eclipse/workspace/MyWebApp/web/jsp/login/index.jsp(18,0) The
value for the useBean class attribute myapp.jspbean.IndexJspBean is
invalid.

The error in the index.jsp file come from the line:

jsp:useBean id=indexJspBean scope=session class=
myapp.jspbean.IndexJspBean / 

As I thought that I should give to jspC a reference to the Bean, I tried
to package the Bean in a jar file, put it in library directory and then
uncommenting the reference to the libray directory in the previous ant
file  sample, but I got then the following error:

[jasper2] java.lang.NullPointerException
[jasper2]   at
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationCon
text.java:220)
[jasper2]   at org.apache.jasper.JspC.processFile(JspC.java:809)
[jasper2]   at org.apache.jasper.JspC.execute(JspC.java:945)
[jasper2]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[jasper2]   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
[jasper2]   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[jasper2]   at java.lang.reflect.Method.invoke(Unknown Source)
[jasper2]   at
org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
[jasper2]   at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[jasper2]   at org.apache.tools.ant.Task.perform(Task.java:364)
[jasper2]   at org.apache.tools.ant.Target.execute(Target.java:341)
[jasper2]   at
org.apache.tools.ant.Target.performTasks(Target.java:369)
[jasper2]   at
org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[jasper2]   at
org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[jasper2]   at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunne
r.java:633)
[jasper2]   at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunne
r.java:412)
[jasper2]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[jasper2]   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
[jasper2]   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[jasper2]   at java.lang.reflect.Method.invoke(Unknown Source)
[jasper2]   at
org.eclipse.ant.core.AntRunner.run(AntRunner.java:350)
[jasper2]   at
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run
(AntLaunchDelegate.java:182)
[jasper2]   at java.lang.Thread.run(Unknown Source)
BUILD FAILED: C:\eclipse\workspace\MywebApp\build.xml:158:
org.apache.jasper.JasperException

I'm using the task shipped with tomcat 5.5.4.

Have anyone an idea about what I'm missing ?

Regards,

-- 
Nicolas

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