You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by vladimir dvorak <la...@gmail.com> on 2022/04/28 15:30:17 UTC

Application specific el-api

  Hi,

I'm trying to use jakarta-el, which is an alternative to el-api.jar from
Tomcat. Jakarta-el is deployed with application, implementation part of lib
works correctly since it uses separate package,
but I can't force the Tomcat classloader mechanism to not use the classes
from api part TOMCAT_DIR/lib/el-api.jar but rather jakarta-el-api.jar. I've
excluded all transitive deps on apache-el,
but nothing helps. Is there any configuration on how to force Tomcat to use
classes from the application jar in advance of the system tomcat jar?

Regards Vladimir

Re: Application specific el-api

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Mark, Vladimir,

On 4/28/22 12:10, Mark Thomas wrote:
> On 28/04/2022 16:54, vladimir dvorak wrote:
>>    Hi,
>>
>> my intention is to use custom el-api with modified BeanELResolver, that
>> uses instead slow reflection API much faster
>> https://github.com/EsotericSoftware/reflectasm
> 
> You have a couple of options.
> 
> 1. Replace the el-api.jar in $CATALINA_BASE/lib.
> 
> Not ideal as deploy just got a lot more complicated than just copying a 
> WAR file but it does give you exactly what you want.
> 
> 2. If you are using the EL in JSPs, then you can add your custom 
> ELResolver to the JspApplicationContext and it will get used in 
> preference to the BeanELResolver.
> 
> This keeps everything in the application but does require a little 
> plumbing to register the customer resolver when the web app starts.

I wonder how much of a performance benefit reflectasm gives, since 
Tomcat's implementation should be providing not just reflective-access 
to object properties, but /cached/ reflective access to properties.

It's not just calling Class.forName(beanType).getMethod("get" + 
capicalize(propertyName)) every time it sees a property-access.

-chris

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


Re: Application specific el-api

Posted by Mark Thomas <ma...@apache.org>.
On 28/04/2022 16:54, vladimir dvorak wrote:
>    Hi,
> 
> my intention is to use custom el-api with modified BeanELResolver, that
> uses instead slow reflection API much faster
> https://github.com/EsotericSoftware/reflectasm

You have a couple of options.

1. Replace the el-api.jar in $CATALINA_BASE/lib.

Not ideal as deploy just got a lot more complicated than just copying a 
WAR file but it does give you exactly what you want.

2. If you are using the EL in JSPs, then you can add your custom 
ELResolver to the JspApplicationContext and it will get used in 
preference to the BeanELResolver.

This keeps everything in the application but does require a little 
plumbing to register the customer resolver when the web app starts.

Mark


> 
> kind regards Vladimir
> 
> čt 28. 4. 2022 v 17:46 odesílatel Mark Thomas <ma...@apache.org> napsal:
> 
>> On 28/04/2022 16:30, vladimir dvorak wrote:
>>>     Hi,
>>>
>>> I'm trying to use jakarta-el, which is an alternative to el-api.jar from
>>> Tomcat. Jakarta-el is deployed with application, implementation part of
>> lib
>>> works correctly since it uses separate package,
>>> but I can't force the Tomcat classloader mechanism to not use the classes
>>> from api part TOMCAT_DIR/lib/el-api.jar but rather jakarta-el-api.jar.
>> I've
>>> excluded all transitive deps on apache-el,
>>> but nothing helps. Is there any configuration on how to force Tomcat to
>> use
>>> classes from the application jar in advance of the system tomcat jar?
>>
>> No.
>>
>> The Jakarta EE platform specification requires that the container
>> (Tomcat) prevents applications loading alternative API JARs.
>>
>> Why do you want to use an alternative API JAR?
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 

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


Re: Application specific el-api

Posted by vladimir dvorak <la...@gmail.com>.
  Hi,

my intention is to use custom el-api with modified BeanELResolver, that
uses instead slow reflection API much faster
https://github.com/EsotericSoftware/reflectasm

kind regards Vladimir

čt 28. 4. 2022 v 17:46 odesílatel Mark Thomas <ma...@apache.org> napsal:

> On 28/04/2022 16:30, vladimir dvorak wrote:
> >    Hi,
> >
> > I'm trying to use jakarta-el, which is an alternative to el-api.jar from
> > Tomcat. Jakarta-el is deployed with application, implementation part of
> lib
> > works correctly since it uses separate package,
> > but I can't force the Tomcat classloader mechanism to not use the classes
> > from api part TOMCAT_DIR/lib/el-api.jar but rather jakarta-el-api.jar.
> I've
> > excluded all transitive deps on apache-el,
> > but nothing helps. Is there any configuration on how to force Tomcat to
> use
> > classes from the application jar in advance of the system tomcat jar?
>
> No.
>
> The Jakarta EE platform specification requires that the container
> (Tomcat) prevents applications loading alternative API JARs.
>
> Why do you want to use an alternative API JAR?
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Application specific el-api

Posted by Mark Thomas <ma...@apache.org>.
On 28/04/2022 16:30, vladimir dvorak wrote:
>    Hi,
> 
> I'm trying to use jakarta-el, which is an alternative to el-api.jar from
> Tomcat. Jakarta-el is deployed with application, implementation part of lib
> works correctly since it uses separate package,
> but I can't force the Tomcat classloader mechanism to not use the classes
> from api part TOMCAT_DIR/lib/el-api.jar but rather jakarta-el-api.jar. I've
> excluded all transitive deps on apache-el,
> but nothing helps. Is there any configuration on how to force Tomcat to use
> classes from the application jar in advance of the system tomcat jar?

No.

The Jakarta EE platform specification requires that the container 
(Tomcat) prevents applications loading alternative API JARs.

Why do you want to use an alternative API JAR?

Mark

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