You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Aman Nanner/MxI Technologies <am...@mxi.com> on 2007/08/16 20:40:15 UTC

Differences between JSP on-the-fly compilation and JSP precompilation

I've tried precompiling my JSPs for the first time using the
org.apache.jasper.JspC class.  The precompiling works fine, except I get a
runtime error in the JSPs when I try to access my web application:

-------
java.lang.UnsupportedOperationException: separate instantiation and
injection is not supported
      at
org.apache.geronimo.jasper.JasperServletContextCustomizer$JasperInstanceManager.newInstance(JasperServletContextCustomizer.java:84)
      at jspservlet.common.security.login.default_jsp._jspService(Unknown
Source)
-------

I do not get this error when I do not precompile my JSPs.  After a little
investigation, it seems that my precompiled JSPs are compiled differently
then when they are compiled at runtime by the server.  The different code
that is created after compilation triggers the above error in the
org.apache.geronimo.jasper.JasperServletContextCustomizer class.

I'm trying to figure out why these JSPs would be compiled differently in
these scenarios.  Anybody have any ideas?

I'm using Geronimo 2.0.

Thanks,
Aman

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *


Re: Differences between JSP on-the-fly compilation and JSP precompilation

Posted by Aman Nanner/MxI Technologies <am...@mxi.com>.
I was using the version of Jasper that came with Geronimo, but I was not
using the Maven plugin because we currently do not use Maven for our build
scripts.  The critical piece was to add the property as I described in my
earlier response.

Thanks,
Aman

David Jencks <da...@yahoo.com> wrote on 08-16-2007 05:49:52 PM:

> You need to use the version of jasper that comes with geronimo 2.x or
> the tomcat trunk (completely unreleased).  Otherwise the ideas of how
> to deal with annotations are 100% incompatible.
>
> IIUC we are using a maven plugin that has all the correct stuff to
> get the correct jasper version so if you are using maven2 copying our
> plugin setup should give you working precompiled jsps.  For instance
> the admin console has precompiled jsps.
>
> thanks
> david jencks
>
> On Aug 16, 2007, at 11:40 AM, Aman Nanner/MxI Technologies wrote:
>
> >
> > I've tried precompiling my JSPs for the first time using the
> > org.apache.jasper.JspC class.  The precompiling works fine, except
> > I get a
> > runtime error in the JSPs when I try to access my web application:
> >
> > -------
> > java.lang.UnsupportedOperationException: separate instantiation and
> > injection is not supported
> >       at
> > org.apache.geronimo.jasper.JasperServletContextCustomizer
> > $JasperInstanceManager.newInstance
> > (JasperServletContextCustomizer.java:84)
> >       at jspservlet.common.security.login.default_jsp._jspService
> > (Unknown
> > Source)
> > -------
> >
> > I do not get this error when I do not precompile my JSPs.  After a
> > little
> > investigation, it seems that my precompiled JSPs are compiled
> > differently
> > then when they are compiled at runtime by the server.  The
> > different code
> > that is created after compilation triggers the above error in the
> > org.apache.geronimo.jasper.JasperServletContextCustomizer class.
> >
> > I'm trying to figure out why these JSPs would be compiled
> > differently in
> > these scenarios.  Anybody have any ideas?
> >
> > I'm using Geronimo 2.0.
> >
> > Thanks,
> > Aman
> >
> > ______________________________________________________________________
> > ____________
> > * This message is intended only for the use of the individual or
> > entity to which it is addressed, and may contain information that
> > is privileged, confidential and exempt from disclosure under
> > applicable law. Unless you are the addressee (or authorized to
> > receive for the addressee), you may not use, copy or disclose the
> > message or any information contained in the message. If you have
> > received this message in error, please advise the sender by reply e-
> > mail , and delete the message, or call (collect) 001 613 747 4698. *
> >
>

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *


Re: Differences between JSP on-the-fly compilation and JSP precompilation

Posted by David Jencks <da...@yahoo.com>.
You need to use the version of jasper that comes with geronimo 2.x or  
the tomcat trunk (completely unreleased).  Otherwise the ideas of how  
to deal with annotations are 100% incompatible.

