Re: ACCESSING TOMCAT JMX SUPPORT REMORTELY VIA THE RMI CONNECTOR

2005-09-21 Thread Dirk Weigenand
Hi,

 --- Ursprüngliche Nachricht ---
 Von: jiang ying [EMAIL PROTECTED]
 An: tomcat-user@jakarta.apache.org
 Betreff: ACCESSING TOMCAT JMX SUPPORT REMORTELY VIA THE RMI CONNECTOR
 Datum: Wed, 21 Sep 2005 16:26:00 +0800
 
 hi, I know the way to access Tomcat JMX support via http adaptor.
 I also know how to monitor an application via JMX by registering an 
 mbeanserver.
 But I really confused about accessing Tomcat JMX support via RMI
 connector:
 1. how to configure Mx4j RMI connector with Tomcat 5.5, since only 
 Activating JMX MX4J Http Adaptor could be found in the Tomcat website.
 2. after configuring RMI connector, how can I access Tomcat JMX support 
 programmatically? I am not clear about the mbeanserver that tomcat mbeans 
 has been registed. How can I make use of the connector, thread pool, 
 servlet information that Tomcat has already monitored and controlled.
 Thank you. 
 :)
 

Have a look at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/monitoring.html.

You can then use e.g. MC4J (http://mc4j.org/confluence/display/MC4J/Home?)
for monitoring Tomcat.

Regards
  Dirk

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ACCESSING TOMCAT JMX SUPPORT REMORTELY VIA THE RMI CONNECTOR

2005-09-21 Thread Dirk Weigenand
Hi,

 
 Before posting my question, I have studied 
 http://jakarta.apache.org/tomcat/tomcat-5.5-doc/monitoring.html. It 
 explains the way to activate HTTP adaptor.

Well it explains how to activate jmx remote monitoring right at the start of
the page. Did you follow the link to SUNs web site? There you'll find a
thorough explanation what all the possible properties and their meaning are.

I mean the properties in those boxes in the 'Enabling remote JMX' section,
i.e.: 
set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=%my.jmx.port% \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false

Regards
   Dirk

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ACCESSING TOMCAT JMX SUPPORT REMORTELY VIA THE RMI CONNECTOR

2005-09-21 Thread Dirk Weigenand
Hi,

 --- Ursprüngliche Nachricht ---
 Von: jiang ying [EMAIL PROTECTED]
 An: tomcat-user@jakarta.apache.org
 Betreff: Re: ACCESSING TOMCAT JMX SUPPORT REMORTELY VIA THE RMI CONNECTOR
 Datum: Wed, 21 Sep 2005 23:38:36 +0800
 
 I did follow the link to SUNs web site and did the exercise. I know how to
 use JMX, but I don't know how to get the mbeanserver that the tomcat JMX 
 support registed. And I've been searching the material about mx4j at all 
 times :(. 

Mmh, using SUNs reference implementation:

MBeanServer mbeanServer = (MBeanServer)MBeanServerFactory.findMBeanServer(
null ).get( 0 );

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Optimization and monitoring

2005-08-31 Thread Dirk Weigenand
Hi,

 Hi List,
   I want to increase the default memory usage of tomcat 5
 and monitor tomcat thru JMX
 
 for memory usage
 
 for JMX
 - -Dcom.sun.management.jmxremote.port=
  -Dcom.sun.management.jmxremote.ssl=false
  -Dcom.sun.management.jmxremote.authenticate=false
 
 but I dont where exactly to add these lines
 - - ./startup.sh  -Xmn100M -Xms500M -Xmx500M
 - - or in Catlina.sh
 - - or set envoirment variable - JAVA_opts
 
 can someone pl tell which is the best place to put these variables
 
 I tried in all these places but with no effect :-(
 

At the top of startup.sh look for a line starting with JAVA_OPTS=

Add your settings there and restart tomcat.

regards
Dirk

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Client Deployer 5.5.11 NullPointerException

2005-08-25 Thread Dirk Weigenand
Allistair,

looks like the missing ant taskdef for jasper.

I thought that to be fixed.

 --- Ursprüngliche Nachricht ---
 Von: Allistair Crossley [EMAIL PROTECTED]
 An: tomcat-user@jakarta.apache.org
 Betreff: Client Deployer 5.5.11 NullPointerException
 Datum: Thu, 25 Aug 2005 11:09:40 +0100
 
 Hi,
  
 I've decided to try out the Deployer tool for the first time to see if it
 makes like a little easier for deployments to our test servers. 
  
 I've used the 5.5.11 Alpha Deployer as I noted some threads indicating a
 problem with 5.5.9's version. 
  
 I've come across the following when running it pretty much out of box. I
 setup a deployer.properties file. Am I missing some kind of classpath or
 could this be caused by a file in my web application?
  
 Regards, Allistair.
  
 compile:
  [copy] Copying 2235 files to C:\deployer-intratest\build\webapp
  [copy] Copied 521 empty directories to 2 empty directories under C:\d
 r-intratest\build\webapp
   [jasper2] java.lang.NullPointerException
   [jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(
 pilationContext.java:220)
   [jasper2] at org.apache.jasper.JspC.processFile(JspC.java:913)
   [jasper2] at org.apache.jasper.JspC.execute(JspC.java:1061)
   [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Met
   [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMetho
 sorImpl.java:39)
   [jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegat
 hodAccessorImpl.java:25)
   [jasper2] at java.lang.reflect.Method.invoke(Method.java:585)
   [jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.ja
 )
   [jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElem
 va:269)
   [jasper2] at org.apache.tools.ant.Task.perform(Task.java:364)
   [jasper2] at org.apache.tools.ant.Target.execute(Target.java:301)
   [jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:32
   [jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java
  
   [jasper2] at org.apache.tools.ant.Project.executeTargets(Project.jav
 )
   [jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:632)
   [jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:183)
   [jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:
   [jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java
  
 BUILD FAILED
 C:\deployer-intratest\build.xml:45: org.apache.jasper.JasperException
  
 Total time: 1 minute 33 seconds
 
 
 FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
 ---
 QAS Ltd.
 Registered in England: No 2582055
 Registered in Australia: No 082 851 474
 ---
 /FONT
 
 

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jndi question

2005-08-22 Thread Dirk Weigenand
Hi Sean,

 --- Ursprüngliche Nachricht ---
 Von: Sean Rowe [EMAIL PROTECTED]
 An: tomcat-user@jakarta.apache.org
 Betreff: jndi question
 Datum: Mon, 22 Aug 2005 01:26:49 -0500
 
 I have tried for several hours now to get connection pooling for my 
 MySql database to work, but have been unable to do so.  I keep getting 
 this error:
 
 javax.naming.NoInitialContextException: Cannot instantiate class:
 org.apache.commons.dbcp.BasicDataSourceFactory
 
 
 
 It's bombing out on this code:
 
 Properties p=new Properties();
  

p.put(Context.INITIAL_CONTEXT_FACTORY,org.apache.commons.dbcp.BasicDataSourceFactory);
  p.put(Context.PROVIDER_URL,jdbc:mysql://localhost:3306);
  Context initCtx = new InitialContext(p); // here's where it dies
 

You're mixing up some concepts here. Context.INITIAL_CONTEXT_FACTORY is
meant to provide the name of a factory producing JNDI contexts, not a
factory for producing JDBC DataSources. The same goes for the next line of
code. Context.PROVIDER_URL is not used for providing information about a
database connection.

There is extensive documentation on the tomcat web site regarding JNDI
ressource configuration. Have a look at the following URL:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html

 Can someone please help me, or at least point me in the direction of 
 some documentation that I've missed?  I've searched google and every 
 other search engine I can think of.  Thanks in advance.
 
 Sean Rowe
 

Regards
Dirk

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jndi question

2005-08-22 Thread Dirk Weigenand
Sean,

 --- Ursprüngliche Nachricht ---
 Von: Sean Rowe [EMAIL PROTECTED]
 An: Tomcat Users List tomcat-user@jakarta.apache.org
 Betreff: Re: jndi question
 Datum: Mon, 22 Aug 2005 09:24:10 -0500
 
 Thanks for responding Dirk.  I've practically memorized the 
 documentation on the link you sent:
 
 // Obtain our environment naming context
 Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup(java:comp/env);
 
 // Look up our data source
 DataSource ds = (DataSource)
   envCtx.lookup(jdbc/EmployeeDB);
 
 // Allocate and use a connection from the pool
 Connection conn = ds.getConnection();
 ... use this connection to access the database ...
 conn.close();
 
 Whenever I try this, here's what I get (which led me to trying it the way
 I posted):
 
 javax.naming.NameNotFoundException: Name java:comp is not bound in this
 Context
 

No. Did you look at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html?

I recommend putting the context definition in its own content.xml. On
redeploying my application tomcat wouldn't find the driver class anymore.

Mind you not the class itself but the definition of what class to load.

This problem was solved by putting the context into context.xml.

regards
   Dirk

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



re: how do others deal with classloader not being recycled

2005-07-28 Thread Dirk Weigenand
Hi,

 I am assuming that this FAQ entry is still valid for Tomcat 5.5.9:
   Why does the memory usage increase when I redeploy a web application?
 Because the Classloader (and the Class objects it loaded) cannot be
 recycled. They are stored in the permanent heap generation by the JVM,
 and when you redepoy a new class loader is created, which loads another
 copy of all these classes. This can cause OufOfMemoryErrors eventually.
 
   This could explain why, when I redeploy my webapp many times, I
 eventually run out of PermMemory.
 
   I am curious what others do, in production, because of this issue?
 

Have a look at the following page:

http://wiki.apache.org/jakarta-commons/Logging/UndeployMemoryLeak

   We are going to be doing some testing to see about optimizing the
 memory allocation, but I am curious how others handle this.
 
 Thanx.

Regards

  Dirk

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hot deployment - Your experience

2005-06-13 Thread Dirk Weigenand
Hi,

 --- Ursprüngliche Nachricht ---
 Von: Bernhard Slominski [EMAIL PROTECTED]
 An: 'Tomcat Users List' tomcat-user@jakarta.apache.org
 Betreff: Hot deployment - Your experience
 Datum: Mon, 13 Jun 2005 14:27:45 +0200
 
 Hi all,
 
 I'm working on a backoffice admin application on Tomcat (5.5.7, Sun
 Solaris
 9).
 I try to do hot deployment via a war file, but it doesn't work at all for
 me.
 What I do is just to copy the war file across.
 
 The problems I got (happens randomly):
 - application including war file disappears
 - Randon error messages, like log4j exceptions occur, it's fine after
 restrating
 - Tomcat hangs up
 
 I just want to know if someone is using hot deployment  and interested how
 you do it.
 
 Thank you
 
 Bernhard


i use the predefined task supplied with tomcat to deploy my application to
tomcat. There are no problems using these tasks.

regards,
   Dirk

-- 
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden  testen ++ http://www.gmx.net/de/go/promail ++

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem for loading files under WEB-INF/classes

2005-06-10 Thread Dirk Weigenand
Hi,

 
 I want to load some files that I've placed in the WEB-INF/classes 
 directory of my project (particularly the file log4j.properties).
 
 The problem is that I always have the same errors logged in stdout 
 tomcat's log file : java.io.FileNotFoundException...
 

you can load your properties via 

InputStream is = getClass().getResourceAsStream( /log4j.properties );

 The files are well-placed, and curiously my webapp can read a ressource 
 bundle file that I provide for i18n, which is in this same directory.
 
 I believed that Tomcat automatically place files under WEB-INF/classes 
 into the path of the webapp. I'm wrong ? What's the problem exactly ?
 
 Thank you for your help.
 
 Note: Running Tomcat 5.5.9 under Windows XP or Windows 2000, JVM 1.5
 

Works for me with Tomcat 5.5.7/Windows XP and Tomcat 5.5.9/Debian Sarge.

regards,

 Dirk

-- 
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 5.5.9: NamingException cannot be resolved or is not a type - JNDI, MySQL

2005-06-09 Thread Dirk Weigenand
Have a look at the tomcat documentation:

DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number
of Jakarta-Commons components:

* Jakarta-Commons DBCP
* Jakarta-Commons Collections
* Jakarta-Commons Pool

These libraries are located in a single JAR at
$CATALINA_HOME/common/lib/naming-factory-dbcp.jar. However, only the classes
needed for connection pooling have been included, and the packages have been
renamed to avoid interfering with applications.


 --- Ursprüngliche Nachricht ---
 Von: Greg Brownell [EMAIL PROTECTED]
 An: Tomcat Users List tomcat-user@jakarta.apache.org
 Betreff: Re: Tomcat 5.5.9: NamingException cannot be resolved or is not a
 type - JNDI, MySQL
 Datum: Wed, 08 Jun 2005 17:44:55 -0400
 
 Great! Thanks Torsten.  Added javax.naming  Now new problem:
 
 NamingException:
  javax.naming.NamingException: Could not create resource factory, 
 ClassNotFoundException:org.apache.commons.dbcp.BasicDataSourceFactory
 
 This exposed several other pitfalls.  Tomcat distribution did not come 
 with the apache commons jars: collections, dbcp, pool.  Installed them 
 in common/lib and all is well.
 
 Thanks tons.
 
 Greg.
 

regards,

   Dirk

-- 
Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis
++ Jetzt anmelden  testen ++ http://www.gmx.net/de/go/promail ++

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Scheduled task in tomcat - how?

2005-05-18 Thread Dirk Weigenand
Hi,

 --- Ursprüngliche Nachricht ---
 Von: Michael Mehrle [EMAIL PROTECTED]
 An: Tomcat Users List tomcat-user@jakarta.apache.org
 Betreff: Scheduled task in tomcat - how?
 Datum: Tue, 17 May 2005 19:16:10 -0700
 
 I need to create an automated task in tomcat that gets launched every two
 hours or so, does its work and then sleeps again.

Have a look at quartz (http://www.opensymphony.com/quartz).

 The task needs to send
 some request values via a secure (https) POST to a cgi script running on
 an
 outside server, then receive the response, parse it and put it into the
 database. The response doesn't return the values as request parameters,
 but
 instead simply returns records in CSV (comma separated values) format, one
 record per line.
 
 So, here's what I'm pondering:
   a.. What's the best way to create that automated (scheduled) task and
 run
 it as a servlet under tomcat (5.5.9)?

See above and look for the quartz initializer servlet then code up your
org.quartz.Job, describe it in jobs.xml and put in a CronTrigger for it.

regards

Dirk

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]