You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Claassen <mc...@ocie.net> on 2007/06/08 18:28:37 UTC

Using Javac instead of JDT to compile JSPs

Has anyone tried to get the jasper compiler to be something other than the
JDT?  I tried several things, each of them not working.

The docs say an alternative compiler can be specified, but makes no mention
of how to specify it.

This seems to be controlled by settings in the web.xml.  
Below is a part of my web.xml from my latest try (which failed).

Thanks,
Mark


web.xml section
---------------
<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>compiler</param-name>
        <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>
    </init-param>
    <init-param>
        <param-name>fork</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>

 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by Lakshmi Venkataraman <la...@foundrynet.com>.
CORRECTION: In step 5, I mean  <servlet-mapping> and NOT <servlet-name>.

-----Original Message-----
From: Lakshmi Venkataraman [mailto:lakshmi@foundrynet.com] 
Sent: Friday, June 08, 2007 4:41 PM
To: Tomcat Users List
Subject: RE: Using Javac instead of JDT to compile JSPs

I have been successfully using something other than Jasper in my
development enviroment.
This is what I did:
1)  Remove jasper-compiler-jdt.jar from <CATALINA_HOME>/common/lib
2) Add <JDK_HOME>/lib/tools.jar in <CATALINA_HOME>/common/lib
3) Add ant.jar also to <CATALINA_HOME>/common/lib.  The ant.jat that was
compatible with
   Tomcat5.5.23 was apache-ant-1.6/lib/ant.jar
4) Make sure the application specific web.xml does NOT have any
<servlet> and <servlet-name>
   MAPPINGS for the JSPs that need to be compiled on the fly.  If these
mappings exist, Tomcat 5.5.23
   tries to look for precompiled classes.
5) In my <CATALINA_HOME>/conf/web.xml which is the global web.xml, I
have the following to enable
   compilation.


<servlet>
        <servlet-name>jsp</servlet-name>
 
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>compilerTargetVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <init-param>
            <param-name>compilerSourceVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet> 

Hope that helps
Lakshmi

-----Original Message-----
From: Mark Claassen [mailto:mclaassen@ocie.net]
Sent: Friday, June 08, 2007 9:29 AM
To: 'Tomcat Users List'
Subject: Using Javac instead of JDT to compile JSPs

Has anyone tried to get the jasper compiler to be something other than
the JDT?  I tried several things, each of them not working.

The docs say an alternative compiler can be specified, but makes no
mention of how to specify it.

This seems to be controlled by settings in the web.xml.  
Below is a part of my web.xml from my latest try (which failed).

Thanks,
Mark


web.xml section
---------------
<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>compiler</param-name>
        <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>
    </init-param>
    <init-param>
        <param-name>fork</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>

 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by Mark Claassen <mc...@ocie.net>.
Thanks, that seems to have work!
 
-----Original Message-----
From: Lakshmi Venkataraman [mailto:lakshmi@foundrynet.com] 
Sent: Friday, June 08, 2007 7:41 PM
To: Tomcat Users List
Subject: RE: Using Javac instead of JDT to compile JSPs

I have been successfully using something other than Jasper in my development
enviroment.
This is what I did:
1)  Remove jasper-compiler-jdt.jar from <CATALINA_HOME>/common/lib
2) Add <JDK_HOME>/lib/tools.jar in <CATALINA_HOME>/common/lib
3) Add ant.jar also to <CATALINA_HOME>/common/lib.  The ant.jat that was
compatible with
   Tomcat5.5.23 was apache-ant-1.6/lib/ant.jar
4) Make sure the application specific web.xml does NOT have any <servlet>
and <servlet-name>
   MAPPINGS for the JSPs that need to be compiled on the fly.  If these
mappings exist, Tomcat 5.5.23
   tries to look for precompiled classes.
5) In my <CATALINA_HOME>/conf/web.xml which is the global web.xml, I have
the following to enable
   compilation.


<servlet>
        <servlet-name>jsp</servlet-name>
 
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>compilerTargetVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <init-param>
            <param-name>compilerSourceVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet> 

Hope that helps
Lakshmi

-----Original Message-----
From: Mark Claassen [mailto:mclaassen@ocie.net]
Sent: Friday, June 08, 2007 9:29 AM
To: 'Tomcat Users List'
Subject: Using Javac instead of JDT to compile JSPs

Has anyone tried to get the jasper compiler to be something other than the
JDT?  I tried several things, each of them not working.