IIUC we are using a maven plugin that has all the correct stuff to  
get the correct jasper version so if you are using maven2 copying our  
plugin setup should give you working precompiled jsps.  For instance  
the admin console has precompiled jsps.

thanks
david jencks

On Aug 16, 2007, at 11:40 AM, Aman Nanner/MxI Technologies wrote:

>
> I've tried precompiling my JSPs for the first time using the
> org.apache.jasper.JspC class.  The precompiling works fine, except  
> I get a
> runtime error in the JSPs when I try to access my web application:
>
> -------
> java.lang.UnsupportedOperationException: separate instantiation and
> injection is not supported
>       at
> org.apache.geronimo.jasper.JasperServletContextCustomizer 
> $JasperInstanceManager.newInstance 
> (JasperServletContextCustomizer.java:84)
>       at jspservlet.common.security.login.default_jsp._jspService 
> (Unknown
> Source)
> -------
>
> I do not get this error when I do not precompile my JSPs.  After a  
> little
> investigation, it seems that my precompiled JSPs are compiled  
> differently
> then when they are compiled at runtime by the server.  The  
> different code
> that is created after compilation triggers the above error in the
> org.apache.geronimo.jasper.JasperServletContextCustomizer class.
>
> I'm trying to figure out why these JSPs would be compiled  
> differently in
> these scenarios.  Anybody have any ideas?
>
> I'm using Geronimo 2.0.
>
> Thanks,
> Aman
>
> ______________________________________________________________________ 
> ____________
> * This message is intended only for the use of the individual or  
> entity to which it is addressed, and may contain information that  
> is privileged, confidential and exempt from disclosure under  
> applicable law. Unless you are the addressee (or authorized to  
> receive for the addressee), you may not use, copy or disclose the  
> message or any information contained in the message. If you have  
> received this message in error, please advise the sender by reply e- 
> mail , and delete the message, or call (collect) 001 613 747 4698. *
>


Re: Differences between JSP on-the-fly compilation and JSP precompilation

Posted by Aman Nanner/MxI Technologies <am...@mxi.com>.
This is an issue that relates to the G543818 Tomcat patch in Geronimo.
This patch seems to have implemented instance manager pooling for tags.
Geronimo requires this, and in order to enable this for precompilation, the
following Java system property needs to be set in the precompilation
process:

org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS=true

If this property is not set, then precompiled JSPs that contain tags will
not work with Geronimo.  If this is not documented somewhere already, it
probably should.



Aman Nanner/MxI Technologies <am...@mxi.com> wrote on 08-16-2007
02:40:15 PM:

>
> I've tried precompiling my JSPs for the first time using the
> org.apache.jasper.JspC class.  The precompiling works fine, except I get
a
> runtime error in the JSPs when I try to access my web application:
>
> -------
> java.lang.UnsupportedOperationException: separate instantiation and
> injection is not supported
>       at
> org.apache.geronimo.jasper.
> JasperServletContextCustomizer$JasperInstanceManager.
> newInstance(JasperServletContextCustomizer.java:84)
>       at jspservlet.common.security.login.default_jsp._jspService(Unknown
> Source)
> -------
>
> I do not get this error when I do not precompile my JSPs.  After a little
> investigation, it seems that my precompiled JSPs are compiled differently
> then when they are compiled at runtime by the server.  The different code
> that is created after compilation triggers the above error in the
> org.apache.geronimo.jasper.JasperServletContextCustomizer class.
>
> I'm trying to figure out why these JSPs would be compiled differently in
> these scenarios.  Anybody have any ideas?
>
> I'm using Geronimo 2.0.
>
> Thanks,
> Aman
>
>
__________________________________________________________________________________

> * This message is intended only for the use of the individual or
> entity to which it is addressed, and may contain information that is
> privileged, confidential and exempt from disclosure under applicable
> law. Unless you are the addressee (or authorized to receive for the
> addressee), you may not use, copy or disclose the message or any
> information contained in the message. If you have received this
> message in error, please advise the sender by reply e-mail , and
> delete the message, or call (collect) 001 613 747 4698. *
>

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *