You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2022/08/12 06:09:23 UTC

[activemq] branch activemq-5.17.x updated (d03872542 -> 020519f54)

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a change to branch activemq-5.17.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


    from d03872542 [AMQ-9012] Extend javax.xml.bind package import version range in activemq-web-console bundle
     new 771e8721d [AMQ-8994] Upgrade to Pax Logging 2.1.3
     new 020519f54 Clean up remaining Xalan references

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../activemq/filter/XalanXPathEvaluator.java       | 86 ----------------------
 .../apache/activemq/filter/XPathExpression.java    |  2 +-
 assembly/src/release/examples/conf/resin-web.xml   | 35 ---------
 .../activemq/config/ValidateXMLConfigTest.java     | 11 +--
 pom.xml                                            |  4 +-
 5 files changed, 6 insertions(+), 132 deletions(-)
 delete mode 100644 activemq-broker/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java
 delete mode 100644 assembly/src/release/examples/conf/resin-web.xml


[activemq] 02/02: Clean up remaining Xalan references

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.17.x
in repository https://gitbox.apache.org/repos/asf/activemq.git

commit 020519f54f466cf91558fd59aca9d2802263b5a3
Author: Lucas Tétreault <te...@amazon.com>
AuthorDate: Mon Aug 1 09:55:32 2022 -0700

    Clean up remaining Xalan references
    
    (cherry picked from commit 7b3f13feda883c56b4b685970d9fe57f030a4c34)
---
 .../activemq/filter/XalanXPathEvaluator.java       | 86 ----------------------
 .../apache/activemq/filter/XPathExpression.java    |  2 +-
 assembly/src/release/examples/conf/resin-web.xml   | 35 ---------
 .../activemq/config/ValidateXMLConfigTest.java     | 11 +--
 4 files changed, 4 insertions(+), 130 deletions(-)

