Ok, part 3:
I've tried to register my bean with the MBeanServer manually, but I can't...
[10-10-13 14:37:38.079] {main} !!!!!!!!!!!! mbeanserver: GlobalMBeanServer[]
class: com.caucho.jmx.GlobalMBeanServer
[10-10-13 14:37:38.080] {main} ???????????????? EXCEPTION?????????????
javax.management.NotCompliantMBeanException:
My:name=MyBean mbean has no MBean interface for class
com.myco.MyBean__ResinWebBean
at
com.caucho.jmx.AbstractMBeanServer.createMBean(AbstractMBeanServer.java:439)
at
com.caucho.jmx.AbstractMBeanServer.registerMBean(AbstractMBeanServer.java:413)
...
It seems that the rewritten class doesn't retain its interfaces!
So, it seems that any candi beans can't be jmx'd... =(
jon
On Wed, Oct 13, 2010 at 1:55 PM, Jon Stevens <[email protected]> wrote:
> Also, if I use: xmlns:foo="urn:java:com.foo.biz" (adding the :java:), then
> I get:
>
> [10-10-13 13:53:31.626] {main} WEB-INF/resin-web.xml:19:
> 'QName[resin:{urn:java:com.caucho.resin}JndiName]' cannot be instantiated
> because it does not map to a known class
>
> jon
>
>
> On Wed, Oct 13, 2010 at 1:38 PM, Jon Stevens <[email protected]> wrote:
>
>> Hey resin masters,
>>
>> I'm using Resin 4.0.10.
>>
>> I have a bean in my war file:
>>
>> @Named("MyBean")
>>
>> @Startup
>>
>> @Singleton
>>
>> @TransactionAttribute(TransactionAttributeType.REQUIRED)
>>
>> public class MyBean implements My, MyMXBean {
>>
>> @PostConstruct
>>
>> public void start() throws Exception {
>>
>> log.info("!!!!!!!!!!!! MyBean started !!!!!!!!!!!!!!!!!");
>>
>> }
>>
>> }
>>
>> In this case, the bean doesn't show up in the jconsole.
>>
>> If I define a <resource> element in resin-web.xml (as suggested by the
>> documentation here:
>> http://caucho.com/resin-4.0/examples/jmx-basic/index.xtp):
>>
>> <resource mbean-name="mybean:name=MyBean" type="com.MyBean" />
>>
>> Then I get an error at start up about a duplicate name trying to be
>> registered because of the @Named annotation. This conflicts directly with
>> the documentation (
>> http://caucho.com/resin-4.0/admin/config-el-ref.xtp#resource) that
>> suggests to use <bean>... and <bean> suggests to use another set of
>> configuration that doesn't work.Here is my resin-web.xml that I tried:
>>
>> <web-app xmlns="http://caucho.com/ns/resin"
>>
>> xmlns:ee="urn:java:ee"
>>
>> xmlns:resin="urn:java:com.caucho.resin"
>>
>> xmlns:cfg="urn:java:com.caucho.config"
>>
>> xmlns:jms="urn:java:com.caucho.jms"
>>
>> xmlns:ejb="urn:java:com.caucho.ejb.cfg"
>>
>> xmlns:foo="urn:com.foo.biz"
>>
>> >
>>
>> <foo:MyBean resin:JndiName="java:comp/env/MyBean" />
>>
>> </web-app>
>>
>> Results in this exception:
>>
>> [10-10-13 13:34:22.494] {main} WEB-INF/resin-web.xml:19: 'foo:MyBean' is
>> an unknown property of 'com.caucho.server.webapp.WebApp'.
>> 19: <foo:MyBean
>> resin:JndiName="java:comp/env/MyBean" />
>> 20: </web-app>
>>
>> If I remove the @Named annotation and keep the config in resin-web.xml,
>> then the bean shows up correctly in jconsole. However, I see MyBean started
>> printed out a bunch of times when resin starts. It is clearly trying to
>> start the bean too many times.
>>
>> I guess ideally I'd have a way to just use @Named (or another appropriate
>> annotation) and have the bean show up in jconsole with the methods that are
>> defined in MyMXBean (or MyMBean). Having to put a bean into .xml config just
>> to get it to register with JMX seems like overkill.
>>
>> Also, a small typo bug report:
>> http://caucho.com/resin-4.0/admin/config-candi.xtp#Administration, the
>> href link to <resin:JmxService> is to JmsService
>>
>> thanks,
>>
>> jon
>>
>>
>
_______________________________________________
resin-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/resin-interest