Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004517 [Resin] minor always 04-21-11 09:55 09-08-14 17:17
Reporter reza View Status public  
Assigned To ferg
Priority normal Resolution won't fix Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 4.0.17
  Product Build
Summary 0004517: JMX Service doesn't work with Security Manager
Description The JMX pro service doesn't work with a security manager/policy file. There seems to be a permissions issue that stops the class-loader from working properly.

The following code demonstrates the issue:

================================================================================
grant {
  permission java.util.PropertyPermission "*", "read";
  permission java.io.FilePermission "*", "read,write,execute,delete";
  permission java.lang.Reflect.ReflectPermission "suppressAccessChecks";
  permission java.lang.RuntimePermission "accessClassInPackage.*";
  permission java.lang.RuntimePermission "accessDeclaredMembers";
  permission java.lang.RuntimePermission "getClassLoader"; };

grant codeBase "file:${resin.home}/lib/-" {
        permission java.security.AllPermission; };

grant codeBase "file:${resin.home}/webapps/-" {
        permission java.security.AllPermission; };

grant codeBase "file:${java.home}/lib/-" {
        permission java.security.AllPermission; };

grant codeBase "file:${java.home}/jre/lib/-" {
        permission java.security.AllPermission; };
================================================================================

================================================================================
<resin xmlns="http://caucho.com/ns/resin" [^]
       xmlns:resin="urn:java:com.caucho.resin">

  <log-handler name="" level="all" path="stdout:"
               timestamp="[%y-%m-%d %H:%M:%S.%s] {%{thread}} "/>

  <logger name="com.caucho" level="info"/>
  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <security-manager/>

  <cluster-default>
    <resin:import path="${__DIR__}/app-default.xml"/>

    <!-- JMX service does not work with the security manager/policy -->
    <resin:JmxService/>

    <resin:import path="${__DIR__}/health.xml"/>

    <host-default>
      <web-app-deploy path="webapps" versioning="true"/>
    </host-default>
  </cluster-default>

  <cluster id="app-tier">
    <root-directory>.</root-directory>

    <server-default>
      <http address="*" port="8080"/>
      <jvm-arg>-Djava.security.policy=${resin.home}/conf/java.policy</jvm-arg>
    </server-default>

    <server id="" address="127.0.0.1" port="6800">
    </server>

    <host id="" root-directory=".">
      <web-app id="/" root-directory="webapps/ROOT"/>
      <web-app id="/resin-admin" root-directory="${resin.root}/doc/admin">
        <prologue>
          <resin:set var="resin_admin_external" value="false"/>
          <resin:set var="resin_admin_insecure" value="true"/>
        </prologue>
      </web-app>
      <web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
    </host>
  </cluster>
</resin>
================================================================================

The following exception is thrown:

================================================================================
javax.enterprise.inject.InjectionException: XmlStandardPlugin[].processAfterValidation: Could not initialize class com.caucho.config.ConfigException
    at com.caucho.config.extension.ExtensionManager$ExtensionObserver.notify(
        ExtensionManager.java:715)
    at com.caucho.config.event.EventManager.fireLocalEvent(
        EventManager.java:300)
    at com.caucho.config.event.EventManager.fireLocalEvent(
        EventManager.java:289)
    at com.caucho.config.event.EventManager.fireExtensionEvent(
        EventManager.java:273)
    at com.caucho.config.extension.ExtensionManager
        .fireAfterDeploymentValidation(ExtensionManager.java:527)
    at com.caucho.config.inject.InjectManager.notifyStart(
        InjectManager.java:3815)
    at com.caucho.config.inject.InjectManager.start(InjectManager.java:3798)
    at com.caucho.env.service.CdiSystem.start(CdiSystem.java:69)
    at com.caucho.env.service.ResinSystem.startServices(ResinSystem.java:508)
    at com.caucho.env.service.ResinSystem.start(ResinSystem.java:476)
    at com.caucho.server.resin.Resin.start(Resin.java:950)
    at com.caucho.server.resin.Resin.initMain(Resin.java:1078)
    at com.caucho.server.resin.Resin.main(Resin.java:1375)
  Caused by: java.lang.NoClassDefFoundError: Could not initialize class
      com.caucho.config.ConfigException
    at com.caucho.config.bytecode.ScopeAdapter.wrap(ScopeAdapter.java:151)
    at com.caucho.config.inject.InjectManager
        $NormalContextReferenceFactory.<init>(InjectManager.java:4564)
    at com.caucho.config.inject.InjectManager.createReferenceFactory(
        InjectManager.java:2290)
    at com.caucho.config.inject.InjectManager.getReferenceFactory(
        InjectManager.java:2244)
    at com.caucho.config.inject.InjectManager.getReference(
        InjectManager.java:2196)
    at com.caucho.config.xml.XmlStandardPlugin
        .processAfterValidation(XmlStandardPlugin.java:279)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.caucho.config.extension.ExtensionManager
        $ExtensionObserver.notify(ExtensionManager.java:704)
  ... 12 more
================================================================================

This issue was originally reported by Bill Au.
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0006490)
ferg
09-08-14 17:17

SecurityManager is not supported with Resin 4.0.
 

- Issue History
Date Modified Username Field Change
04-21-11 09:55 reza New Issue
04-21-11 10:13 billau Issue Monitored: billau
09-08-14 17:17 ferg Note Added: 0006490
09-08-14 17:17 ferg Assigned To  => ferg
09-08-14 17:17 ferg Status new => assigned
09-08-14 17:17 ferg Resolution open => won't fix
09-08-14 17:17 ferg Status assigned => closed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker