Re: Tomcat 7 Embedded: Manager
On 01/07/2011 20:49, Dark Before Dawn wrote: Hi Pid, hi Cuck! thanks for your help. Your suggestions fixed the naming issues :) thanks! But the error still occurs. FAIL - Encountered exception javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost The Deployer isn't in the list of MBeans visible in your JConsole screenshot, which is probably why you can't connect to it. I don't know why that is, but presumably the embedded code doesn't enable it. I noticed an empty javax.management.ObjectName[0] Array, when browsing Servlet via jconsole. This could be in correlation to the exception above. The two things are not related. The empty array refers to child objects of the servlet (should there be any? no...), not the webapp. p See screenshots for further reference. If this is over we definitively need to grab some beer, I am buying :) Am 01.07.2011 17:54, schrieb Pid: On 01/07/2011 12:44, Dark Before Dawn wrote: Hi Pid, i guess the problem is that the manager-servlet's context is mounted at root and the ServletMapping points to /manager. server.addContext(, baseDirectory); ctx.addServletMapping(/manager/*, manager-servlet); So all relative paths will point to root That's easy to change, no? server.addContext(/manager, baseDirectory); ctx.addServletMapping(/text/*, manager-servlet); Note the additional '*' in the security collection: collection.addPattern(/text/*); (The role usually assigned for the text manager servlet is manager-script) p ie: localhost/manager/html vs localhost/html I don't know what I am exactly searching for at jconsole, so here is a overview :) Thnx and cheers Darky Am 01.07.2011 12:46, schrieb Pid: On 01/07/2011 10:40, Dark Before Dawn wrote: Hi again, this is realy driving me nuts for weeks :) FAIL - Encountered exception javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost 1. Connect to your running instance with JConsole*. 2. Examine the MBeans published by the instance. 3. Confirm that you are connecting to the correct MBean. I wouldn't expect: Tomcat:type=Deployer,host=localhost to work. p * or VisualVM with the JConsole plugin enabled. signature.asc Description: OpenPGP digital signature
Re: Tomcat 7 Embedded: Manager
Hi Pid, I wonder where the war-files are uploaded to? When uploading a war-file via HTMLManagerServlet a new error message will be shown: MESSAGE: FAIL - File upload failed, no file Do I need to enable file uploads somewhere? Is there a way to enable the Deployer via code or by adding new JARs? Cheers and thanks in davance Darky Am 03.07.2011 13:33, schrieb Pid: On 01/07/2011 20:49, Dark Before Dawn wrote: Hi Pid, hi Cuck! thanks for your help. Your suggestions fixed the naming issues :) thanks! But the error still occurs. FAIL - Encountered exception javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost The Deployer isn't in the list of MBeans visible in your JConsole screenshot, which is probably why you can't connect to it. I don't know why that is, but presumably the embedded code doesn't enable it. I noticed an empty javax.management.ObjectName[0] Array, when browsing Servlet via jconsole. This could be in correlation to the exception above. The two things are not related. The empty array refers to child objects of the servlet (should there be any? no...), not the webapp. p See screenshots for further reference. If this is over we definitively need to grab some beer, I am buying :) Am 01.07.2011 17:54, schrieb Pid: On 01/07/2011 12:44, Dark Before Dawn wrote: Hi Pid, i guess the problem is that the manager-servlet's context is mounted at root and the ServletMapping points to /manager. server.addContext(, baseDirectory); ctx.addServletMapping(/manager/*, manager-servlet); So all relative paths will point to root That's easy to change, no? server.addContext(/manager, baseDirectory); ctx.addServletMapping(/text/*, manager-servlet); Note the additional '*' in the security collection: collection.addPattern(/text/*); (The role usually assigned for the text manager servlet is manager-script) p ie: localhost/manager/html vs localhost/html I don't know what I am exactly searching for at jconsole, so here is a overview :) Thnx and cheers Darky Am 01.07.2011 12:46, schrieb Pid: On 01/07/2011 10:40, Dark Before Dawn wrote: Hi again, this is realy driving me nuts for weeks :) FAIL - Encountered exception javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost 1. Connect to your running instance with JConsole*. 2. Examine the MBeans published by the instance. 3. Confirm that you are connecting to the correct MBean. I wouldn't expect: Tomcat:type=Deployer,host=localhost to work. p * or VisualVM with the JConsole plugin enabled. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Embedded: Manager
Hi again, this is realy driving me nuts for weeks :) I am developing a Java SE application using *Tomcat* 7 in embedded mode. I am attempting to use the *tomcat* manager application (ManagerServlet) and Ant tasks to perform operations on the running *tomcat* instance. Tasks such as list, start, stop work fine, however the deploy and undeploy tasks *fail* with the following *exception* (see below). I actually get the same *exception* when trying to use the manager web interface (HTMLManagerServlet) which leads me to believe that this is a general configuration issue somewhere or misunderstanding in my code. I guess there is still something wrong with my mappings as Chuck noticed. /manager/html /manager/jmxproxy /manager/status /manager/text I realy read the API Documentation and UnitTest examples and haven't got any further :( Code: http://www.pastie.org/private/rehlryloo0zyl9korkupq Errors via ANT and Web: FAIL - Encountered exception javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost Trace: 01.07.2011 11:28:57 org.apache.catalina.core.ApplicationContext log manager-servlet: managerServlet.check[/sample] javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at org.apache.catalina.manager.ManagerServlet.isServiced(ManagerServlet.java:1433) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:721) at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:350) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Cheers Darky Am 28.06.2011 03:42, schrieb Caldarale, Charles R: From: Dark Before Dawn [mailto:dark.before.d...@gmail.com] Subject: Re: Tomcat 7 Embedded: Manager When using HTMLManagerServlet and navigating to http://localhost/manager the Manager's HTML Interface will appear. It shouldn't, unless you've been playing with the mappings in WEB-INF/web.xml. The valid URL paths are: /manager/html /manager/jmxproxy /manager/status /manager/text There is no /manager mapping, nor is there supposed to be one. Note that each mapping has its own security constraint. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Embedded: Manager
On 01/07/2011 10:40, Dark Before Dawn wrote: this is realy driving me nuts for weeks so *does* the arbit*rary* use of *bold* for me. p signature.asc Description: OpenPGP digital signature
Re: Tomcat 7 Embedded: Manager
On 01/07/2011 10:40, Dark Before Dawn wrote: Hi again, this is realy driving me nuts for weeks :) FAIL - Encountered exception javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost 1. Connect to your running instance with JConsole*. 2. Examine the MBeans published by the instance. 3. Confirm that you are connecting to the correct MBean. I wouldn't expect: Tomcat:type=Deployer,host=localhost to work. p * or VisualVM with the JConsole plugin enabled. signature.asc Description: OpenPGP digital signature
Re: Tomcat 7 Embedded: Manager
sorry for that :) diddn't want to annoy Cheers Darky Am 01.07.2011 12:41, schrieb Pid: On 01/07/2011 10:40, Dark Before Dawn wrote: this is realy driving me nuts for weeks so *does* the arbit*rary* use of *bold* for me. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Embedded: Manager
On 01/07/2011 12:44, Dark Before Dawn wrote: Hi Pid, i guess the problem is that the manager-servlet's context is mounted at root and the ServletMapping points to /manager. server.addContext(, baseDirectory); ctx.addServletMapping(/manager/*, manager-servlet); So all relative paths will point to root That's easy to change, no? server.addContext(/manager, baseDirectory); ctx.addServletMapping(/text/*, manager-servlet); Note the additional '*' in the security collection: collection.addPattern(/text/*); (The role usually assigned for the text manager servlet is manager-script) p ie: localhost/manager/html vs localhost/html I don't know what I am exactly searching for at jconsole, so here is a overview :) Thnx and cheers Darky Am 01.07.2011 12:46, schrieb Pid: On 01/07/2011 10:40, Dark Before Dawn wrote: Hi again, this is realy driving me nuts for weeks :) FAIL - Encountered exception javax.management.InstanceNotFoundException: Tomcat:type=Deployer,host=localhost 1. Connect to your running instance with JConsole*. 2. Examine the MBeans published by the instance. 3. Confirm that you are connecting to the correct MBean. I wouldn't expect: Tomcat:type=Deployer,host=localhost to work. p * or VisualVM with the JConsole plugin enabled. signature.asc Description: OpenPGP digital signature
RE: Tomcat 7 Embedded: Manager
From: Dark Before Dawn [mailto:dark.before.d...@gmail.com] Subject: Re: Tomcat 7 Embedded: Manager i guess the problem is that the manager-servlet's context is mounted at root I think right there we have a conceptual problem, or at least a terminology one. Webapps aren't mounted in the sense things are in httpd; every webapp in a servlet container is independent of the other webapps, and each webapp has _one_ unique URI path to select the webapp; normally, the path is also used as the deployment location (docBase, in Tomcat terminology). The exception is the default webapp, which must be deployed as ROOT - case sensitive - in Tomcat, and has an empty path; it is selected only when no other webapp paths can be matched to the request URI. Servlet mappings exist _within_ a webapp, and do not include the webapp path, so that the same webapp can be deployed under different paths as needed without changing the deployment descriptor. Consequently, mappings for servlets within the manager webapp are of the form /html/* and /text/* rather than /manager/html/* and /manager/text/*. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Embedded: Manager
Am 28.06.2011 03:42, schrieb Caldarale, Charles R: From: Dark Before Dawn [mailto:dark.before.d...@gmail.com] Subject: Re: Tomcat 7 Embedded: Manager When using HTMLManagerServlet and navigating to http://localhost/manager the Manager's HTML Interface will appear. It shouldn't, unless you've been playing with the mappings in WEB-INF/web.xml. The valid URL paths are: /manager/html /manager/jmxproxy /manager/status /manager/text There is no /manager mapping, nor is there supposed to be one. Note that each mapping has its own security constraint. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Hi Chuck, this is a general problem. On startup - embedded tomcat will nag about a missing global web.xml and I haven't set a web.xml (WEB-INF) for the ManagerServlet neither. org.apache.catalina.startup.ContextConfig webConfig INFO: No global web.xml found My next step would be to copy a custom web.xml (with manager mappings) to /conf Directroy and see what happens. I would prefer to programatic add a WebXml since I don't want to mess up with filesystems. Cheers Darky - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Embedded: Manager
Am 17.06.2011 23:47, schrieb Caldarale, Charles R: From: Dark Before Dawn [mailto:dark.before.d...@gmail.com] Subject: Re: Tomcat 7 Embedded: Manager Where can i find the unit test examples? I browsed the src distribution but couldn't find any examples (I think I am blind :) Quite possibly, since they're cunningly hidden in a directory named ... test. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Yeah! I finally found the Unit-Tests and got it basically working : the (HTML)ManagerServlet via MapRealm and Digest-Auth. Thanks so far :) When using HTMLManagerServlet and navigating to http://localhost/manager the Manager's HTML Interface will appear. This is also OK but when following any links I am led back to the ROOT. i.e the ServerStatus-Link will lead to http://localhost/status or when using the normal ManagerServlet I get an error FAIL - Unknown command /manager console output: org.apache.catalina.core.ApplicationContext log INFO: manager: init: Associated with Deployer 'Tomcat:type=Deployer,host=localhost' It looks like the |Manager Servlet Mapping is wrong. Can you tell me how to set it programatically for /deploy /undeploy ? Cheers Darky BTW: Here is the Code Snippet without Auth and Realm. StandardContext ctx = (StandardContext) server.addWebapp(, ); ManagerServlet mgmt = new ManagerServlet(); Wrapper mgmt_wrapper = Tomcat.addServlet(ctx, manager, mgmt); mgmt.setWrapper(mgmt_wrapper); ctx.addServletMapping(/manager, manager); |
RE: Tomcat 7 Embedded: Manager
From: Dark Before Dawn [mailto:dark.before.d...@gmail.com] Subject: Re: Tomcat 7 Embedded: Manager When using HTMLManagerServlet and navigating to http://localhost/manager the Manager's HTML Interface will appear. It shouldn't, unless you've been playing with the mappings in WEB-INF/web.xml. The valid URL paths are: /manager/html /manager/jmxproxy /manager/status /manager/text There is no /manager mapping, nor is there supposed to be one. Note that each mapping has its own security constraint. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Embedded: Manager
On 17/06/2011 21:14, Dark Before Dawn wrote: Hi guys, I am trying to deploy a WAR-File programmaticaly via ANT or manually. Therefore I would like to have a Manager Servlet which supports deploying/undeploying. My first try was something like this: Context ctx = server.addContext(/manager, baseDirectory); HTMLManagerServlet mgmt = new HTMLManagerServlet(); mgmt.setWrapper(Tomcat.addServlet(ctx, manager, mgmt)); I just get a 404 Error when visiting localhost:8080/manger and console output says: org.apache.catalina.realm.JAASRealm setContainer INFO: Set JAAS app name Tomcat I am also not sure where to set the manger name and password? Cheers and thanks in advance You need to configure a Realm. Take a look in the Tomcat 7 unit tests for examples. There are a couple of other issues with the above: - you don't want the HTML version - you'll need to make the context privileged Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 7 Embedded: Manager
Hi Mark, thanks for your fast reply. Where can i find the unit test examples? I browsed the src distribution but couldn't find any examples (I think I am blind :) Cheers Darky Am 17.06.2011 23:14, schrieb Mark Thomas: On 17/06/2011 21:14, Dark Before Dawn wrote: Hi guys, I am trying to deploy a WAR-File programmaticaly via ANT or manually. Therefore I would like to have a Manager Servlet which supports deploying/undeploying. My first try was something like this: Context ctx = server.addContext(/manager, baseDirectory); HTMLManagerServlet mgmt = new HTMLManagerServlet(); mgmt.setWrapper(Tomcat.addServlet(ctx, manager, mgmt)); I just get a 404 Error when visiting localhost:8080/manger and console output says: org.apache.catalina.realm.JAASRealm setContainer INFO: Set JAAS app name Tomcat I am also not sure where to set the manger name and password? Cheers and thanks in advance You need to configure a Realm. Take a look in the Tomcat 7 unit tests for examples. There are a couple of other issues with the above: - you don't want the HTML version - you'll need to make the context privileged Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 7 Embedded: Manager
From: Dark Before Dawn [mailto:dark.before.d...@gmail.com] Subject: Re: Tomcat 7 Embedded: Manager Where can i find the unit test examples? I browsed the src distribution but couldn't find any examples (I think I am blind :) Quite possibly, since they're cunningly hidden in a directory named ... test. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org