diff --git a/activemq-broker/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java b/activemq-broker/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java
deleted file mode 100644
index 7bfdaf0ac..000000000
--- a/activemq-broker/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.filter;
-
-import org.apache.activemq.command.Message;
-import org.apache.activemq.util.ByteArrayInputStream;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.TextMessage;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathFactory;
-import java.io.StringReader;
-
-public class XalanXPathEvaluator implements XPathExpression.XPathEvaluator {
-
-    private static final XPathFactory FACTORY = XPathFactory.newInstance();
-    private final String xpathExpression;
-    private final DocumentBuilder builder;
-    private final XPath xpath = FACTORY.newXPath();
-
-    public XalanXPathEvaluator(String xpathExpression, DocumentBuilder builder) throws Exception {
-        this.xpathExpression = xpathExpression;
-        if (builder != null) {
-            this.builder = builder;
-        } else {
-            throw new RuntimeException("No document builder available");
-        }
-    }
-
-    public boolean evaluate(Message message) throws JMSException {
-        if (message instanceof TextMessage) {
-            String text = ((TextMessage)message).getText();
-            return evaluate(text);
-        } else if (message instanceof BytesMessage) {
-            BytesMessage bm = (BytesMessage)message;
-            byte data[] = new byte[(int)bm.getBodyLength()];
-            bm.readBytes(data);
-            return evaluate(data);
-        }
-        return false;
-    }
-
-    private boolean evaluate(byte[] data) {
-        try {
-            InputSource inputSource = new InputSource(new ByteArrayInputStream(data));
-            Document inputDocument = builder.parse(inputSource);
-            return ((Boolean) xpath.evaluate(xpathExpression, inputDocument, XPathConstants.BOOLEAN)).booleanValue();
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    private boolean evaluate(String text) {
-        try {
-            InputSource inputSource = new InputSource(new StringReader(text));
-            Document inputDocument = builder.parse(inputSource);
-            return ((Boolean) xpath.evaluate(xpathExpression, inputDocument, XPathConstants.BOOLEAN)).booleanValue();
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    @Override
-    public String toString() {
-        return xpathExpression;
-    }
-}
diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/XPathExpression.java b/activemq-client/src/main/java/org/apache/activemq/filter/XPathExpression.java
index e90e15f00..84fd16784 100644
--- a/activemq-client/src/main/java/org/apache/activemq/filter/XPathExpression.java
+++ b/activemq-client/src/main/java/org/apache/activemq/filter/XPathExpression.java
@@ -42,7 +42,7 @@ public final class XPathExpression implements BooleanExpression {
 
     private static final Logger LOG = LoggerFactory.getLogger(XPathExpression.class);
     private static final String EVALUATOR_SYSTEM_PROPERTY = "org.apache.activemq.XPathEvaluatorClassName";
-    private static final String DEFAULT_EVALUATOR_CLASS_NAME = "org.apache.activemq.filter.XalanXPathEvaluator";
+    private static final String DEFAULT_EVALUATOR_CLASS_NAME = "org.apache.activemq.filter.JAXPXPathEvaluator";
     public static final String DOCUMENT_BUILDER_FACTORY_FEATURE = "org.apache.activemq.documentBuilderFactory.feature";
 
     private static final Constructor EVALUATOR_CONSTRUCTOR;
diff --git a/assembly/src/release/examples/conf/resin-web.xml b/assembly/src/release/examples/conf/resin-web.xml
deleted file mode 100644
index 16415491c..000000000
--- a/assembly/src/release/examples/conf/resin-web.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-   
-    http://www.apache.org/licenses/LICENSE-2.0
-   
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<web-app>
-  <!--
-      In order to be able to compatiable with Resin 2.1.x and 3.0.x,
-      both XML and XSLT have to be replaced.
-      If only xalan is included, Resin 2.1.x will fail but not 3.0.x.
-      Therefore the best way is to use the compatiable version of the
-      XML parser ans XSLT.
-       - Please refere to the following link for more detailed information.
-       - http://www.caucho.com/resin-3.0/xml/jaxp.xtp
-  -->
-  <!-- xml -->
-  <system-property javax.xml.parsers.DocumentBuilderFactory=
-               "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
-  <system-property javax.xml.parsers.SAXParserFactory=
-               "org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
-  <!--  xslt -->
-  <system-property javax.xml.transform.TransformerFactory=
-               "org.apache.xalan.processor.TransformerFactoryImpl"/>
-</web-app>
diff --git a/assembly/src/test/java/org/apache/activemq/config/ValidateXMLConfigTest.java b/assembly/src/test/java/org/apache/activemq/config/ValidateXMLConfigTest.java
index 87402f9d4..3ba1c05fd 100644
--- a/assembly/src/test/java/org/apache/activemq/config/ValidateXMLConfigTest.java
+++ b/assembly/src/test/java/org/apache/activemq/config/ValidateXMLConfigTest.java
@@ -23,6 +23,7 @@ import java.io.FileFilter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashSet;
+import java.util.Objects;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -50,15 +51,9 @@ public class ValidateXMLConfigTest {
         // resource:copy-resource brings all config files into target/conf
         File sampleConfDir = new File("target/conf");
 
-        final HashSet<String> skipped = new HashSet<String>(java.util.Arrays.asList(new String[]{
-            "resin-web.xml", "web.xml", "camel.xml"
-        }));
-
-        for (File xmlFile : sampleConfDir.listFiles(new FileFilter() {
-            public boolean accept(File pathname) {
-                return pathname.isFile() && pathname.getName().endsWith("xml") && !skipped.contains(pathname.getName());
-            }})) {
+        final HashSet<String> skipped = new HashSet<>(java.util.Arrays.asList("web.xml", "camel.xml", "jolokia-access.xml"));
 
+        for (File xmlFile : Objects.requireNonNull(sampleConfDir.listFiles(pathname -> pathname.isFile() && pathname.getName().endsWith("xml") && !skipped.contains(pathname.getName())))) {
             validateXML(xmlFile);
         }
     }


[activemq] 01/02: [AMQ-8994] Upgrade to Pax Logging 2.1.3

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.17.x
in repository https://gitbox.apache.org/repos/asf/activemq.git

commit 771e8721d497cc56a7e7c7fed893cb5d1a3fb019
Author: Jean-Baptiste Onofré <jb...@apache.org>
AuthorDate: Sat Jul 23 07:52:35 2022 +0200

    [AMQ-8994] Upgrade to Pax Logging 2.1.3
    
    (cherry picked from commit fe358c9405d15385865937e9f14539909cd33b20)
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index e11224caf..407465b85 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,7 +83,7 @@
     <json-simple-version>1.1.1</json-simple-version>
     <junit-version>4.13.2</junit-version>
     <hamcrest-version>1.3</hamcrest-version>
-    <karaf-version>4.2.11</karaf-version>
+    <karaf-version>4.3.7</karaf-version>
     <log4j-version>2.17.2</log4j-version>
     <mockito-version>3.8.0</mockito-version>
     <owasp-dependency-check-version>5.2.4</owasp-dependency-check-version>
@@ -110,7 +110,7 @@
     <jaxb-basics-version>0.12.0</jaxb-basics-version>
     <stompjms-version>1.19</stompjms-version>
 
-    <pax-logging-version>1.11.4</pax-logging-version>
+    <pax-logging-version>2.1.3</pax-logging-version>
     <pax-exam-version>4.13.1</pax-exam-version>
     <pax-url-version>2.6.11</pax-url-version>
     <felix-framework-version>5.6.12</felix-framework-version>