Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-6900

ActiveMQConnectionFactory - trustedPackages cannot be configured in JNDI resource definition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.15.3
    • None
    • None
    • None

    Description

      It seems, there is a problem in ActiveMQConnectionFactory, when "trustedPackages" is configured in JNDI resource definition.

      Let suppose following JNDI resource definition in Tomcat container

      <Resource
        name="jms/ConnectionFactory"
        auth="Container"
        type="org.apache.activemq.ActiveMQConnectionFactory"
        factory="org.apache.activemq.jndi.JNDIReferenceFactory"
        brokerURL="tcp://localhost:61616"
        trustAllPackages="false"
        trustedPackages="java.lang,java.util"
      />
      

      The final ConnectionFactory (and Connection) acquired by "web-application" (via javax.naming.Context) does not contains trustedPackages configuration.  As workaround can be used trustAllPackages=true, which is set up via common IntrospectionSupport at ActiveMQConnectionFactory.buildFromMap(Map<String, Object>).

      But I think that configuration of trustedPackages should work too. I attached my fix proposal and simple test case. IMHO it should be enough to handle/add trustAllPackages and trustedPackages in ActiveMQConnectionFactory.buildFromProperties(Properties) and ActiveMQConnectionFactory.populateProperties(Properties) methods.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rkraus Radek Kraus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: