Hello! I have to use JMX console.
In cuba application, JMX console is available by default, but in jmix-application it is not available.
Is it configured as spring-starter? Which one started should I add to my project?
Hello!
What version of Jmix do you use? Jmx Console screen is provided by jmix-ui-starter
and is available by default if jmix.ui.compositeMenu
property is set to true.
Hello! I use Jmix version 0.2.0. jmix-ui-starter
is add and jmix.ui.compositeMenu
property is set to true.
In browser I can only see Administrations/Roles
and Application/Users
screens (and my custom screens), nothing else.
Every jmix application I started doesn’t contains jmx console (and others CUBA default screens), just Administrators\Roles
and Application\Users
screens.
Can you please create new one jmix project and check that? What should I do to use JMX Console?
In version 0.2.0 JMX Console screen is not added to the “exported” menu so you should add it to your menu manually:
<menu-config xmlns="http://jmix.io/schema/ui/menu">
<menu id="application" caption="msg://com.company.demo/menu.application" insertBefore="administration">
...
</menu>
<menu id="administration">
<item screen="ui_JmxConsoleScreen"/>
</menu>
</menu-config>
In version 0.3 the JMX Console is available by default as I described before.
It works, thank you!
How can I update jmix version? Just set bomVersion to 0.3.2 in my build.gradle
?
Hi,
Unfortunately Jmix 0.3 differs a lot from 0.2 in the structure of the project. Latter Jmix beta versions also differ from 0.3. So changing bomVersion in build.gradle isn’t enough.
Jmix is currently in Beta. Therefore Studio doesn’t implement migrating your project’s structure to the new version.
My sincere advice how you should upgrade your code is:
- wait until Jmix 0.9.0 is released (it will be soon).
- after - create fresh new project with Jmix 0.9.0
- then manually copy already existing code: entitities, screens, beans - from old beta project to the new one.
We don’t expect major project structure changes between Jmix 0.9 and 1.0 (stable release), so further upgrades are expected to be easier.
Hi, Roman!
I could add JMX Console to my app, but my JMX beans doesn’t contains any method.
This is interface:
@ManagedResource(description = "Some bean")
public interface SomeMBean {
@ManagedAttribute(description = "foo")
String foo();
}
This is implementation:
@Component("app_SomeBeanImpl")
public class SomeBeanImpl implements SomeMBean {
@Autowired
private DataManager dataManager;
@Override
public String foo() {
return "OK";
}
}
I can see bean in JMX console, but this bean contains not my method (and attributes).
What do I do wrong? Should I register my JMX bean in specific file?
Hi.
The problem occurs due incorrect method annotation. You should use @ManagedOperation
in your interface, for example:
@ManagedOperation(description = "SomeMBean foo")
String foo();
By the way Studio can generate JMX-beans automatically. You should invoke 'New' -> 'Advanced' -> 'JMX Bean'
and set your bean class name.
Pay attention to same bean names for facade and bean, you should change it manually now to avoid exception. It’s known issue and in nearest future it will be fixed.
Regards,
Nadezhda.