-
1. Re: Trailblazer JMX Service Objects
echon Dec 15, 2005 2:34 PM (in response to echon)well.. i think a lot of people would have tested this eample..
Nobody has a solution?? -
-
3. Re: Trailblazer JMX Service Objects
amwilliams Dec 16, 2005 11:00 AM (in response to echon)"echon" wrote:
well.. i think a lot of people would have tested this eample..
Nobody has a solution??
I've noticed the same thing. I think the annotations for JMX changed EJB Preview 3. I get the same error in Eclipse, but everything compiles fine through an ant script and works once deployed. Sorry I don't have any more insight than that. -
4. Re: Trailblazer JMX Service Objects
echon Dec 19, 2005 9:10 AM (in response to echon)is it possible to only mark the interface with @Management and implement it in the MBean?
-
5. Re: Trailblazer JMX Service Objects
knifegun Dec 20, 2005 8:15 AM (in response to echon)Here is what I did. I created three classes (1. Management intetrface, 2. MBean interface 3. MBean implementation) shown below. I was able to deploy the MBean and access it via the following code. Hope this helps.
CONTEXT_PROPERTIES = new Properties();
CONTEXT_PROPERTIES.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
CONTEXT_PROPERTIES.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
CONTEXT_PROPERTIES.setProperty("java.naming.provider.url",
mServer);
InitialContext ctx = new InitialContext(CONTEXT_PROPERTIES);
mTelnetSession = (TelnetSession)ctx.lookup(TelnetSession.class.getName());
---------- 1 ---------------
package com.xxxx.ejb;
import org.jboss.annotation.ejb.Management;
@Management()
public interface TelnetSessionManagement {
public void create() throws Exception;
public void start() throws Exception;
public void stop();
public void destroy();
}
---------- 2 ---------------
package com.xxxx.ejb;
public interface TelnetSession {
...
}
---------- 3 ---------------
package com.xxxx.ejb;
import javax.ejb.*;
import org.jboss.annotation.ejb.RemoteBinding;
import org.jboss.annotation.ejb.Service;
import org.jboss.annotation.ejb.Management;
import org.jboss.system.ServiceMBeanSupport;
@Service(objectName="telnet:service=telnetservice")
@Remote(TelnetSession.class)
public class TelnetSessionMBean extends ServiceMBeanSupport implements TelnetSession, TelnetSessionManagement {
....
} -
-
7. Re: Trailblazer JMX Service Objects
boercher Dec 20, 2005 6:36 PM (in response to echon)I had the same problem. I downloaded two versions of jboss-annotation.jar (both tagged jboss-4.0.3SP1), one build on 2005-10-23 requiring Management to have a value and one of 2005-10-07 which does not. With the more recent version I annotate the interface and the bean with the other.
The management interface seems to be quite instable yet. See the history of Management.java at
http://anoncvs.forge.jboss.com/viewrep/JBoss/jboss-ejb3/src/main/org/jboss/annotation/ejb/Management.java
Branch HEAD
1.7 2005-11-08 value optinal
1.2 2005-09-27 value required
1.1 2005-05-31 no value
Branch Branch_4_0
1.1.2.4 2005-10-06 value required
1.1.2.1 2005-06-19 no value
so the future seems to be an optional value...