The docs say an alternative compiler can be specified, but makes no mention
of how to specify it.

This seems to be controlled by settings in the web.xml.  
Below is a part of my web.xml from my latest try (which failed).

Thanks,
Mark


web.xml section
---------------
<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>compiler</param-name>
        <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>
    </init-param>
    <init-param>
        <param-name>fork</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>

 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by Lakshmi Venkataraman <la...@foundrynet.com>.
I have been successfully using something other than Jasper in my
development enviroment.
This is what I did:
1)  Remove jasper-compiler-jdt.jar from <CATALINA_HOME>/common/lib
2) Add <JDK_HOME>/lib/tools.jar in <CATALINA_HOME>/common/lib
3) Add ant.jar also to <CATALINA_HOME>/common/lib.  The ant.jat that was
compatible with
   Tomcat5.5.23 was apache-ant-1.6/lib/ant.jar
4) Make sure the application specific web.xml does NOT have any
<servlet> and <servlet-name>
   MAPPINGS for the JSPs that need to be compiled on the fly.  If these
mappings exist, Tomcat 5.5.23
   tries to look for precompiled classes.
5) In my <CATALINA_HOME>/conf/web.xml which is the global web.xml, I
have the following to enable
   compilation.


<servlet>
        <servlet-name>jsp</servlet-name>
 
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>compilerTargetVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <init-param>
            <param-name>compilerSourceVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet> 

Hope that helps
Lakshmi

-----Original Message-----
From: Mark Claassen [mailto:mclaassen@ocie.net] 
Sent: Friday, June 08, 2007 9:29 AM
To: 'Tomcat Users List'
Subject: Using Javac instead of JDT to compile JSPs

Has anyone tried to get the jasper compiler to be something other than
the JDT?  I tried several things, each of them not working.

The docs say an alternative compiler can be specified, but makes no
mention of how to specify it.

This seems to be controlled by settings in the web.xml.  
Below is a part of my web.xml from my latest try (which failed).

Thanks,
Mark


web.xml section
---------------
<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>compiler</param-name>
        <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>
    </init-param>
    <init-param>
        <param-name>fork</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>

 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Claassen [mailto:mclaassen@ocie.net] 
> Subject: RE: Using Javac instead of JDT to compile JSPs
> 
> Looking at the source, the Compiler needs to be a:
> org.apache.jasper.compiler.Compiler, which, clearly, javac is not.

I'm guessing this comment in the code is propbably pertinent:

     * Create a "Compiler" object based on some init param data. This
     * is not done yet. Right now we're just hardcoding the actual
     * compilers that are created. 

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by Mark Claassen <mc...@ocie.net>.
When using Main.  This is in the localhost.log
----------------------------------------------
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException: com.sun.tools.javac.Main
        at
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext
.java:238)
        at
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext
.java:214)
        at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
61)

When using main.JavaCompiler.  This is in catalina.out
------------------------------------------------------
WARNING: No Java compiler available
java.lang.InstantiationException: com.sun.tools.javac.main.JavaCompiler

When using main.Main .  This is in catalina.out
------------------------------------------------------
WARNING: No Java compiler available
java.lang.InstantiationException: com.sun.tools.javac.main.Main 


Looking at the source, the Compiler needs to be a:
org.apache.jasper.compiler.Compiler, which, clearly, javac is not.

So maybe I need to use the AntCompiler (I have no idea what this is
currently), and have it call javac.  

This is all looking like it may not be worth it.  Still, I may investigate
it further this weekend.


 
-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Friday, June 08, 2007 4:23 PM
To: Tomcat Users List
Subject: RE: Using Javac instead of JDT to compile JSPs

> From: Mark Claassen [mailto:mclaassen@ocie.net]
> Subject: RE: Using Javac instead of JDT to compile JSPs
> 
> <param-name>compiler</param-name>

Looking at the code in org.apache.jasper.EmbeddedServletOptions, it appears
the parameter name should be "compilerClassName" rather than "compiler".  If
compilerClassName is null, the following somewhat odd code in
org.apache.jasper.JspCompilationContext is executed:

if (options.getCompiler() == null) {
    jspCompiler =
createCompiler("org.apache.jasper.compiler.JDTCompiler");
    if (jspCompiler == null) {
        jspCompiler =
createCompiler("org.apache.jasper.compiler.AntCompiler");
    }
} else {
    jspCompiler =
createCompiler("org.apache.jasper.compiler.AntCompiler");
    if (jspCompiler == null) {
        jspCompiler =
createCompiler("org.apache.jasper.compiler.JDTCompiler");
    }
}

