Re: [fedora-java] Instrumenting a Java/Linux/Tomcat/MySQL server
by Fernando Lozano
Hi threre,
Monitoing a JavaEE app server takes lots of steps which depends on application architecture.
For example, you should monitor worker threads for each Tomcat Connector you are using. If all
threads are in use (no iddle thread in pool) user response time will suffer.
Another example, if a deployed application uses datasources, you should monitor availabe connection
in the datasource connection pool, same was as connector thread pool.
> > Le mercredi 30 mai 2007 à 03:17 +0100, Joe Desbonnet a écrit :
> >
> >> Besides load average and tomcat free memory -- what else should I
> >> record given that I'm running a pretty typical
> >> Java/Linux/Tomcat/MySQL
> >> server.
> >
> > GC frequency comes to mind
>
> frequency *and* duration
>
>
> --
> Nicolas Mailhot
16 years, 6 months
Instrumenting a Java/Linux/Tomcat/MySQL server
by Joe Desbonnet
Many months ago when a web application running in Tomcat on a Linux
server experienced intermittent and severe performance problems I
setup a cron task to record Tomcat free memory and operating system
load average. I plotted these figures on a chart using JFreeChart and
I was able to get huge insight into the problem which other tools
failed to provide.
I'd like to expand this script to record other potentially useful data
which I can use as a baseline should problems arise in future.
Besides load average and tomcat free memory -- what else should I
record given that I'm running a pretty typical Java/Linux/Tomcat/MySQL
server. The kind items that come to mind is network IO, disk IO, page
fault rate.... BTW: what's the best way of getting the page fault
rate? I can't find the right file in /proc for that.
Thanks,
Joe.
16 years, 6 months
ant 1.7 in F8?
by Benjamin Konrath
Hi,
Is ant 1.7 going to be in Fedora 8? I'm in the process of packaging up
Eclipse 3.3RC1 and it requires this version of ant. I should be able to
use ant 1.6 now, but it would be nice if we can switch to ant 1.7 before
the F8 release.
Thanks, Ben
16 years, 6 months
Exception processing Global JNDI Resources - on FC6&Tomcat5.5.17
by Tim Alberts
I'm running FC6 with Tomcat 5.5.17 (standard rpm packages from the FC6
distribution).
The main problem I'm having is getting my database connection pool
setup.I'm getting a severe error that seems to be the source, but not
sure what the easy fix is. Obviously the
java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
means Tomcat can't find a class it needs, but as I'm running all rpms
from FC6 I assumed everything would be 'plug and play'. Does anyone
have some suggestions for fixing this quick?
Thank you in advance.
Below is the server.xml...
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener
className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<GlobalNamingResources>
<Environment
name="simpleValue"
type="java.lang.Integer"
value="30"/>
<Resource
name="jdbc/MSIWebDB"
type="javax.sql.DataSource"
maxWait="5000"
password="boo"
url="jdbc:mysql://msisql.inside.msi:3306/msi_intranet"
maxActive="4"
driverClassName="com.mysql.jdbc.Driver"
username="msi_intranet"
maxIdle="2"/>
<Resource
auth="Container"
description="User database that can be updated and saved"
name="UserDatabase"
type="org.apache.catalina.UserDatabase"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"/>
</GlobalNamingResources>
<Service
name="Catalina">
<Connector
port="8080"
redirectPort="8443"
maxSpareThreads="75"
maxThreads="150"
connectionTimeout="20000"
minSpareThreads="25">
</Connector>
<Connector
port="8009"
redirectPort="8443"
protocol="AJP/1.3">
</Connector>
<Engine
defaultHost="localhost"
name="Catalina">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
<Host
appBase="webapps"
name="localhost">
</Host>
</Engine>
</Service>
</Server>
Below are the server logs from startup...
10-May-07 4:06:51 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/gcj-4.1.1
10-May-07 4:06:51 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
10-May-07 4:06:51 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 837 ms
10-May-07 4:06:51 PM org.apache.catalina.core.NamingContextListener addResource
WARNING: Failed to register in JMX: javax.naming.NamingException: Could not create resource factory instance
10-May-07 4:06:51 PM org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans
SEVERE: Exception processing Global JNDI Resources
javax.naming.NamingException: Could not create resource factory instance
at org.apache.naming.factory.ResourceFactory.getObjectInstance(naming-factory-5.5.17.jar.so)
at javax.naming.spi.NamingManager.getObjectInstance(libgcj.so.7rh)
at org.apache.naming.NamingContext.lookup(naming-factory-5.5.17.jar.so)
at org.apache.naming.NamingContext.lookup(naming-factory-5.5.17.jar.so)
at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(naming-resources-5.5.17.jar.so)
at org.apache.naming.NamingContextBindingsEnumeration.next(naming-resources-5.5.17.jar.so)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(catalina-5.5.17.jar.so7ygbw0.so)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(catalina-5.5.17.jar.so7ygbw0.so)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(catalina-5.5.17.jar.so7ygbw0.so)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(catalina-5.5.17.jar.so7ygbw0.so)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(catalina-5.5.17.jar.so7ygbw0.so)
at org.apache.catalina.core.StandardServer.start(catalina-5.5.17.jar.so7ygbw0.so)
at org.apache.catalina.startup.Catalina.start(catalina-5.5.17.jar.so7ygbw0.so)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
at org.apache.catalina.startup.Bootstrap.start(bootstrap.jar.so)
at org.apache.catalina.startup.Bootstrap.main(bootstrap.jar.so)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory not found in org.apache.catalina.loader.StandardClassLoader{urls=[file:/var/lib/tomcat5/common/classes/,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-en.jar,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-fr.jar,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-es.jar,file:/var/lib/tomcat5/common/i18n/tomcat-i18n-ja.jar,file:/usr/share/java/xml-commons-apis-1.3.02.jar,file:/usr/share/java/xerces-j2-2.7.1.jar,file:/usr/share/java/jakarta-commons-collections-3.1.jar,file:/usr/share/java/libgcj-4.1.1.jar,file:/usr/share/java/jakarta-commons-el-1.0.jar,file:/usr/share/java/tomcat5-jsp-2.0-api-5.5.17.jar,file:/usr/share/java/libgcj-4.1.1.jar,file:/usr/share/java/classpathx-jaf-1.0.jar,file:/usr/share/java/ant-1.6.5.jar,file:/var/lib/tomcat5/common/lib/mysql-connector-java-5.0.5-bin.jar,file:/usr/share/java/jasper5-runtime-5.5.17.jar,file:/usr/share/java/tomcat5/naming-resources-5.5.17.jar,file:/usr/share/java/geronimo/spec-jta-1.0.1B-rc2.jar,file:/usr/share/java/tomcat5-servlet-2.4-api-5.5.17.jar,file:/usr/share/java/jakarta-commons-pool-1.3.jar,file:/usr/share/java/classpathx-mail-1.3.1-monolithic-1.1.1.jar,file:/usr/share/java/jasper5-compiler-5.5.17.jar,file:/usr/share/java/jakarta-commons-logging-api-1.0.4.jar,file:/usr/share/java/jakarta-commons-dbcp-1.2.1.jar,file:/usr/share/eclipse/plugins/org.eclipse.jdt.core_3.2.3.v_686_R32x.jar,file:/usr/share/java/mx4j/mx4j-3.0.1.jar,file:/usr/share/java/tomcat5/naming-factory-5.5.17.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/lib/jvm/java/lib/tools.jar,file:/usr/share/tomcat5/bin/bootstrap.jar,file:/usr/share/tomcat5/bin/commons-logging-api.jar,file:/usr/share/java/mx4j/mx4j-impl.jar,file:/usr/share/java/mx4j/mx4j-jmx.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}
at java.net.URLClassLoader.findClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at java.lang.Class.forName(libgcj.so.7rh)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(naming-factory-5.5.17.jar.so)
...15 more
10-May-07 4:06:51 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
10-May-07 4:06:51 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
10-May-07 4:06:51 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
10-May-07 4:06:54 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
10-May-07 4:06:54 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator/validation.xml'
10-May-07 4:06:56 PM org.apache.catalina.core.ApplicationContext log
INFO: action: []: Verifying ModuleConfig for this module
10-May-07 4:06:56 PM org.apache.catalina.core.ApplicationContext log
INFO: action: []: Verification of ModuleConfig has been completed
10-May-07 4:06:56 PM org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn init
INFO: Initializing memory database plug in from '/WEB-INF/database.xml'
10-May-07 4:06:56 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
10-May-07 4:06:56 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
10-May-07 4:06:58 PM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ''.
10-May-07 4:06:58 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
10-May-07 4:06:58 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
16 years, 7 months
DBus Java bindings
by Joe Desbonnet
Will the Java DBus bindings be packaged with Fedora 7? If not is
anyone maintaing that package as a RPM?
JOe.
16 years, 7 months
javax.management woes, again
by Andrew Haley
To cut to the chase: I've been debugging 236541 for a week now, and
I've finally found the cause:
gnu.javax.management.Server.registerMBean() is broken in Classpath.
The problem is that it should send MBeanServerNotifications to its
delegate whenever called, but it doesn't. The result of this is that
the Tomcat embedded web server is broken, because its server contexts
never get registered.
As far as I am aware, every application that uses an embedded Tomcat
is likely to be affected in the same way, and possibly standalone
Tomcat as well.
For the sake of comparison, MX4JMBeanServer.register() does this:
delegate.sendNotification(new MBeanServerNotification
(MBeanServerNotification.REGISTRATION_NOTIFICATION,
delegateName, sequenceNumber, objectName));
So, what to do for Fedora 7? I'm sure there's no time to fix
gnu.javax.management.
So, I'm proposing this
ln -sf /usr/share/java/mx4j/mx4j.jar /usr/share/java/gcj-endorsed
There is one problem that I can see: mx4j is rather old, or at least
the version in Fedora 7 is. Maybe some of the interfaces in Classpath
are more recent, so perhaps we shouldn't do this globally for all uses
of gcj. I'd appreciate comments.
Andrew.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=236541
16 years, 7 months
Another crack at photran
by Orion Poplawski
I'm starting to take another crack at building the photran Eclipse
feature. I've got a very rough srpm based on the cdt spec here:
http://www.cora.nwra.com/~orion/fedora/eclipse-photran-3.1.1-0.fc6.src.rpm
I have no idea if I've got the right compile command. Currently I'm using:
java -cp $SDK/startup.jar \
-Dosgi.sharedConfiguration.area=%{_libdir}/eclipse/configuration
\
-Duser.home=$homedir \
org.eclipse.core.launcher.Main \
-application org.eclipse.ant.core.antRunner \
-Dtype=feature \
-Did=org.eclipse.photran \
-DsourceDirectory=$(pwd) \
-DbaseLocation=$SDK \
-Dbuilder=%{eclipse_base}/plugins/org.eclipse.pde.build/templates/package-build
\
-f %{eclipse_base}/plugins/org.eclipse.pde.build/scripts/build.xml
The build now seems to be failing because it needs access to the cdt to
build:
generateScript:
[eclipse.buildScript] An error occured while generating manifest for
/export/home/orion/redhat/eclipse-photran-3.1.1/org.eclipse.photran/SDK/plugins/org.eclipse.pde.source_3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG.
[eclipse.buildScript] An error occured while generating manifest for
/export/home/orion/redhat/eclipse-photran-3.1.1/org.eclipse.photran/SDK/plugins/org.eclipse.jdt.source_3.2.2.r322_v20070104-R4CR0Znkvtfjv9-.
[eclipse.buildScript] Some inter-plug-in dependencies have not been
satisfied.
[eclipse.buildScript] Bundle org.eclipse.photran.core.intel:
[eclipse.buildScript] Missing required plug-in org.eclipse.cdt.core_0.0.0.
[eclipse.buildScript] Bundle org.eclipse.photran.errorparsers.xlf:
[eclipse.buildScript] Missing required plug-in org.eclipse.cdt.core_0.0.0.
and
[eclipse.buildScript] Bundle org.eclipse.cdt.core.linux.x86:
[eclipse.buildScript] Host plug-in org.eclipse.cdt.core_[3.1.2,4.0.0)
has not been found
I'd like to point it to /usr/share/eclipse/features/ and
/usr/share/eclipse/plugins/ so that it could resolve the CDT
dependencies from there, but I have no idea how to do this. I'm afraid
I'm a complete neophyte when it comes to building eclipse components.
--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion(a)cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com
16 years, 7 months