Realm issue with Tomcat 9

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Realm issue with Tomcat 9

Ravi Kumar-2
Hello,
I am migrating my application which is using tomcat 7 currently to tomcat
9. As there are a lot of changes in the API, with tomcat 7 we were setting
the Realm for this engine by // set the Realm for this engine
    //tomcatServer.setDefaultRealm(new TomcatRepoRealm());
Here tomcatServer is an object
of org.apache.catalina.startup.Tomcat.Tomcat() and we are invoking the
setDefaultRealm to set the realm for the engine for our application running
on Tomcat 7.Now as we are migrating our application from Tomcat 7 to Tomcat
9, if we try to set the realm for the engine then what is the best way to
do that as org.apache.catalina.startup.Tomcat.Tomcat().setDefaultRealm() is
now deprecated.Appreciate your help!

Thanks,
Ravi
Reply | Threaded
Open this post in threaded view
|

Re: Realm issue with Tomcat 9

markt
On 23/03/2021 10:05, Ravi Kumar wrote:

> Hello,
> I am migrating my application which is using tomcat 7 currently to tomcat
> 9. As there are a lot of changes in the API, with tomcat 7 we were setting
> the Realm for this engine by // set the Realm for this engine
>      //tomcatServer.setDefaultRealm(new TomcatRepoRealm());
> Here tomcatServer is an object
> of org.apache.catalina.startup.Tomcat.Tomcat() and we are invoking the
> setDefaultRealm to set the realm for the engine for our application running
> on Tomcat 7.Now as we are migrating our application from Tomcat 7 to Tomcat
> 9, if we try to set the realm for the engine then what is the best way to
> do that as org.apache.catalina.startup.Tomcat.Tomcat().setDefaultRealm() is
> now deprecated.Appreciate your help!

tomcatServer.getEngine().setRealm(new TomcatRepoRealm());

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Realm issue with Tomcat 9

Ravi Kumar-2
Thanks Mark for this , applied the solution and it worked.

On Tue, Mar 23, 2021 at 3:58 PM Mark Thomas <[hidden email]> wrote:

> On 23/03/2021 10:05, Ravi Kumar wrote:
> > Hello,
> > I am migrating my application which is using tomcat 7 currently to tomcat
> > 9. As there are a lot of changes in the API, with tomcat 7 we were
> setting
> > the Realm for this engine by // set the Realm for this engine
> >      //tomcatServer.setDefaultRealm(new TomcatRepoRealm());
> > Here tomcatServer is an object
> > of org.apache.catalina.startup.Tomcat.Tomcat() and we are invoking the
> > setDefaultRealm to set the realm for the engine for our application
> running
> > on Tomcat 7.Now as we are migrating our application from Tomcat 7 to
> Tomcat
> > 9, if we try to set the realm for the engine then what is the best way to
> > do that as org.apache.catalina.startup.Tomcat.Tomcat().setDefaultRealm()
> is
> > now deprecated.Appreciate your help!
>
> tomcatServer.getEngine().setRealm(new TomcatRepoRealm());
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>