Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inspecting a bean in my JBOSS JMX Agent View fails with an error

I cannot inspect any of my beans in the JMX Agent View as clicking on any bean results in the error pasted below. Every thing else seems to be working fine within JBOSS as it is properly serving my application.

Environment variables as follows...

PATH = C:\Program Files\Java\jre8\bin;C:\Users\XXX\AppData\Roaming\npm;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files\Java\jre7\bin;

JAVA_HOME = C:\Program Files (x86)\Java\jdk1.8.0_05

JBossWeb/2.0.1.GA - Error report 

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 151 in the jsp file: /inspectMBean.jsp The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files 148: else if (String.valueOf(attrValue).indexOf(sep) == -1) 149: { 150: %> 151: <input type="text" name="<%= attrName %>" value="<%= attrValue.replace("\"","&quot;") %>" <%= readonly %>> 152: <% 153: } 154: else

An error occurred at line: 151 in the jsp file: /inspectMBean.jsp The method replace(char, char) in the type String is not applicable for the arguments (String, String) 148: else if (String.valueOf(attrValue).indexOf(sep) == -1) 149: { 150: %> 151: <input type="text" name="<%= attrName %>" value="<%= attrValue.replace("\"","&quot;") %>" <%= readonly %>> 152: <% 153: } 154: else

Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415) org.apache.jasper.compiler.Compiler.compile(Compiler.java:308) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:273) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:316) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.inspectMBean(HtmlAdaptorServlet.java:220) org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:96) org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doGet(HtmlAdaptorServlet.java:77) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.

JBossWeb/2.0.1.GA

like image 788
mccainz Avatar asked May 02 '14 02:05

mccainz


People also ask

What is the purpose of JMX agent in JBoss?

JMX is a standard for managing and monitoring all varieties of software and hardware components from Java. Further, JMX aims to provide integration with the large number of existing management standards.

How do I view JMX console?

The console is accessible at http://localhost:8080/jmx-console. The JMX Console provides a raw view of the JMX MBeans which make up the server.


2 Answers

This worked in jboss-4.2.3.GA: In file

/server/{xxx}/deploy/jmx-console.war/inspectMBean.jsp

replace the affected

replace("\"","&quot;")

with

replaceAll("\"","&quot;")
like image 169
Hubert Hirsch Avatar answered Oct 16 '22 17:10

Hubert Hirsch


Had the same thing happening.

Turns out I was missing inspectMbean_jsp.class in the dcm4chee-2.17.2-psql\server\default\work\jboss.web\localhost\jmx-console\org\apache\jsp folder.

Not sure why it isn't there

like image 39
AThom Avatar answered Oct 16 '22 16:10

AThom