It appears the value of "compiler" is ignored, which explains why the JDT
compiler keeps getting used.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Claassen [mailto:mclaassen@ocie.net] 
> Subject: RE: Using Javac instead of JDT to compile JSPs
> 
> <param-name>compiler</param-name>

Looking at the code in org.apache.jasper.EmbeddedServletOptions, it
appears the parameter name should be "compilerClassName" rather than
"compiler".  If compilerClassName is null, the following somewhat odd
code in org.apache.jasper.JspCompilationContext is executed:

if (options.getCompiler() == null) {
    jspCompiler =
createCompiler("org.apache.jasper.compiler.JDTCompiler");
    if (jspCompiler == null) {
        jspCompiler =
createCompiler("org.apache.jasper.compiler.AntCompiler");
    }
} else {
    jspCompiler =
createCompiler("org.apache.jasper.compiler.AntCompiler");
    if (jspCompiler == null) {
        jspCompiler =
createCompiler("org.apache.jasper.compiler.JDTCompiler");
    }
}

It appears the value of "compiler" is ignored, which explains why the
JDT compiler keeps getting used.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by Mark Claassen <mc...@ocie.net>.
I noted the capitalization before, but not the missing part of the package.
Here it is now.
        <init-param>
            <param-name>compiler</param-name>
            <param-value>com.sun.tools.javac.Main</param-value>
        </init-param>

It still doesn't work.  

I removed the jasper-jdt.jar again as well.  If I leave it, it doesn't
matter what value I state...it always works.  Because of this, I was
wondering if it is even reading the compiler parameter at all.

Mark
 
-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Friday, June 08, 2007 2:59 PM
To: Tomcat Users List
Subject: RE: Using Javac instead of JDT to compile JSPs

> From: Mark Claassen [mailto:mclaassen@ocie.net]
> Subject: RE: Using Javac instead of JDT to compile JSPs
> 
> Even with this fix, neither of the values below worked.
>             <param-value>com.sun.tools.javac.main.Main</param-value>

Again, that's not the right class; from the previous message:

Try just com.sun.tools.javac.Main instead (note capitalization).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Claassen [mailto:mclaassen@ocie.net] 
> Subject: RE: Using Javac instead of JDT to compile JSPs
> 
> Even with this fix, neither of the values below worked.
>             <param-value>com.sun.tools.javac.main.Main</param-value>

Again, that's not the right class; from the previous message:

Try just com.sun.tools.javac.Main instead (note capitalization).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by Mark Claassen <mc...@ocie.net>.
Opps, I actually had:
... lib/tools/jar::

Fixed to:
java.class.path=/opt/OCIEsys/tomcat/DEV_04_07/bin/java/lib/tools.jar:/ocie/t
ests/OCIEsys/tomcat/DEV_04_07/bin/bootstrap.jar:/ocie/tests/OCIEsys/tomcat/D
EV_04_07/bin/commons-logging-api.jar

Even with this fix, neither of the values below worked.
 
        <init-param>
            <param-name>compiler</param-name>
            <param-value>com.sun.tools.javac.main.Main</param-value>
        </init-param>

        <init-param>
            <param-name>compiler</param-name>
            <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>
        </init-param>

I wonder if it just doesn't work.  Before these tests, I removed the
jasper-jdt.jar file (it has only eclipse files in it).  If I put that file
back in place, the jsp compilation works, regardless of what that param is:

        <init-param>
            <param-name>compiler</param-name>
            <param-value>com.sun.tools.javac.main.Mark</param-value>
        </init-param>

Here is the whole section:
   <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>compiler</param-name>
            <param-value>com.sun.tools.javac.main.Mark</param-value>
        </init-param>
        <init-param>
            <param-name>fork</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>


-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Friday, June 08, 2007 2:16 PM
To: Tomcat Users List
Subject: RE: Using Javac instead of JDT to compile JSPs

> From: Mark Claassen [mailto:mclaassen@ocie.net]
> Subject: RE: Using Javac instead of JDT to compile JSPs
> 
> <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>

That appears to be the wrong class.  Try just com.sun.tools.javac.Main
instead (note capitalization).

> One of my servlets prints out the classpath, and it shows :
> java.class.path=/opt/OCIEsys/tomcat/DEV_04_07/bin/java/lib/tools/jar::

