How to invoke MBeans from command prompt in Wildfly 8.2.0 - jmx

I have below queries.
Is there any way to access JBoss MBeans in EAP 6 (wildfly 8.2.0) through Command Line like twiddle in EAP 5 (JBoss 6 AS) ?
Whether JBoss EAP 6 has any command line tool (like twiddle.sh) to invoke custom MBeans ?
Please help. Thanks.

Domain mbeans are out of the jbosscli scope at the moment, so it seems from this jboss issue https://issues.jboss.org/browse/PRODMGT-425

Related

How to let JBoss not to affect my own log4j2 settings?

I'm using Log4j2(2.17.1) with two type of configs(log4j.prop & log4j2.xml) on multiple projects. My APP's log4j2 works properly on Tomcat 9 while reading external log4j config. But somehow it stops working or only logging into server.log when I deploy my APP onto JBoss EAP 7. So I think the problem is coming from JBoss, and I need a way to tell it don't mess with my own Log4j2. Does anyone know how to do it?
With JBoss EAP 7.4 there is a new module which delegates the log4j-api logs to the jboss-logmanager. If you want to use the log4j log manager (log4j-core) then you need to exclude some modules from your deployment.
Option 1 below I would say is preferred since it only affects a single deployment. Option 2 will affect all deployments.
Option 1
Add a jboss-deployment-structure.xml to your deployment:
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.logging.log4j.api" />
</exclusions>
</deployment>
</jboss-deployment-structure>
Option 2
Change the add-logging-api-dependencies attribute in the logging subsystem to false.
CLI example:
/subsystem=logging:write-attribute(name=add-logging-api-dependencies, value=false)
The root cause for this issue is related to the "ClassLoader" which is searched by JBoss EAP Logging in order to find the appropriate logging provider implementation. This search is made in the following order:
JBoss EAP LogManager
Log4j
Slf4j
JDK logging
Since both JBoss EAP LogManager and Log4j2 are available in the classpath, the JBoss EAP LogManager will be utilized due to the "higher precedence". For this reason, you must set the use-deployment-logging-config=false in the logging subsystem.
Furthermore, the JBoss EAP LogManager also uses classes from Log4j2 in its own implementation. That's why the modules, org.apache.log4j and org.apache.commons.logging have to be excluded from the deployment in order for Log4J2 to work correctly.

Grails 2.4.4 compatibility with Java 8

I am having a legacy grails application that uses Grails 2.4.4 & has a runtime of Java7 / Tomcat7. We are planning to take it to Azure app service but azure supports runtime starting from java 8 / tc 8.5.
We are looking to upgrade the application to grails 2.5 as that seems to be supporting jdk8. Are there any pointers on how a 2.4.4 application could be migrated to 2.5 ?
I have done this already. There were some issues i had to solve but the error-logs and stackoverflow were my friends. I cannot provide a howto but if you just try it and send the errors you get i would be pleased to help you.
I was able to successfully get the application with a stack of grails 2.2.4 , java 1.7 , tomcat 7 migrated to grails 2.5.6 , Java 1.8 (compile) , tomcat 9 ( runtime java 11). Some of the hurdles i encountered are:
If your app uses JAXB , make sure that is available in app's runtime. With java 8 runtimes, they were available by default.
mailService Bean creation issues - Ran to issues with instantiating the mailService Bean & was resolved by setting the poolSize to 1 in the configuration.
txManager , sessionFactory instantiating issues - those were are settled by having the runtime jars - JaxB , marshaller etc. Though the stacktrace was misleading.

Create Glassfish windows service error

I have created glassfish service on window but could not start the service. I have checked the domain service error log and getting the following errors:
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.8', but '1.7' is required.
could not find java.dll
Could not find Java SE Runtime Environment.
I have upgraded from Java 7 to Java 8 and after upgrading service could no be started. How can I solve this poroblem
Ok! I had to delete the following files: java.exe, javaw.exe and javaws.exe
from System32 in order to work. Its working fine now.
If you're using any version of GlassFish below 4.1, it won't run on Java 8. You need to upgrade your GlassFish as well or, if that's not an option, revert to Java 7.

Sonar as a service on Windows 8 32bit

I have been running Sonar successfully on Windows 8 32bit. I tried to get it working as a Windows service but I got a 503. From something I found on Google I am running it as 'Network Service' but still no luck. Also, I don't know how I can see any logging of what is going on, C:\Program Files\sonar-3.4.1\logs doesn't show anything once the service has started. Any help would be appreciated, I'm so close!
Create a dedicated windows (administraton) user ( i.e. sonar / sonar ) for the Sonar service and start the service with that user.

Deploying Grails Atmosphere app in JBoss 7

Greeting,
I'm trying to make this example work in Grails 2.1 using atmosphere plugin. When running in development environment on Tomcat it does not work, probably because Tomcat does not support web-services.
So I'm deploying it on JBoss 7.1. It does not work as well. And the following exception could be found in the log file
AtmosphereFramework exception: java.lang.IllegalStateException: The servlet or filters
that are being used by this request do not support async operation
I found the article related to async servlets support in Grails. Seems that Servlet3AsyncWebXmlProcessor should add async support to web.xml. But somebody should invoke it.
I think that atmosphere plugin is responsible for allowing async communication.
Have I missed something? Could you please help to make it work on AS7?
Ideally, I would like to figure out the way of running atmosphere applications in development environment? Is it possible?

Resources