Re: Realm issue with Tomcat 9

2021-03-23 Thread Ravi Kumar
Thanks Mark for this , applied the solution and it worked.

On Tue, Mar 23, 2021 at 3:58 PM Mark Thomas  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: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Realm issue with Tomcat 9

2021-03-23 Thread Mark Thomas

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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Realm issue with Tomcat 9

2021-03-23 Thread Ravi Kumar
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