I don't know what effect the double-colon might have, but it certainly
wouldn't hurt to correct that.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Claassen [mailto:mclaassen@ocie.net] 
> Subject: RE: Using Javac instead of JDT to compile JSPs
> 
> <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>

That appears to be the wrong class.  Try just com.sun.tools.javac.Main
instead (note capitalization).

> One of my servlets prints out the classpath, and it shows :
> java.class.path=/opt/OCIEsys/tomcat/DEV_04_07/bin/java/lib/tools/jar::

I don't know what effect the double-colon might have, but it certainly
wouldn't hurt to correct that.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by Mark Claassen <mc...@ocie.net>.
Thanks for your help, and I didn't mean to raise anyone's ire.  I did read
the docs, but started to loose confidence when it was not working.  

The part of the documentation that is missing is the specification of the
"param-value".  Is this param-value supposed to be a java class, an
executable, or something else?

I had:
<param-value>com.sun.tools.javac.main.JavaCompiler</param-value>

You didn't seems to have an issue with this parameter being a class, so I am
going on the assumption that this is correct.  So, now maybe my problem is
my setup of the classpath.  I was thinking that just putting the tools.jar
in the lib directory would be sufficient for a test.  This did not work.  I
then added it manually to the CLASSPATH variable in the setclasspath.sh to
ensure it is set.  Yet, I still get a:

java.lang.IllegalStateException: No Java compiler available
	
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext
.java:229)

One of my servlets prints out the classpath, and it shows :

java.class.path=/opt/OCIEsys/tomcat/DEV_04_07/bin/java/lib/tools/jar::/ocie/
tests/OCIEsys/to
mcat/DEV_04_07/bin/bootstrap.jar:/ocie/tests/OCIEsys/tomcat/DEV_04_07/bin/co
mmons-logging-api.jar

Thanks again,
Mark

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Friday, June 08, 2007 1:10 PM
To: Tomcat Users List
Subject: RE: Using Javac instead of JDT to compile JSPs

> From: Mark Claassen [mailto:mclaassen@ocie.net]
> Subject: Using Javac instead of JDT to compile JSPs
> 
> The docs say an alternative compiler can be specified, but makes no 
> mention of how to specify it.

Actually, the docs say this:

"The servlet which implements Jasper is configured using init parameters in
your global $CATALINA_BASE/conf/web.xml.

   "* compiler - Which compiler Ant should use to compile JSP pages. See the
Ant documentation for more information. If the value is not set, then the
default Eclipse JDT Java compiler will be used instead of using Ant. No
default value."

> This seems to be controlled by settings in the web.xml.  

As explicitly stated in the doc.

> <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>

[Note for Mark T:]
If you're running on Windows, there's a bug in the Tomcat 6.0.13
setclasspath.bat script which checks for tools.jar in the wrong place.
You'll need to include the tools.jar location explicitly in your CLASSPATH
environment variable.  (The problem does not exist in the .sh
version.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Using Javac instead of JDT to compile JSPs

Posted by Mark Thomas <ma...@apache.org>.
Caldarale, Charles R wrote:
> [Note for Mark T:]
> If you're running on Windows, there's a bug in the Tomcat 6.0.13
> setclasspath.bat script which checks for tools.jar in the wrong place.
> You'll need to include the tools.jar location explicitly in your
> CLASSPATH environment variable.  (The problem does not exist in the .sh
> version.)

Fixed.

Thanks for the heads up.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Using Javac instead of JDT to compile JSPs

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Claassen [mailto:mclaassen@ocie.net] 
> Subject: Using Javac instead of JDT to compile JSPs
> 
> The docs say an alternative compiler can be specified, but 
> makes no mention of how to specify it.

Actually, the docs say this:

"The servlet which implements Jasper is configured using init parameters
in your global $CATALINA_BASE/conf/web.xml.

   "* compiler - Which compiler Ant should use to compile JSP pages. See
the Ant documentation for more information. If the value is not set,
then the default Eclipse JDT Java compiler will be used instead of using
Ant. No default value."

> This seems to be controlled by settings in the web.xml.  

As explicitly stated in the doc.

> <param-value>com.sun.tools.javac.main.JavaCompiler</param-value>

[Note for Mark T:]
If you're running on Windows, there's a bug in the Tomcat 6.0.13
setclasspath.bat script which checks for tools.jar in the wrong place.
You'll need to include the tools.jar location explicitly in your
CLASSPATH environment variable.  (The problem does not exist in the .sh
version.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org