Re: Bad documentation error on Tomcat 6.0 howto site
On 09/15/2011 08:09 AM, Konstantin Kolinko wrote: 2011/9/15 Steve Cohen: 6.0.20. Yes, it is old... Someone told me that the manager-gui, manager-script stuff was 7.0, I switched it to manager and it worked. So evidently, this was changed in a later 6.0.x version. To me, that seems like sort of a major change to make in a minor upgrade version and it should at least be documented. See changelog, as well as release announcements. Or is the tomcat 6.0 documentation ONLY supposed to cover the latest release? It covers only the latest release. The documentation for the version that you are using is included in the download itself (see webapps/docs). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org ok, thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Bad documentation error on Tomcat 6.0 howto site
On 09/15/2011 07:39 AM, Konstantin Kolinko wrote: 2011/9/15 Steve Cohen: There is a bad error on the Tomcat 6.0 documentation website: http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access They give the 7.0 syntax for manager role names. 6.0 requires "manager", not "manager-gui" or "manager-script" and it led astray for several hours. The documentation is correct. You are probably using an old version of Tomcat 6 (and you are not telling us which one). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 6.0.20. Someone told me that the manager-gui, manager-script stuff was 7.0, I switched it to manager and it worked. So evidently, this was changed in a later 6.0.x version. To me, that seems like sort of a major change to make in a minor upgrade version and it should at least be documented. Or is the tomcat 6.0 documentation ONLY supposed to cover the latest release? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Bad documentation error on Tomcat 6.0 howto site
There is a bad error on the Tomcat 6.0 documentation website: http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Configuring_Manager_Application_Access They give the 7.0 syntax for manager role names. 6.0 requires "manager", not "manager-gui" or "manager-script" and it led astray for several hours. Thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat and Outgoing SSL
Caldarale, Charles R wrote: From: Steve Cohen [mailto:sco...@javactivity.org] Subject: Tomcat and Outgoing SSL I would like some way to configure Tomcat This has nothing to do with Tomcat - it plays no role whatsoever in your outbound requests. Whatever certificates you make available to the remote web services is entirely up to your client code. - 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 Thanks for preventing me from going down this dead end. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat and Outgoing SSL
I have an backend application that runs under Tomcat. It does not serve Web pages. It depends on various services that use SSL in one way or another: 1) It connects with a vendor's Web Service over https:, which depends on one of the certificates in the default cacerts file 2) It connects with another vendor's Web Service over https: but this one depends on a CA certificate issued by the vendor. 3) It makes SSL-encrypted connections to a MySQL database using a self-generated SSL certificate. I can get this to work by using keytool and importing the entire cacerts keystore, the self-generated CA cert for mysql, and the second vendor's ca cert into a single truststore, then Setting system properties to point at this at app startup. But this feels like a real hack. Is there a better way? I would like some way to configure Tomcat to form a truststore out of all three elements without physically merging different certificates into a truststore file. I am not sure whether Tomcat uses the various truststore configuration parameters for inbound and outbound SSL requests, or for inbound only. Is there a better way to make this work? Or if not, is it possible to use keytool to build a truststore that automatically "includes" whatever the default cacerts happens to be? Thanks - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [Tomcat] [daemon] java.lang.OutOfMemoryError unable to create new native thread
One additional restriction I have is a security bureaucracy from hell. As far as console access I have a two-hop connection. As far as GUI access I have some crappy device to log into that lets me have really bad keyboard/mouse control of the machine, which, unless I can overcome this means that GUI-based tools are not going to work, and as for remote GUI access, see above security bureaucracy. Which means I'm looking for command-line equivalents for what JConsole does, particularly the threads tab. Any ideas along that path? Pieter Temmerman wrote: Hi Steve, Some great tools to monitor your Tomcat installations are: - Jconsole (make sure you get the topthreads plugin) - VisualVM - VisualGC - Jmap Hope that helps. On Tue, 2009-02-03 at 09:31 -0600, Steve Cohen wrote: We have an application that runs under Tomcat under RHEL 5.0 and is launched by a jsvc daemon. It chugs along seemingly fine on several servers, yet yesterday crashed on one of them with the above exception seemingly without experiencing any kind of abnormal load. I am trying to get a handle on this. System is $ uname -a Linux 2.6.18-92.1.22.el5 #1 SMP Fri Dec 5 09:29:46 EST 2008 i686 i686 i386 GNU/Linux Java version: java -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02) Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode, sharing) no special JVM memory settings are used when launching tomcat, just the default memory allocations. I have read in some places that this particular form of OutOfMemoryError is actually made worse by increasing the memory size. I need to deploy some thread and memory monitoring setup to get a handle on this. Can someone suggest a path forward here? Thanks. - 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
[Tomcat] [daemon] java.lang.OutOfMemoryError unable to create new native thread
We have an application that runs under Tomcat under RHEL 5.0 and is launched by a jsvc daemon. It chugs along seemingly fine on several servers, yet yesterday crashed on one of them with the above exception seemingly without experiencing any kind of abnormal load. I am trying to get a handle on this. System is $ uname -a Linux 2.6.18-92.1.22.el5 #1 SMP Fri Dec 5 09:29:46 EST 2008 i686 i686 i386 GNU/Linux Java version: java -version java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02) Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode, sharing) no special JVM memory settings are used when launching tomcat, just the default memory allocations. I have read in some places that this particular form of OutOfMemoryError is actually made worse by increasing the memory size. I need to deploy some thread and memory monitoring setup to get a handle on this. Can someone suggest a path forward here? Thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Client Side TLS Cert in app running under Tomcat
A simple question hopefully: An application running on Tomcat 6.0 on RHEL 5.0 needs is a client of https: protected Web Service that requires a TLS certificate which the Service Vendor will supply. Where and how should the TLS certificate be installed? Is this an OS thing, a Tomcat thing, or what? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HELP!!! java.lang.NoClassDefFoundError running CXF-based client in Tomcat
Thank you Larry!!! That was it! I was barking up the wrong tree. The class that couldn't be loaded was indeed the "MyClient" class, which existed in a Utility Jar that I had not made a Java EE Module Dependency. D'Oh! Steve Larry Isaacs wrote: Be aware that in Eclipse WTP, your web project is "published" to the server to be served. Jars that are added to the project as runtime dependencies will be copied to the "WEB-INF/lib" of the "published" webapp. Just adding a jar to the build path of the web project DOES NOT add the jar as a runtime dependency. The project builds fine, but won't work at runtime due to missing classes. Normally, the Problems view will show warnings when this is the case. Assuming this is your problem, go the Java EE Module Dependencies page in the web project's Properties dialog. Make sure all the jars you want in "WEB-INF/lib" at runtime are checked. Cheers, Larry -Original Message- From: Steve Cohen [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2008 11:44 AM To: Tomcat Users List Subject: Re: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat It's the Real Tomcat, but running inside Eclipse WTP, which starts and stops the server. Caldarale, Charles R wrote: From: Steve Cohen [mailto:[EMAIL PROTECTED] Subject: Re: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat Another piece of information I omitted: JDK version java-1.5.0-sun-1.5.0.13 running under Ubuntu Linux. Is this a real Tomcat or a 3rd-party repackaged version? If the latter, please install a real one from tomcat.apache.org and try again, as the 3rd-party ones often break things in subtle ways. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat
It's the Real Tomcat, but running inside Eclipse WTP, which starts and stops the server. Caldarale, Charles R wrote: From: Steve Cohen [mailto:[EMAIL PROTECTED] Subject: Re: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat Another piece of information I omitted: JDK version java-1.5.0-sun-1.5.0.13 running under Ubuntu Linux. Is this a real Tomcat or a 3rd-party repackaged version? If the latter, please install a real one from tomcat.apache.org and try again, as the 3rd-party ones often break things in subtle ways. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat
Another piece of information I omitted: JDK version java-1.5.0-sun-1.5.0.13 running under Ubuntu Linux. This appears relevant to me after reading http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html - the section entitled XML Parsers and JSE 5, although I'm not sure what to do about it if this is the cause. This would be the first time we've tried adding a SOAP client to this application, so it seems likely that this is the case. Caldarale, Charles R wrote: From: Steve Cohen [mailto:[EMAIL PROTECTED] Subject: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat I am beginning to think the problem is not a missing class but a class conflicting with something in Tomcat. Highly likely. First just look at the names of the Tomcat-supplied jars and see if any match or are very similar to the ones you have in your webapp. (Can't tell you which directories to look at, since that varies with the version of Tomcat you're using, which you didn't bother to tell us.) If that doesn't turn up anything, try finding a tool to scan jars and report duplicate classes (sorry, I don't know of any specific ones, but there must be some out there). - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat
Tomcat version is 6.0.16. Sorry for not mentioning it originally. Thanks. Caldarale, Charles R wrote: From: Steve Cohen [mailto:[EMAIL PROTECTED] Subject: HELP!!! java.lang.NoClassDefFoundError running CXF-based client inTomcat I am beginning to think the problem is not a missing class but a class conflicting with something in Tomcat. Highly likely. First just look at the names of the Tomcat-supplied jars and see if any match or are very similar to the ones you have in your webapp. (Can't tell you which directories to look at, since that varies with the version of Tomcat you're using, which you didn't bother to tell us.) If that doesn't turn up anything, try finding a tool to scan jars and report duplicate classes (sorry, I don't know of any specific ones, but there must be some out there). - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HELP!!! java.lang.NoClassDefFoundError running CXF-based client in Tomcat
(Cross-posted on Apache CXF Mailing List) I have developed a Client for accessing a vendor's Web Service. The client is based on the CXF framework, built with source code generated from a Maven-based pom.xml and the vendor's WSDL. I ran this client in a standalone JUnit test and found it to work. Being a curmudgeon who doesn't believe in including every jar under the sun and who likes to know why I'm including what I am including, I removed 14 of the 47 jars that Maven told me to include, but which seemed irrelevant to me, and it still ran. The ultimate destination of this component is inside a web-app running under Tomcat 6.0. When I put my component and the 33 necessary jars into WEB-INF/lib I got NoClassDefFoundErrors. These errors are singularly uninformative, all I know is that the class supposedly not found is my client class, however, given the following code: MyClient myclient1 = null; MyClient myclient2 = new MyClient(); the error occurs on the second line and not the first. Therefore I conclude that the NoClassDefFoundError refers to a dependency, and not to MyClient itself. The NoClassDefFoundError itself is singularly uninformative - the getCause() member, for example, returns null. I need more information and can't figure out where to find it. I have since tried putting back all the fourteen other jars that Maven insisted I include and THIS DID NOT HELP. I am beginning to think the problem is not a missing class but a class conflicting with something in Tomcat. How the HELL do I debug this, given the miserable lack of information in a NoClassDefFoundError? I have tried putting a -verbose switch on the jvm command line that launches Tomcat, and while this does emit a slew more information, it still doesn't tell me what I need. - 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: stupid tomcat/eclipse question
>> The error clearly indicates that servlet-api.jar is missing from the classpath. It should be located under CATALINA_HOME\lib in case of TC 6. You would think so but it's not the case. NoClassDefFoundErrors are seldom so clear. They do a nice job of hiding the root cause. In this case it was two copies of some totally unrelated class needed by a servlet that caused the error. I posted on the solution yesterday, [EMAIL PROTECTED] wrote: The error clearly indicates that servlet-api.jar is missing from the classpath. It should be located under CATALINA_HOME\lib in case of TC 6. -Original Message- From: Steve Cohen <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Mon, 8 Sep 2008 11:03 pm Subject: stupid tomcat/eclipse question I've had a stable development environment running Tomcat 6.0 within Eclipse 3.3. I did something stupid to configuration and now I can't get away from this error as soon as the server starts. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java :39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI mpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.NoClassDefFoundError: javax/servlet/Servlet at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... In spite of trying putting everything I can think of onto the runtime classpath I can't make this go away. Where is Tomcat supposed to find javax/servlet/Servlet and why was this so easy before and so difficult now. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] You are invited to Get a Free AOL Email ID. - http://webmail.aol.in - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: Need help with Tomcat MBean support - SOLVED
Finally figured out how to do what I wanted to do. Turns out I had no need at all of creating an MBean in my client. Duh! I never understood why I needed to do that but that is what the sample did. All I needed to do was call the MBeanServerConnection.invoke() method with a suitable object name and other params to invoke the operation on the MBean I had ALREADY instantiated on my server. That's what you get for slavishly following example code instead of thinking. By the way I found this out by staring at the Ant examples on http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html. I finally realized that if Ant can invoke an operation, so could a non-Ant executable. From there a simple peek at the jmx ant task source code showed me what I needed to do. Voila! Gotta love open source - once you figure out where to look. Thank you to all who helped. Steve Cohen wrote: I sent this in over the weekend and didn't get a response so let me try this again a bit differently. The Sun JDK 5.0 JMX tutorial shows that it is possible and simple to create JMX client and JMX server in separate JVMs and have them talk to each other. The first article cited by Mr. Hall shows that it is possible and simple to create a JMX server running inside Tomcat and talk to it through tools such as MC4J and JManage. I need to combine the Server side approach recommended by the article (JMX server within Tomcat webapp) with the Client side approach recommended by Sun in their tutorial. So far my client-side app can connect to the MBean server inside of Tomcat and talk to it but it fails to create the MBean needed to interact with the server because of ClassLoader issues. Questions: 1. Is this even possible? It would seem to be so since MC4J and JManage know how to do it. 2. If so, how do I surmount these ClassLoader issues? Thank you very much. Steve Cohen wrote: Okay using approach of first article. The MBean server is correctly initialized and everything on the server side looks good. Now we come to the client side. The first article assumes you are just going to connect using a tool such as MC4J or JManage (monitoring tools). That is not my use case. I want to write a command-line client that can talk to the MBean (which is inside of Tomcat) and invoke an operation on the MBean. I use the Client.java sample from the Sun tutorial as a starting point. I am able to connect to the server, and get a list of MBeans, but I fail when trying to call createMBean(). I am using the simple two-parameter version of createMBean() and it always fails with javax.management.ReflectionException: The MBean class could not be loaded by the default loader repository It seems pretty clear that my client needs to use one of the other versions of createMBean(), one that specifies some other Class Loader but I have no clue what I should be using for that. H. Hall wrote: Steve Cohen wrote: Let me ask my question a little more directly: Does the presence of a descriptor cause instantiation of an instance of an MBean or do I have to write code to create a server-side instance of my MBean and if so, where should this code reside or is there some configuration artifact that causes this instantiation to happen? Why don't you take a look at these two articles: http://today.java.net/pub/a/today/2005/11/15/using-jmx-to-manage-web-applications.html?page=1 http://marxsoftware.blogspot.com/2008/07/jmx-model-mbeans-with-apache-commons.html If you use the NetBeans IDE you might be interested in the JMX plugin for NB. Here is a link to a tutorial "Getting Started with JMX Monitoring in NetBeans IDE 6.0" http://www.netbeans.org/kb/60/java/jmx-getstart.html cheers, HH - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Language/Locale processing within Tomcat
I've just realized I have a problem with my application running in Tomcat related to Spanish-language text input by the users. When running my application on an Ubuntu 7.10 platform, I have no problems with Spanish language characters. When I run the same application on the production RHEL 5 platform, I can see mangling of the accented characters in my log file and downstream at various points. Yet both platforms report LANG=en_US.UTF-8 Where else do I need to look? - 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: stupid tomcat/eclipse question
Thanks! Turned out that the problem was I had put some application jars (which were duplicated in WEB-INF/lib) on the runtime classpath. Your post got me to thinking that maybe these weren't necessary. Not only weren't they necessary but removing them made the problem go away. Addition by subtraction. D'oh! Larry Isaacs wrote: -Original Message----- From: Steve Cohen [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2008 1:34 PM To: Tomcat Users List Subject: stupid tomcat/eclipse question I've had a stable development environment running Tomcat 6.0 within Eclipse 3.3. I did something stupid to configuration and now I can't get away from this error as soon as the server starts. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja va:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso rImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.NoClassDefFoundError: javax/servlet/Servlet at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... In spite of trying putting everything I can think of onto the runtime classpath I can't make this go away. The Tomcat batch files deliberately ignore the CLASSPATH environment variable because failing to do so greatly increases the odds of Tomcat not starting. Modifying the runtime classpath in Eclipse is going to have the same effect on your odds of Tomcat starting for the exact same reason. Tomcat 6.0.x only needs bootstrap.jar on the classpath. Some additional jars get "added" automatically by Java per the "Class-Path" attribute in the MANIFEST.MF found in bootstrap.jar. With this set of jars, the bootstrap process will use the "common.loader" property value found in the "conf/catalina.properties" file to create the "common" classloader which will contain the javax.servlet classes among many others required by the Tomcat server. Not knowing what your original Tomcat configuration was, it's hard to guess what the original change was that caused Tomcat not to start. Modifying the runtime classpath can easily result in this same symptom. You might try creating a new Tomcat server from the same Tomcat runtime in Eclipse and see if it will start. If not, it suggests you have done something to your Tomcat installation. Cheers, Larry Where is Tomcat supposed to find javax/servlet/Servlet and why was this so easy before and so difficult now. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: Need help with Tomcat MBean support
I sent this in over the weekend and didn't get a response so let me try this again a bit differently. The Sun JDK 5.0 JMX tutorial shows that it is possible and simple to create JMX client and JMX server in separate JVMs and have them talk to each other. The first article cited by Mr. Hall shows that it is possible and simple to create a JMX server running inside Tomcat and talk to it through tools such as MC4J and JManage. I need to combine the Server side approach recommended by the article (JMX server within Tomcat webapp) with the Client side approach recommended by Sun in their tutorial. So far my client-side app can connect to the MBean server inside of Tomcat and talk to it but it fails to create the MBean needed to interact with the server because of ClassLoader issues. Questions: 1. Is this even possible? It would seem to be so since MC4J and JManage know how to do it. 2. If so, how do I surmount these ClassLoader issues? Thank you very much. Steve Cohen wrote: Okay using approach of first article. The MBean server is correctly initialized and everything on the server side looks good. Now we come to the client side. The first article assumes you are just going to connect using a tool such as MC4J or JManage (monitoring tools). That is not my use case. I want to write a command-line client that can talk to the MBean (which is inside of Tomcat) and invoke an operation on the MBean. I use the Client.java sample from the Sun tutorial as a starting point. I am able to connect to the server, and get a list of MBeans, but I fail when trying to call createMBean(). I am using the simple two-parameter version of createMBean() and it always fails with javax.management.ReflectionException: The MBean class could not be loaded by the default loader repository It seems pretty clear that my client needs to use one of the other versions of createMBean(), one that specifies some other Class Loader but I have no clue what I should be using for that. H. Hall wrote: Steve Cohen wrote: Let me ask my question a little more directly: Does the presence of a descriptor cause instantiation of an instance of an MBean or do I have to write code to create a server-side instance of my MBean and if so, where should this code reside or is there some configuration artifact that causes this instantiation to happen? Why don't you take a look at these two articles: http://today.java.net/pub/a/today/2005/11/15/using-jmx-to-manage-web-applications.html?page=1 http://marxsoftware.blogspot.com/2008/07/jmx-model-mbeans-with-apache-commons.html If you use the NetBeans IDE you might be interested in the JMX plugin for NB. Here is a link to a tutorial "Getting Started with JMX Monitoring in NetBeans IDE 6.0" http://www.netbeans.org/kb/60/java/jmx-getstart.html cheers, HH - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
stupid tomcat/eclipse question
I've had a stable development environment running Tomcat 6.0 within Eclipse 3.3. I did something stupid to configuration and now I can't get away from this error as soon as the server starts. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.NoClassDefFoundError: javax/servlet/Servlet at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... In spite of trying putting everything I can think of onto the runtime classpath I can't make this go away. Where is Tomcat supposed to find javax/servlet/Servlet and why was this so easy before and so difficult now. - 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: Need help with Tomcat MBean support
Okay using approach of first article. The MBean server is correctly initialized and everything on the server side looks good. Now we come to the client side. The first article assumes you are just going to connect using a tool such as MC4J or JManage (monitoring tools). That is not my use case. I want to write a command-line client that can talk to the MBean (which is inside of Tomcat) and invoke an operation on the MBean. I use the Client.java sample from the Sun tutorial as a starting point. I am able to connect to the server, and get a list of MBeans, but I fail when trying to call createMBean(). I am using the simple two-parameter version of createMBean() and it always fails with javax.management.ReflectionException: The MBean class could not be loaded by the default loader repository It seems pretty clear that my client needs to use one of the other versions of createMBean(), one that specifies some other Class Loader but I have no clue what I should be using for that. H. Hall wrote: Steve Cohen wrote: Let me ask my question a little more directly: Does the presence of a descriptor cause instantiation of an instance of an MBean or do I have to write code to create a server-side instance of my MBean and if so, where should this code reside or is there some configuration artifact that causes this instantiation to happen? Why don't you take a look at these two articles: http://today.java.net/pub/a/today/2005/11/15/using-jmx-to-manage-web-applications.html?page=1 http://marxsoftware.blogspot.com/2008/07/jmx-model-mbeans-with-apache-commons.html If you use the NetBeans IDE you might be interested in the JMX plugin for NB. Here is a link to a tutorial "Getting Started with JMX Monitoring in NetBeans IDE 6.0" http://www.netbeans.org/kb/60/java/jmx-getstart.html cheers, HH - 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: jsvc creates pid file owned by root
[EMAIL PROTECTED] wrote: See Thread at: http://www.techienuggets.com/Detail?tx=31984 Posted on behalf of a User You shouldn't be messing about with the ownership of the PID file. It is created by jsvc at startup. If you use jsvc properly it will start as root, create the pid file, startup tomcat ... Ah, but what if you are using jsvc to run something other than tomcat? I am using jsvc to run a standalone java application as a daemon that starts whenever the server is restarted. However, I would like a certain user other than root to be able to run the same launching script for this daemon to start and stop the service as needed. I find I cannot do it because of the permission on the .pid file. No matter where I put the pidfile and no matter whether or not I run umask in the launching script, the pidfile gets created with an owner of root and perms of 600. If I run umask 133 and then create a file, I get perm 644 as I want on the file. But the same does not work from within my jsvc-launch script with the pid file. Nothing I've tried works. In Response To: Hi, I can start and stop Tomcat 5.5 with the jsvc program but the problem is that the pid file is created with permissions 600 and owned by root. I want to be able to read the pid file to check if the Tomcat process is up and running and also for other purposes. Is it possible to make the pid file be owned by the user that runs Tomcat or have the permissions to be set to 666? Regards Gunnar I am the anonymous author of the piece you're responding to. What a coincidence seeing it bounce back here on the Tomcat list - Of course, my example did NOT concern Tomcat. Anyway my JSVC daemon needs to fulfill two needs: 1) restart the application on bootup - which is done by root 2) allow non-root user to start-stop the application using the standard daemon start/stop/restart kinds of commands. The only way I could get this to work was to modify my shell script to change the permissions and the group of the pid file after the jsvc start call was made. This works very nicely. Putting a call to umask in the script before the jsvc invocation did not work. I still don't know why. - 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: Need help with Tomcat MBean support
Thanks again. These articles are very clear and simple. They do raise a couple questions, though. In the first article, no mention is made of an mbeans-descriptor.xml file. It's all done programatically in the first article - which might be fine for my needs. The Tomcat documentation does make it sound as though you can drop the xml file into your MBean package directory and something provided by Tomcat picks it up and makes the MBean accessible, but it now seems that this is not the case. The second article shows code to read these XML files ( CommonsModelMBeanDemonstrator.applyCommonsModeler() ) which leads me to ask whether Tomcat comes with commons-modeler support built-in or whether this must be added manually as in this sample. Anyway, it appears that there are two approaches here 1 - do everything programatically, in which case the .xml file isn't needed 2 - use the commons-modeler xml-file approach (question remains what support, if any, Tomcat provides for this). Do I have this right? H. Hall wrote: Steve Cohen wrote: Let me ask my question a little more directly: Does the presence of a descriptor cause instantiation of an instance of an MBean or do I have to write code to create a server-side instance of my MBean and if so, where should this code reside or is there some configuration artifact that causes this instantiation to happen? Why don't you take a look at these two articles: http://today.java.net/pub/a/today/2005/11/15/using-jmx-to-manage-web-applications.html?page=1 http://marxsoftware.blogspot.com/2008/07/jmx-model-mbeans-with-apache-commons.html If you use the NetBeans IDE you might be interested in the JMX plugin for NB. Here is a link to a tutorial "Getting Started with JMX Monitoring in NetBeans IDE 6.0" http://www.netbeans.org/kb/60/java/jmx-getstart.html cheers, HH - 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: Need help with Tomcat MBean support
Let me ask my question a little more directly: Does the presence of a descriptor cause instantiation of an instance of an MBean or do I have to write code to create a server-side instance of my MBean and if so, where should this code reside or is there some configuration artifact that causes this instantiation to happen? Steve Cohen wrote: H. Hall wrote: Okay, thanks again. This got me off square one. Now on to square two. :-) 1. I compose a legal mbeans-descriptor.xml file configuring my MBean according to DTD. I place it in the domain "Catalina". Don't know if this is right. Also tried my own domain name. 2. I launch Tomcat with parameters sufficient to launch JMX, define a port etc. This works. 3. I modify the simple Client.java from the Sun tutorial modifying the url to talk to my port and the jmxrmi context. This succeeds to the point of letting me iterate the list of available domain names. 4, When I use the version of the descriptor with a custom Domain name, this domain name does not even appear in the list and the Client app fails with a ClassNotFoundException. 5. When I use the version of the descriptor that places my mbean in the Catalina domain, my bean is not found within that Domain and the Client app also fails - with a ClassNotFoundException. Is there a preexisting domain within Tomcat to which I should attach my mbean? If not, what must I do to get my mbean found. Steve Cohen wrote: I am trying to write a custom MBean to put a particular function of our application under management control This application is currently deployed under Tomcat 6.0. I do not need remote monitoring/management. Local management will do. I am perfectly happy to invoke my management function through a shell script invoking a java jmx client to perform the action required. I find the Tomcat documentation on this subject confusing and sparse. The howto page here: http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html simply shows a sample configuration file without explaining which elements on it are required, which pertain to the specific example, etc. Is there a standard syntax for these mbean descriptor files with a true explanation of each field? I believe it's based on the Apache Commons Modeler. Here is a link to the DTD for the Model MBeans Configuration File: http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd Here is a link for the java doc for package org.apache.tomcat.util.modeler. Scroll down to description: http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/tomcat/util/modeler/package-summary.html cheers, HH Also, compared to the standard Sun JMX tutorial - which elements does Tomcat provide - server, agent ? Thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: Need help with Tomcat MBean support
H. Hall wrote: Okay, thanks again. This got me off square one. Now on to square two. :-) 1. I compose a legal mbeans-descriptor.xml file configuring my MBean according to DTD. I place it in the domain "Catalina". Don't know if this is right. Also tried my own domain name. 2. I launch Tomcat with parameters sufficient to launch JMX, define a port etc. This works. 3. I modify the simple Client.java from the Sun tutorial modifying the url to talk to my port and the jmxrmi context. This succeeds to the point of letting me iterate the list of available domain names. 4, When I use the version of the descriptor with a custom Domain name, this domain name does not even appear in the list and the Client app fails with a ClassNotFoundException. 5. When I use the version of the descriptor that places my mbean in the Catalina domain, my bean is not found within that Domain and the Client app also fails - with a ClassNotFoundException. Is there a preexisting domain within Tomcat to which I should attach my mbean? If not, what must I do to get my mbean found. Steve Cohen wrote: I am trying to write a custom MBean to put a particular function of our application under management control This application is currently deployed under Tomcat 6.0. I do not need remote monitoring/management. Local management will do. I am perfectly happy to invoke my management function through a shell script invoking a java jmx client to perform the action required. I find the Tomcat documentation on this subject confusing and sparse. The howto page here: http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html simply shows a sample configuration file without explaining which elements on it are required, which pertain to the specific example, etc. Is there a standard syntax for these mbean descriptor files with a true explanation of each field? I believe it's based on the Apache Commons Modeler. Here is a link to the DTD for the Model MBeans Configuration File: http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd Here is a link for the java doc for package org.apache.tomcat.util.modeler. Scroll down to description: http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/tomcat/util/modeler/package-summary.html cheers, HH Also, compared to the standard Sun JMX tutorial - which elements does Tomcat provide - server, agent ? Thanks. - 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: Need help with Tomcat MBean support
Soon as I get out of this time crunch I will try to do so. Mark Thomas wrote: Steve Cohen wrote: Thank you very much - this is exactly what I was looking for. And a word to the Tomcat team - Documentation would be much improved by simply mentioning the two links provided by Mr. Hall. Patches are always welcome. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: Need help with Tomcat MBean support
Thank you very much - this is exactly what I was looking for. And a word to the Tomcat team - Documentation would be much improved by simply mentioning the two links provided by Mr. Hall. H. Hall wrote: Steve Cohen wrote: I am trying to write a custom MBean to put a particular function of our application under management control This application is currently deployed under Tomcat 6.0. I do not need remote monitoring/management. Local management will do. I am perfectly happy to invoke my management function through a shell script invoking a java jmx client to perform the action required. I find the Tomcat documentation on this subject confusing and sparse. The howto page here: http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html simply shows a sample configuration file without explaining which elements on it are required, which pertain to the specific example, etc. Is there a standard syntax for these mbean descriptor files with a true explanation of each field? I believe it's based on the Apache Commons Modeler. Here is a link to the DTD for the Model MBeans Configuration File: http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd Here is a link for the java doc for package org.apache.tomcat.util.modeler. Scroll down to description: http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/tomcat/util/modeler/package-summary.html cheers, HH Also, compared to the standard Sun JMX tutorial - which elements does Tomcat provide - server, agent ? Thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need help with Tomcat MBean support
I am trying to write a custom MBean to put a particular function of our application under management control This application is currently deployed under Tomcat 6.0. I do not need remote monitoring/management. Local management will do. I am perfectly happy to invoke my management function through a shell script invoking a java jmx client to perform the action required. I find the Tomcat documentation on this subject confusing and sparse. The howto page here: http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html simply shows a sample configuration file without explaining which elements on it are required, which pertain to the specific example, etc. Is there a standard syntax for these mbean descriptor files with a true explanation of each field? Also, compared to the standard Sun JMX tutorial - which elements does Tomcat provide - server, agent ? Thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]