Tomcat 8.0.X - findService("Catalina").getContainer() deprecated. How to retrieve StandardEngine
Hi all, I'm working with Tomcat 8.0.32 after migrating from 7.0.X. When I want to get the host object in Tomcat 7 I did: MBeanServer mBeanServer = MBeanServerFactory.findMBeanServer(null).get(0); ObjectName catalinaNombre = null; try { catalinaNombre = new ObjectName("Catalina","type","Server"); servidorTomcat = (Server) mBeanServer.getAttribute( catalinaNombre, "managedResource"); StandardEngine engineTomcat = (StandardEngine) servidorTomcat.findService("Catalina").getContainer(); hostTomcat = (Host) engineTomcat.findChild( "localhost" ); } ... Now findService("Catalina").getContainer() is deprecated and don't know how to do it. Nothing found after long search about this. Could anybody help me please ? Regards, Mriano
Re: How to know aliases defined in host container in server.xml of Tomcat 7.0.61
WOW !!! I can't believe it. If I was looking the code for years i wasn't able to see. Sorry for this stupid post and thank you very much Konstantin Mariano 2015-05-07 23:00 GMT+02:00 Konstantin Kolinko knst.koli...@gmail.com: 2015-05-07 19:29 GMT+03:00 Mariano López marianolopezd...@gmail.com: Hi all, I want to know all the aliases defined in host container in server.xml of Tomcat 7.0.61 My server.xml has the following configuration: .. Service name=Catalina .. Engine defaultHost=localhost name=Catalina .. Host appBase=webapps autoDeploy=true name=localhost unpackWARs=true aliasalias1.server/alias aliasalias2.server/alias aliasalias3.server/alias aliasalias4.server/alias You have no aliases defined with the above configuration, because XML is a case-sensitive markup language. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
How to know aliases defined in host container in server.xml of Tomcat 7.0.61
Hi all, I want to know all the aliases defined in host container in server.xml of Tomcat 7.0.61 My server.xml has the following configuration: .. Service name=Catalina .. Engine defaultHost=localhost name=Catalina .. Host appBase=webapps autoDeploy=true name=localhost unpackWARs=true aliasalias1.server/alias aliasalias2.server/alias aliasalias3.server/alias aliasalias4.server/alias .. Context docBase= path=/XXX reloadable=true source=org.eclipse.jst.jee.server:CrystalReportWeb//Host /Engine /Service .. I want to retrieve all this posibles alias defined in host contanier. I use the following code: Server servidorTomcat = null; MBeanServer mBeanServer = MBeanServerFactory.findMBeanServer(null).get(0); ObjectName catalinaNombre = null; ObjectName hostNombre = null; try { catalinaNombre = new ObjectName(Catalina,type,Server); } catch (MalformedObjectNameException e) { this.error = true; this.errorDescripcion = 'MalformedObjectNameException' en + Jsfthis.getTomcat7Servidor(). + Error: + e.getMessage(); } catch (Exception e) { this.error = true; this.errorDescripcion = 'Exception' en + Jsfthis.getTomcat7Servidor(). + Error: + e.getMessage(); } try { servidorTomcat = (Server) mBeanServer.getAttribute( catalinaNombre, managedResource); StandardEngine engineTomcat = (StandardEngine) servidorTomcat.findService(Catalina).getContainer(); Host hostTomcat = (Host) engineTomcat.findChild( localhost ); String[] tomcat7HostAlias = hostTomcat.findAliases(); } catch (AttributeNotFoundException e) { this.error = true; this.errorDescripcion = 'AttributeNotFoundException' en + Jsfthis.getTomcat7Servidor(). + Error: + e.getMessage(); } catch (InstanceNotFoundException e) { this.error = true; this.errorDescripcion = 'InstanceNotFoundException' en + Jsfthis.getTomcat7Servidor(). + Error: + e.getMessage(); } catch (MBeanException e) { this.error = true; this.errorDescripcion = 'MBeanException' en + Jsfthis.getTomcat7Servidor(). + Error: + e.getMessage(); } catch (ReflectionException e) { this.error = true; this.errorDescripcion = 'ReflectionException' en + Jsfthis.getTomcat7Servidor(). + Error: + e.getMessage(); } catch (Exception e) { this.error = true; this.errorDescripcion = 'Exception' en + Jsfthis.getTomcat7Servidor(). + Error: + e.getMessage(); } Everythings seem to work fine, but String[] tomcat7HostAlias always returns zero length array. I don't know what i am doing wrong. Please help. Regads, Mariano
Re: How to finalize all sessions in a server with SingleSignOn valve activated ?
I just tried requireReauthentication in SingleSignOn valve and always drives me to login page, so with this does not work. Best regards, Mariano -- Forwarded message -- From: Pid p...@pidster.com Date: 2010/6/10 Subject: Re: How to finalize all sessions in a server with SingleSignOn valve activated ? To: Tomcat Users List users@tomcat.apache.org On 10/06/2010 09:05, Mariano López wrote: According to http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Single%20Sign%20On *As soon as the user logs out of one web application (for example, by invalidating the corresponding session if form based login is used), the user's sessions in *all* web applications will be invalidated. Any subsequent attempt to access a protected resource in any application will require the user to authenticate himself or herself again.* Yes, I know what it says, and it works for me - but I'm not using a custom JAAS setup. This is just what i need, i suppose that this is a bug. The point I was making was that I wasn't sure if custom JAAS automatically worked with the SSO valve, although my gut feeling is that it should. Maybe one of the devs will have something to say. Did you try setting requireReauthentication? p I will search in bug database for this problem. Thank you very much for your help, Mariano 2010/6/9 Pid p...@pidster.com mailto:p...@pidster.com On 09/06/2010 11:58, Mariano López wrote: Yes, all of the apps are in the same Host. Here is my server.xml file: Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.JAASRealm resourceName=jdbc/ds_usuarios_jaas_Local appName=Usuarios userClassNames=org.sescam.chua.AutenticacionTomcatChua.UsuarioChuaLDAP roleClassNames=org.sescam.chua.AutenticacionTomcatChua.GrupoChuaPrincipal/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=false Valve className=org.apache.catalina.authenticator.SingleSignOn / /Host I don't know if the SSO valve makes any guarantees about working with custom JAASRealm's. Try setting requireReauthentication to true. http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Single Sign On Valve p signature.asc Description: PGP signature - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: How to finalize all sessions in a server with SingleSignOn valve activated ?
After debugging my apps I notice that all session context all correctly invalidated except one context. I have made test with four context, three of them are correctly invalidated and just one remains the user's session. I don't understand what is happened with this case. Best regards, Mariano 2010/6/11 Mariano López marianolopezd...@gmail.com I just tried requireReauthentication in SingleSignOn valve and always drives me to login page, so with this does not work. Best regards, Mariano -- Forwarded message -- From: Pid p...@pidster.com Date: 2010/6/10 Subject: Re: How to finalize all sessions in a server with SingleSignOn valve activated ? To: Tomcat Users List users@tomcat.apache.org On 10/06/2010 09:05, Mariano López wrote: According to http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Single%20Sign%20On *As soon as the user logs out of one web application (for example, by invalidating the corresponding session if form based login is used), the user's sessions in *all* web applications will be invalidated. Any subsequent attempt to access a protected resource in any application will require the user to authenticate himself or herself again.* Yes, I know what it says, and it works for me - but I'm not using a custom JAAS setup. This is just what i need, i suppose that this is a bug. The point I was making was that I wasn't sure if custom JAAS automatically worked with the SSO valve, although my gut feeling is that it should. Maybe one of the devs will have something to say. Did you try setting requireReauthentication? p I will search in bug database for this problem. Thank you very much for your help, Mariano 2010/6/9 Pid p...@pidster.com mailto:p...@pidster.com On 09/06/2010 11:58, Mariano López wrote: Yes, all of the apps are in the same Host. Here is my server.xml file: Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.JAASRealm resourceName=jdbc/ds_usuarios_jaas_Local appName=Usuarios userClassNames=org.sescam.chua.AutenticacionTomcatChua.UsuarioChuaLDAP roleClassNames=org.sescam.chua.AutenticacionTomcatChua.GrupoChuaPrincipal/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=false Valve className=org.apache.catalina.authenticator.SingleSignOn / /Host I don't know if the SSO valve makes any guarantees about working with custom JAASRealm's. Try setting requireReauthentication to true. http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#SingleSign On Valve p
Re: How to finalize all sessions in a server with SingleSignOn valve activated ?
According to http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Single%20Sign%20On *As soon as the user logs out of one web application (for example, by invalidating the corresponding session if form based login is used), the user's sessions in all web applications will be invalidated. Any subsequent attempt to access a protected resource in any application will require the user to authenticate himself or herself again.* This is just what i need, i suppose that this is a bug. I will search in bug database for this problem. Thank you very much for your help, Mariano 2010/6/9 Pid p...@pidster.com On 09/06/2010 11:58, Mariano López wrote: Yes, all of the apps are in the same Host. Here is my server.xml file: Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.JAASRealm resourceName=jdbc/ds_usuarios_jaas_Local appName=Usuarios userClassNames=org.sescam.chua.AutenticacionTomcatChua.UsuarioChuaLDAP roleClassNames=org.sescam.chua.AutenticacionTomcatChua.GrupoChuaPrincipal/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=false Valve className=org.apache.catalina.authenticator.SingleSignOn / /Host I don't know if the SSO valve makes any guarantees about working with custom JAASRealm's. Try setting requireReauthentication to true. http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Single Sign On Valve p
Re: How to finalize all sessions in a server with SingleSignOn valve activated ?
Actually when a user logs out from appliacation there is a context that contains the login page and the logout page. The logout page execute 'session.invalidate();' for closing session in this context. The server is configured with SingleSignOn valve, the context that contains login and logout page has menu systems for access all the pages for the user, this pages are located in differents context on this server. If I logout from my session when execute 'session.invalidate();' tomcat only close the session from login and logout page context, not for the rest, and i want to finalize the session in the rest of the contexts in the server. I hope that this explain better what I am trying to say. Regards Mariano 2010/6/9 Pid p...@pidster.com On 08/06/2010 11:05, Mariano López wrote: Hello all, I like to know how to finalize all sessions in a server with SingleSignOn valve activated. When I finalize the current session user when logs out only close the session in this context, the rest remains its sessions for this user. How exactly are you finalizing the current session, and do you actually mean to invalidate the session instead? p Tomcat 6.0.26 Regards, Mariano
Re: How to finalize all sessions in a server with SingleSignOn valve activated ?
Yes, all of the apps are in the same Host. Here is my server.xml file: ?xml version='1.0' encoding='utf-8'? Server port=9085 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / GlobalNamingResources Resource name=jdbc/ds_usuarios_jaas_Local auth=Container description=BBDD MySQL 5.0 donde se almacenan los grupos de usuarios. driverClass=com.mysql.jdbc.Driver factory=org.apache.naming.factory.BeanFactory type=com.mchange.v2.c3p0.ComboPooledDataSource maxPoolSize=20 minPoolSize=10 initialPoolSize=10 maxStatementsPerConnection=5 acquireIncrement=1 user=x password=x jdbcUrl=jdbc:mysql://localhost:3306/usuarios?autoReconnect=true checkoutTimeout=5000 preferredTestQuery=select 1 idleConnectionTestPeriod=900 unreturnedConnectionTimeout=120 debugUnreturnedConnectionStackTraces=true / /GlobalNamingResources Service name=Catalina Connector port=9080 redirectPort=9483 protocol=HTTP/1.1 connectionTimeout=2 enableLookups=false disableUploadTimeout=true URIEncoding=UTF-8 / Connector port=9483 protocol=HTTP/1.1 SSLEnabled=true enableLookups=false disableUploadTimeout=true maxThreads=150 scheme=https secure=true clientAuth=false sslProtocol=TLS URIEncoding=UTF-8 keystoreFile=C:/java/servidores/tomcat-6.0-nb/conf/ssl/ClavePublicaTomcatSSL keystorePass=tomcatpwd / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.JAASRealm resourceName=jdbc/ds_usuarios_jaas_Local appName=Usuarios userClassNames=org.sescam.chua.AutenticacionTomcatChua.UsuarioChuaLDAP roleClassNames=org.sescam.chua.AutenticacionTomcatChua.GrupoChuaPrincipal/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=false Valve className=org.apache.catalina.authenticator.SingleSignOn / /Host Valve className=org.apache.catalina.valves.RemoteAddrValve allow=127.0.0.1,10.36.135.108,10.36.134.205,10.36.135.106,10.36.135.107,10.36.131.189,10.36.132.219/ /Engine /Service /Server Mariano 2010/6/9 Pid p...@pidster.com On 09/06/2010 11:01, Mariano López wrote: Actually when a user logs out from appliacation there is a context that contains the login page and the logout page. The logout page execute 'session.invalidate();' for closing session in this context. The server is configured with SingleSignOn valve, the context that contains login and logout page has menu systems for access all the pages for the user, this pages are located in differents context on this server. If I logout from my session when execute 'session.invalidate();' tomcat only close the session from login and logout page context, not for the rest, and i want to finalize the session in the rest of the contexts in the server. I hope that this explain better what I am trying to say. OK. Are all of the apps in the same Host? Please remove all comments obscure any passwords from your server.xml file and post it inline here. p Regards Mariano 2010/6/9 Pid p...@pidster.com mailto:p...@pidster.com On 08/06/2010 11:05, Mariano López wrote: Hello all, I like to know how to finalize all sessions in a server with SingleSignOn valve activated. When I finalize the current session user when logs out only close the session in this context, the rest remains its sessions for this user. How exactly are you finalizing the current session, and do you actually mean to invalidate the session instead? p Tomcat 6.0.26 Regards, Mariano
How to finalize all sessions in a server with SingleSignOn valve activated ?
Hello all, I like to know how to finalize all sessions in a server with SingleSignOn valve activated. When I finalize the current session user when logs out only close the session in this context, the rest remains its sessions for this user. Tomcat 6.0.26 Regards, Mariano
is possible Single sign on authentication with unique page login on the same tomcat server?
Hi all, I have implemented a custom single sign on JAAS login for a tomcat 6.018 server, it's works perfectly with my only context that I had until now. I have added the second context into the same server and i like to set form-login-page/form-login-page in web.xml context file to access a page from the other context, but always starts the URL's page login with its name context. Can I reference a page of the other context or I will have to create other page login for this context ? Thank you very much. Best regards, Mariano
Re: is possible Single sign on authentication with unique page login on the same tomcat server?
Hi Christopher, that is what I have, but tomcat always put the current context name before login page URL of other context and gives bad reference to page. Regards, Mariano 2008/10/10 Christopher Schultz [EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mariano, Mariano López wrote: I have added the second context into the same server and i like to set form-login-page/form-login-page in web.xml context file to access a page from the other context, but always starts the URL's page login with its name context. I'm not sure what else is possible, but you could always set your form-login-page to point to a URL that gets redirected to the preferred login URL in your other context. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjvcTYACgkQ9CaO5/Lv0PA2WQCeLoZXKd7yAeGgOOz2S2rM6Xpg lvUAnjFMP7/c3fjj8RDnqS9IQfHwoXi9 =etQQ -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: is possible Single sign on authentication with unique page login on the same tomcat server?
Hi Christopher, I will try this and well see. Thank you for your attention, Mariano 2008/10/10 Christopher Schultz [EMAIL PROTECTED] -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mariano, Mariano López wrote: Hi Christopher, that is what I have, but tomcat always put the current context name before login page URL of other context and gives bad reference to page. I'm not suggesting that you do: form-login-page/path/to/other/context/login.jsp/form-login-page Instead, I'm suggesting that you do this: form-login-page/same/webapp/login.jsp/form-login-page login.jsp: % response.sendRedirect(/path/to/other/context/login.jsp); % - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjvmXoACgkQ9CaO5/Lv0PBNMgCgoS3ocIoOaLstVuQegRKR8O3G a0oAoL2XLxyCD/23k6bZs2U+BrUaFouR =sual -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JasperException: PermGen space
Try adding more -XX:MaxPermSize when Jboss starts up. Best regards, Mariano Dave escribió: Hi, I am using JBoss 4.0.5GA on Federa Core 6 Linux for JSF application. After running for two days, got the following exception on server side. How to avoid it? Thanks for help. Dave Caused by: org.apache.jasper.JasperException: PermGen space at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:455) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419) - Looking for last minute shopping deals? Find them fast with Yahoo! Search. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]