Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in RaygunEnvironmentMessage.cfc:build #34

Closed
sfeldkamp opened this issue Dec 29, 2020 · 4 comments · Fixed by #40
Closed

Error in RaygunEnvironmentMessage.cfc:build #34

sfeldkamp opened this issue Dec 29, 2020 · 4 comments · Fixed by #40
Assignees

Comments

@sfeldkamp
Copy link

ColdFusion 2018, Java11

java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getCommittedVirtualMemorySize() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @b671dda

References:

https://stackoverflow.com/questions/55952859/unable-to-make-public-long-com-sun-management-internal-operatingsystemimpl-getop

Workaround:

In file, comment lines

// var mf = createObject("java", "java.lang.management.ManagementFactory");
// var osbean = mf.getOperatingSystemMXBean();

Replace returnContent availablePhysicalMemory and totalPhysicalMemory values with JavaCast("null", "")

@bdw429s
Copy link

bdw429s commented Dec 29, 2020

SEEETH!!! 👋 Ok, back to work, everyone.

@TheRealAgentK
Copy link
Contributor

@sfeldkamp On which line does it actually fail? Creating mf, osbean or later when it's trying to populate via osbean.something() calls?

@sfeldkamp
Copy link
Author

sfeldkamp commented Dec 29, 2020

osbean.getFreePhysicalMemorySize() and osbean.getTotalPhysicalMemorySize() both error in the same way.

stacktrace

java.lang.reflect.InaccessibleObjectException: Unable to make public long com.sun.management.internal.OperatingSystemImpl.getCommittedVirtualMemorySize() accessible: module jdk.management does not "opens com.sun.management.internal" to unnamed module @3205610d at 
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340) at 
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280) at 
java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198) at 
java.base/java.lang.reflect.Method.setAccessible(Method.java:192) at 
coldfusion.runtime.java.ObjectHandler.Initialize(ObjectHandler.java:61) at 
coldfusion.runtime.java.ObjectHandler.<init>(ObjectHandler.java:30) at 
coldfusion.runtime.java.ReflectionCache$1.load(ReflectionCache.java:30) at 
coldfusion.runtime.java.ReflectionCache$1.load(ReflectionCache.java:28) at 
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522) at 
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315) at 
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278) at 
com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193) at 
com.google.common.cache.LocalCache.get(LocalCache.java:3932) at 
com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936) at 
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806) at 
coldfusion.runtime.java.ReflectionCache.get(ReflectionCache.java:39) at 
coldfusion.runtime.StructBean.<init>(StructBean.java:79) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3678) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3561) at 
cfraygunenvironmentmessage2ecfc1707299273$funcBUILD.runFunction(/mnt/fileserver/www/distributorcentral/resources/cfc/raygun/raygunenvironmentmessage.cfc:37) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:553) at 
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at 
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:484) at 
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:447) at 
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:398) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:371) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:287) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:830) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:613) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:438) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3584) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3561) at 
cfraygunmessagedetails2ecfc924802574$funcBUILD.runFunction(/mnt/fileserver/www/distributorcentral/resources/cfc/raygun/raygunmessagedetails.cfc:52) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:553) at 
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at 
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:484) at 
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:447) at 
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:398) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:371) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:287) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:830) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:613) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:438) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3584) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3561) at 
cfraygunmessage2ecfc770539382$funcBUILD.runFunction(/mnt/fileserver/www/distributorcentral/resources/cfc/raygun/raygunmessage.cfc:37) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:553) at 
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at 
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:484) at 
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:447) at 
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:398) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:371) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:287) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:830) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:613) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:438) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3584) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3561) at 
cfRaygunClient2ecfc2029156574$funcSEND.runFunction(/mnt/fileserver/www/distributorcentral/resources/cfc/raygun/RaygunClient.cfc:91) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:553) at 
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at 
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:484) at 
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:447) at 
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:398) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:371) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:287) at 
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4132) at 
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:4112) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3604) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3561) at 
cfDCRaygunClient2ecfc608494240$funcSEND.runFunction(/mnt/fileserver/www/distributorcentral/resources/cfc/raygun/DCRaygunClient.cfc:67) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:553) at 
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at 
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:447) at 
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:398) at 
coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:371) at 
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:287) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:830) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:613) at 
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:438) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3584) at 
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:3561) at 
cferror_raygun2ecfm968472036.runPage(/mnt/fileserver/error/error_raygun.cfm:1) at 
coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:262) at 
coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:735) at 
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:565) at 
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:4286) at 
cferror_exception2ecfm1105152038._factor6(/mnt/fileserver/error/error_exception.cfm:307) at 
cferror_exception2ecfm1105152038.runPage(/mnt/fileserver/error/error_exception.cfm:1) at 
coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:262) at 
coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:735) at 
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:565) at 
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at 
coldfusion.filter.CfincludeFilter.include(CfincludeFilter.java:33) at 
coldfusion.filter.ExceptionFilter.runExceptionHandler(ExceptionFilter.java:683) at 
coldfusion.filter.ExceptionFilter.handleException(ExceptionFilter.java:266) at 
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:110) at 
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:78) at 
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at 
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at 
coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60) at 
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at 
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at 
coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at 
coldfusion.CfmServlet.service(CfmServlet.java:226) at 
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at 
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46) at 
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at 
java.base/java.lang.Thread.run(Thread.java:834)

@TheRealAgentK
Copy link
Contributor

Sweet, thx @sfeldkamp.

I think the best option is to document this and tell people that there's a need to open the respective modules when they launch the JVM process. And then at runtime, I'll try to check for the availability of them via Reflection. Something alone these lines:

public class ExtendedOsMxBeanAttr {
    public static void main(String[] args) {
        String[] attr={ "TotalPhysicalMemorySize", "FreePhysicalMemorySize",
                        "FreeSwapSpaceSize", "TotalSwapSpaceSize"};
        OperatingSystemMXBean op = ManagementFactory.getOperatingSystemMXBean();
        List<Attribute> al;
        try {
            al = ManagementFactory.getPlatformMBeanServer()
                                  .getAttributes(op.getObjectName(), attr).asList();
        } catch (InstanceNotFoundException | ReflectionException ex) {
            Logger.getLogger(ExtendedOsMxBeanAttr.class.getName())
                  .log(Level.SEVERE, null, ex);
            al = Collections.emptyList();
        }
        for(Attribute a: al) {
            System.out.println(a.getName()+": "+a.getValue());
        }
    }
}```

TheRealAgentK added a commit to TheRealAgentK/raygun4cfml that referenced this issue Jul 21, 2021
TheRealAgentK added a commit that referenced this issue Jul 21, 2021
* Updated Readme

* Added location property to box.json to point to MindscapeHQ repo.

* Additional minor changes to stacktrace handling. Request URL now combines script name and path info from CGI.

* Fixed #34 and release of 1.3.0

* Cosmetic fixes and version number in box
TheRealAgentK added a commit that referenced this issue Jul 26, 2021
* Updated Readme

* Added location property to box.json to point to MindscapeHQ repo.

* Additional minor changes to stacktrace handling. Request URL now combines script name and path info from CGI.

* Fixed #34 and release of 1.3.0

* Cosmetic fixes and version number in box

* Feature/make physical mem tracking optional (#2)

* Trying to track physical memory in a try/catch.

* Added TODO

* Changelog and box for 1.3.1

* Readme for 1.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants