Are you trying to punch this through a firewall? You don't need to use the custom listener unless you need to specify the jndi port so you can open up a specific port in the firewall.

The error you have implies that you're trying to use the same object twice. I found this by googling the error:

<quote>
You'll get a "java.rmi.server.ExportException: internal error: ObjID already in use" if CustomAgent uses the standard system property "com.sun.management.jmxremote.port" instead of something else like "example.rmi.agent.port".

I guess that's because the out-of-the-box JMXConnectorServer also starts, and you can't have more than one in the same JVM.

Posted by J. David Beutel on February 13, 2009 at 12:52 AM CET #
from http://blogs.sun.com/jmxetc/entry/connecting_through_firewall_using_jmx
</quote>

So I'd try removing the export of com.sun.management.jmxremote.port from my setenv.sh.

Alternatively, remove the <Listener > tag that specifies the custom Listener org.apache.catalina.mbeans.JMXAdaptorLifecycleListener and let the standard listener use a random naming port.

I'm just guessing on this. You'll have to try and let us know if it works.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rooyen, Tom van
Sent: Tuesday, October 19, 2010 10:35 AM
To: Java Programming on and around the IBM i
Subject: RE: Struggling to get JMX active for Tomcat

We are running Tomcat 5.5.9.

I used this link to configure it. I used this successfully on another as400.
It's in german though..
http://blogs.sphinx.at/java/tomcat-55-jmx-konfiguration-hinter-firewall/



-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dan Kimmel
Sent: dinsdag 19 oktober 2010 17:01
To: Java Programming on and around the IBM i
Subject: RE: Struggling to get JMX active for Tomcat

What version of Tomcat are you running? It appears that jmx support first surfaced at Tomcat 5.5. Tomcat 5.5 can use native jmx in Java 1.5 or use a jmx jar at Java 1.4.

There's a pretty good description of the setup at http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html

Note that the latest Tomcat version supported by IBM is Tomcat 4.0.
We've been running Tomcat 5.0 and 5.5 on i very successfully without that support.

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rooyen, Tom van
Sent: Tuesday, October 19, 2010 8:01 AM
To: java400-l@xxxxxxxxxxxx
Subject: Struggling to get JMX active for Tomcat

Hi all

Trying to get jmx to work. Our nimsoft app uses it for remote performance monitoring of our iseries tomcat servers.
In the tomcat setenv.sh I added these settings:

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=48035
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"

In the server.xml I added:
<Listener
className="org.apache.catalina.mbeans.JMXAdaptorLifecycleListener"
namingPort="48035" port="48030" host="10.97.15.12" /> The Tomcat server starts and keeps running yet gives an rmi error:
This is an extract of the catalina.out:
7-okt-2010 15:30:14 org.apache.commons.logging.impl.Jdk14Logger info

INFO: Find registry server-registry.xml at classpath resource

7-okt-2010 15:30:14 org.apache.commons.logging.impl.Jdk14Logger error

SEVERE: Error while setting up remote JMX connector

java.rmi.server.ExportException: internal error: ObjID already in use

at java.lang.Throwable.<init>(Throwable.java:196)

at java.lang.Exception.<init>(Exception.java:41)

at java.io.IOException.<init>(IOException.java:40)

at java.rmi.RemoteException.<init>(RemoteException.java:62)

at java.rmi.server.ExportException.<init>(ExportException.java:36)

at sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:169)

at sun.rmi.transport.Transport.exportObject(Transport.java:75)

at
sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:196)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)

at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)

at
sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:180)
at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)

at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)

at
java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:186)

at
org.apache.catalina.mbeans.JMXAdaptorLifecycleListener.start(JMXAdaptorL
ifecycleListener.java:291)
at
org.apache.catalina.mbeans.JMXAdaptorLifecycleListener.lifecycleEvent(JM
XAdaptorLifecycleListener.java:230)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:119)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:688)

at org.apache.catalina.startup.Catalina.start(Catalina.java:537)

at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)

7-okt-2010 15:30:14 org.apache.commons.logging.impl.Jdk14Logger info

INFO: Server startup in 22501 ms


If I look at netstat I see that port 48035 is listening, but there seems no application behind it. I think normally http://<host>:48035 should give a response. Is this correct?

We have one other websphere JVM that uses rmi, maybe that is the problem.

Also the info message before the cancelation speaks of a server-registry.xml. This file is nowhere to be found. Do I need this?
What should it look like?

java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
Classic VM (build 1.5, build JDK-1.5, native threads, jitc_de)
Running on OS400 V5R4M0 TC08305

Hope someone can help, I'm out of ideas...

thanks!
Tom





This message and attachment(s) are intended solely for use by the addressee and may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.

If you have received this communication in error, please notify the sender immediately by telephone and with a 'reply' message.

Thank you for your co-operation.

--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.



--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.



This message and attachment(s) are intended solely for use by the addressee and may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable law.

If you are not the intended recipient or agent thereof responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.

If you have received this communication in error, please notify the sender immediately by telephone and with a 'reply' message.

Thank you for your co-operation.


--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.