You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bishr Tabbaa <Bi...@NetIQ.com> on 2003/01/10 00:36:38 UTC

Connector-HOWTO

Tomcat-Dev,

I am trying to develop my own connector for Tomcat 4.x.  I have strived to
follow the programmatic conventions in the Coyote package such that my
package contains a connectorimpl, connectionprocessorimpl,
servletoutputstreamimpl, servletinputstream, requestimpl, and responseimpl.
I added an entry to server.xml, started tomcat, and encountered the
following error:

ServerLifecycleListener: createMBeans: MBeanException
java.lang.Exception: ManagedBean is not found with VigilentConnector
        at
org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:224
)
...
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

Then, I added an entry to 'mbeans-descriptors.xml' inside catalina.jar
associating an MBean with my connector.

<mbean         name="VigilentConnector"
            className="org.apache.catalina.mbeans.ClassNameMBean"
          description="Vigilent/1.0 Connector for Tomcat Standalone"
               domain="Catalina"
                group="Connector"
                 type="com.netiq.servlet.VigilentConnector">

  </mbean>

I started tomcat again and encountered the following error:

ServerLifecycleListener: createMBeans: Throwable
javax.management.MalformedObjectNameException: Cannot create object name for
com.netiq.servlet.VigilentConnector@3db503
        at
org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.jav
a:873)
        at
org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:231
)
....
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

I looked at the 4.1.18 src code of MBeanUtils.java and discovered that the
instanceof operator is applied to concrete classes!  I prefer not to change
the source, but it appears that this is the only available fork in the road.
Is there something that I am missing?

Thanks,
Bishr

-------------------------------------
Bishr Tabbaa
NetIQ Corporation
1233 West Loop South # 1800
Houston, TX 77027
Toll Free: 1-888-400-2834
Fax:       713-523-6393
Direct:    713-860-9726
Mobile:    832-651-0610
bishr.tabbaa@netiq.com
------------------------------------- 
Note:  The information contained in this message may be privileged and
confidential and protected from disclosure.  If the reader of this message
is not the intended recipient, or an employee or agent 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.  Thank you.  NetIQ, Inc.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Connector-HOWTO

Posted by Amy Roh <am...@apache.org>.
Bishr Tabbaa wrote:
> Tomcat-Dev,
> 
> I am trying to develop my own connector for Tomcat 4.x.  I have strived to
> follow the programmatic conventions in the Coyote package such that my
> package contains a connectorimpl, connectionprocessorimpl,
> servletoutputstreamimpl, servletinputstream, requestimpl, and responseimpl.
> I added an entry to server.xml, started tomcat, and encountered the
> following error:
> 
> ServerLifecycleListener: createMBeans: MBeanException
> java.lang.Exception: ManagedBean is not found with VigilentConnector
>         at
> org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:224
> )
> ...
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
>         at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>         at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> 
> Then, I added an entry to 'mbeans-descriptors.xml' inside catalina.jar
> associating an MBean with my connector.
> 
> <mbean         name="VigilentConnector"
>             className="org.apache.catalina.mbeans.ClassNameMBean"
>           description="Vigilent/1.0 Connector for Tomcat Standalone"
>                domain="Catalina"
>                 group="Connector"
>                  type="com.netiq.servlet.VigilentConnector">
> 
>   </mbean>
> 
> I started tomcat again and encountered the following error:
> 
> ServerLifecycleListener: createMBeans: Throwable
> javax.management.MalformedObjectNameException: Cannot create object name for
> com.netiq.servlet.VigilentConnector@3db503
>         at
> org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.jav
> a:873)
>         at
> org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:231
> )
> ....
>         at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>         at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> 
> I looked at the 4.1.18 src code of MBeanUtils.java and discovered that the
> instanceof operator is applied to concrete classes!  I prefer not to change
> the source, but it appears that this is the only available fork in the road.
> Is there something that I am missing?

You'll have to change createObjectName for connectors to handle your 
specific connector if you like JMX support as you can see if you looked 
at the code.  Even if you do that, admin webapp won't be able to support 
editing your own connector since it's connector specific.  You can fully 
disable JMX by commenting out Listeners if you don't want to change any 
code.

Amy

> 
> Thanks,
> Bishr
> 
> -------------------------------------
> Bishr Tabbaa
> NetIQ Corporation
> 1233 West Loop South # 1800
> Houston, TX 77027
> Toll Free: 1-888-400-2834
> Fax:       713-523-6393
> Direct:    713-860-9726
> Mobile:    832-651-0610
> bishr.tabbaa@netiq.com
> ------------------------------------- 
> Note:  The information contained in this message may be privileged and
> confidential and protected from disclosure.  If the reader of this message
> is not the intended recipient, or an employee or agent 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.  Thank you.  NetIQ, Inc.
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>