You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2022/10/11 16:19:49 UTC

[tomee] branch tomee-8.x updated (227c730797 -> 23a343170b)

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

jgallimore pushed a change to branch tomee-8.x
in repository https://gitbox.apache.org/repos/asf/tomee.git


    from 227c730797 TOMEE-4057 - Remove CXF classes from our patch sources which do not contain any 'real' patches
     new 0ceeae206f Continue if we cannot create a resource for the MDB destination
     new 2c07749163 Test to ensure that a JMS destination does not need to be created for a MDB to work
     new 23a343170b Merge branch 'tomee-8.x' of github.com:apache/tomee into tomee-8.x

The 3 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:
 .../src/main/java/org/apache/openejb/config/AutoConfig.java           | 4 ++++
 ...rOverwriteBothConfigurationTest.java => MDBAutoConfigOffTest.java} | 0
 2 files changed, 4 insertions(+)
 copy container/openejb-core/src/test/java/org/apache/openejb/activemq/{ActivationContainerOverwriteBothConfigurationTest.java => MDBAutoConfigOffTest.java} (100%)


[tomee] 01/03: Continue if we cannot create a resource for the MDB destination

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

jgallimore pushed a commit to branch tomee-8.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 0ceeae206f23b9b0d58d4cc68105f3a427b44964
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Tue Oct 11 16:31:42 2022 +0100

    Continue if we cannot create a resource for the MDB destination
---
 .../src/main/java/org/apache/openejb/config/AutoConfig.java           | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
index e64c566246..cec361397e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
@@ -64,6 +64,7 @@ import org.apache.openejb.util.PropertyPlaceHolderHelper;
 import org.apache.openejb.util.SuperProperties;
 import org.apache.openejb.util.URISupport;
 import org.apache.openejb.util.URLs;
+import org.apache.xbean.recipe.ConstructionException;
 
 import javax.annotation.ManagedBean;
 import javax.ejb.TimerService;
@@ -932,6 +933,9 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
                     } catch (final OpenEJBException e) {
                         // The MDB doesn't need the auto configured "openejb/destination" env entry
                         ejbDeployment.removeResourceLink("openejb/destination");
+                    } catch (ConstructionException e) {
+                        logger.warning("Unable to create destination {0} for {1}. The MDB may not require this, so attempting to continue without it.", resourceLink.getResId(), mdb.getEjbName());
+                        ejbDeployment.removeResourceLink("openejb/destination");
                     }
                 }
             }


[tomee] 03/03: Merge branch 'tomee-8.x' of github.com:apache/tomee into tomee-8.x

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

jgallimore pushed a commit to branch tomee-8.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 23a343170b198b826fd4adc88ac6093501078486
Merge: 2c07749163 227c730797
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Tue Oct 11 17:19:23 2022 +0100

    Merge branch 'tomee-8.x' of github.com:apache/tomee into tomee-8.x

 .../java/org/apache/cxf/annotations/Policy.java    |   80 -
 .../apache/cxf/annotations/WSDLDocumentation.java  |   88 -
 .../cxf/attachment/AttachmentDataSource.java       |  107 -
 .../cxf/attachment/AttachmentDeserializer.java     |  462 ----
 .../cxf/attachment/AttachmentSerializer.java       |  345 ---
 .../org/apache/cxf/attachment/AttachmentUtil.java  |  572 -----
 .../apache/cxf/attachment/Base64DecoderStream.java |  196 --
 .../apache/cxf/attachment/ContentDisposition.java  |  144 --
 .../cxf/attachment/LazyAttachmentCollection.java   |  362 ----
 .../cxf/attachment/MimeBodyPartInputStream.java    |  275 ---
 .../java/org/apache/cxf/bus/CXFBusFactory.java     |   47 -
 .../bus/blueprint/BundleDelegatingClassLoader.java |  134 --
 .../cxf/bus/blueprint/BusDefinitionParser.java     |   72 -
 .../apache/cxf/bus/blueprint/ConfigurerImpl.java   |  180 --
 .../org/apache/cxf/bus/extension/Extension.java    |  291 ---
 .../cxf/bus/extension/ExtensionManagerImpl.java    |  381 ----
 .../ServiceContractResolverRegistryImpl.java       |  113 -
 .../java/org/apache/cxf/bus/osgi/CXFActivator.java |  134 --
 .../cxf/bus/osgi/CXFExtensionBundleListener.java   |  181 --
 .../org/apache/cxf/bus/osgi/OSGIBusListener.java   |  224 --
 .../cxf/bus/resource/ResourceManagerImpl.java      |   85 -
 .../apache/cxf/bus/spring/BusDefinitionParser.java |  310 ---
 .../apache/cxf/bus/spring/BusEntityResolver.java   |   94 -
 .../cxf/bus/spring/BusExtensionPostProcessor.java  |   71 -
 .../cxf/bus/spring/Jsr250BeanPostProcessor.java    |  164 --
 .../apache/cxf/bus/spring/NamespaceHandler.java    |   57 -
 .../java/org/apache/cxf/bus/spring/SpringBus.java  |  142 --
 .../cxf/catalog/CatalogXmlSchemaURIResolver.java   |  102 -
 .../java/org/apache/cxf/common/i18n/Exception.java |   58 -
 .../java/org/apache/cxf/common/i18n/Message.java   |   91 -
 .../apache/cxf/common/i18n/UncheckedException.java |   84 -
 .../cxf/common/injection/ResourceInjector.java     |  446 ----
 .../java/org/apache/cxf/common/jaxb/JAXBUtils.java | 1180 -----------
 .../common/logging/AbstractDelegatingLogger.java   |  457 ----
 .../org/apache/cxf/common/logging/LogUtils.java    |  485 -----
 .../cxf/common/logging/RegexLoggingFilter.java     |  117 --
 .../cxf/common/spi/ClassGeneratorClassLoader.java  |  153 --
 .../cxf/common/spi/NamespaceClassGenerator.java    |  450 ----
 .../org/apache/cxf/common/util/ASMHelperImpl.java  |  273 ---
 .../org/apache/cxf/common/util/Base64Utility.java  |  474 -----
 .../org/apache/cxf/common/util/CachedClass.java    |   37 -
 .../org/apache/cxf/common/util/ClassHelper.java    |  140 --
 .../apache/cxf/common/util/CollectionUtils.java    |  126 --
 .../java/org/apache/cxf/common/util/Compiler.java  |  382 ----
 .../common/util/ModCountCopyOnWriteArrayList.java  |  156 --
 .../org/apache/cxf/common/util/PackageUtils.java   |  181 --
 .../apache/cxf/common/util/ProxyClassLoader.java   |   89 -
 .../org/apache/cxf/common/util/ProxyHelper.java    |  140 --
 .../common/util/ReflectionInvokationHandler.java   |  199 --
 .../org/apache/cxf/common/util/SortedArraySet.java |  266 ---
 .../cxf/common/util/SpringClassUnwrapper.java      |  111 -
 .../cxf/common/util/SpringClasspathScanner.java    |  202 --
 .../org/apache/cxf/common/util/StreamPrinter.java  |   63 -
 .../org/apache/cxf/common/util/URIParserUtil.java  |  209 --
 .../cxf/common/xmlschema/SchemaCollection.java     |  389 ----
 .../jsse/MultiKeyPasswordKeyManager.java           |   84 -
 .../configuration/jsse/TLSClientParameters.java    |  258 ---
 .../configuration/jsse/TLSParameterJaxBUtils.java  |  420 ----
 .../cxf/configuration/spring/ConfigurerImpl.java   |  288 ---
 .../cxf/databinding/source/SourceDataBinding.java  |  104 -
 .../cxf/databinding/stax/StaxDataBinding.java      |  187 --
 .../cxf/endpoint/AbstractConduitSelector.java      |  308 ---
 .../org/apache/cxf/endpoint/ClientCallback.java    |  166 --
 .../java/org/apache/cxf/endpoint/ClientImpl.java   | 1192 -----------
 .../java/org/apache/cxf/endpoint/EndpointImpl.java |  220 --
 .../java/org/apache/cxf/endpoint/ServerImpl.java   |  221 --
 .../org/apache/cxf/feature/FastInfosetFeature.java |  110 -
 .../org/apache/cxf/feature/WrappedFeature.java     |   61 -
 .../cxf/feature/transform/XSLTOutInterceptor.java  |  210 --
 .../patch/java/org/apache/cxf/headers/Header.java  |   78 -
 .../java/org/apache/cxf/helpers/DOMUtils.java      |  895 --------
 .../patch/java/org/apache/cxf/helpers/IOUtils.java |  428 ----
 .../java/org/apache/cxf/helpers/ServiceUtils.java  |  214 --
 .../AbstractFaultChainInitiatorObserver.java       |  142 --
 .../interceptor/AbstractLoggingInterceptor.java    |  298 ---
 .../cxf/interceptor/AnnotationInterceptors.java    |  151 --
 .../cxf/interceptor/AttachmentInInterceptor.java   |   72 -
 .../cxf/interceptor/ClientOutFaultObserver.java    |   68 -
 .../interceptor/InFaultChainInitiatorObserver.java |   84 -
 .../apache/cxf/interceptor/InterceptorChain.java   |  109 -
 .../org/apache/cxf/interceptor/LoggingMessage.java |  133 --
 .../interceptor/OneWayProcessorInterceptor.java    |  177 --
 .../OutFaultChainInitiatorObserver.java            |   84 -
 .../security/DefaultSecurityContext.java           |  188 --
 .../interceptor/security/JAASLoginInterceptor.java |  233 --
 .../cxf/internal/CXFAPINamespaceHandler.java       |  127 --
 .../apache/cxf/io/CacheAndWriteOutputStream.java   |   96 -
 .../patch/java/org/apache/cxf/io/CachedWriter.java |  665 ------
 .../java/org/apache/cxf/io/ReaderInputStream.java  |  294 ---
 .../apache/cxf/io/WriteOnCloseOutputStream.java    |   46 -
 .../org/apache/cxf/jaxb/FactoryClassGenerator.java |   86 -
 .../java/org/apache/cxf/jaxb/JAXBDataBase.java     |  192 --
 .../java/org/apache/cxf/jaxb/JAXBDataBinding.java  |  873 --------
 .../org/apache/cxf/jaxb/JAXBEncoderDecoder.java    | 1119 ----------
 .../org/apache/cxf/jaxb/JAXBSchemaInitializer.java |  823 --------
 .../org/apache/cxf/jaxb/io/DataReaderImpl.java     |  207 --
 .../java/org/apache/cxf/jaxrs/JAXRSInvoker.java    |  460 ----
 .../apache/cxf/jaxrs/JAXRSServerFactoryBean.java   |  467 ----
 .../apache/cxf/jaxrs/client/ClientProxyImpl.java   | 1149 ----------
 .../cxf/jaxrs/client/JAXRSClientFactory.java       |  414 ----
 .../apache/cxf/jaxrs/client/LocalClientState.java  |  185 --
 .../org/apache/cxf/jaxrs/client/WebClient.java     | 1349 ------------
 .../client/spec/ClientRequestContextImpl.java      |  186 --
 .../JAXRSClientFactoryBeanDefinitionParser.java    |  187 --
 .../cxf/jaxrs/impl/EntityTagHeaderProvider.java    |   77 -
 .../cxf/jaxrs/impl/MediaTypeHeaderProvider.java    |  221 --
 .../org/apache/cxf/jaxrs/impl/RequestImpl.java     |  388 ----
 .../apache/cxf/jaxrs/impl/ResourceContextImpl.java |   67 -
 .../org/apache/cxf/jaxrs/impl/ResponseImpl.java    |  629 ------
 .../impl/tl/ThreadLocalInvocationHandler.java      |   53 -
 .../cxf/jaxrs/interceptor/JAXRSInInterceptor.java  |  274 ---
 .../cxf/jaxrs/interceptor/JAXRSOutInterceptor.java |  498 -----
 .../cxf/jaxrs/model/AbstractResourceInfo.java      |  389 ----
 .../apache/cxf/jaxrs/model/ClassResourceInfo.java  |  366 ----
 .../org/apache/cxf/jaxrs/model/URITemplate.java    |  627 ------
 .../jaxrs/provider/CachingMessageBodyReader.java   |  100 -
 .../jaxrs/provider/CachingMessageBodyWriter.java   |  102 -
 .../cxf/jaxrs/provider/DataSourceProvider.java     |  110 -
 .../cxf/jaxrs/provider/FormEncodingProvider.java   |  228 --
 .../cxf/jaxrs/provider/JAXBElementProvider.java    |  635 ------
 .../cxf/jaxrs/provider/MultipartProvider.java      |  474 -----
 .../apache/cxf/jaxrs/provider/SourceProvider.java  |  236 ---
 .../cxf/jaxrs/provider/XSLTJaxbProvider.java       |  588 ------
 .../jaxrs/security/JAASAuthenticationFilter.java   |  170 --
 .../security/KerberosAuthenticationFilter.java     |  251 ---
 .../jaxrs/servlet/CXFNonSpringJaxrsServlet.java    |  640 ------
 .../JAXRSServerFactoryBeanDefinitionParser.java    |  286 ---
 .../apache/cxf/jaxrs/utils/AnnotationUtils.java    |  308 ---
 .../java/org/apache/cxf/jaxrs/utils/FormUtils.java |  294 ---
 .../java/org/apache/cxf/jaxrs/utils/HttpUtils.java |  733 -------
 .../org/apache/cxf/jaxrs/utils/JAXRSUtils.java     | 2027 ------------------
 .../org/apache/cxf/jaxrs/utils/ResourceUtils.java  | 1044 ---------
 .../java/org/apache/cxf/message/MessageUtils.java  |  261 ---
 .../java/org/apache/cxf/phase/PhaseChainCache.java |  137 --
 .../apache/cxf/phase/PhaseInterceptorChain.java    |  857 --------
 .../cxf/service/factory/FactoryBeanListener.java   |  145 --
 .../apache/cxf/service/invoker/FactoryInvoker.java |   70 -
 .../service/model/AbstractPropertiesHolder.java    |  271 ---
 .../org/apache/cxf/service/model/FaultInfo.java    |   61 -
 .../apache/cxf/service/model/InterfaceInfo.java    |  124 --
 .../apache/cxf/service/model/OperationInfo.java    |  242 ---
 .../cxf/service/model/UnwrappedOperationInfo.java  |   72 -
 .../java/org/apache/cxf/staxutils/StaxUtils.java   | 2222 --------------------
 .../apache/cxf/staxutils/W3CDOMStreamReader.java   |  429 ----
 .../cxf/transport/ChainInitiationObserver.java     |  197 --
 .../transport/http/AbstractHTTPDestination.java    |  956 ---------
 .../cxf/transport/http/CXFAuthenticator.java       |  177 --
 .../org/apache/cxf/transport/http/HTTPConduit.java | 1952 -----------------
 .../cxf/transport/http/HTTPTransportFactory.java   |  297 ---
 .../org/apache/cxf/transport/http/Headers.java     |  583 -----
 .../transport/http/HttpServletRequestSnapshot.java |  277 ---
 .../transport/http/ReferencingAuthenticator.java   |  234 ---
 .../http/Servlet3ContinuationProvider.java         |  281 ---
 .../transport/http/URLConnectionHTTPConduit.java   |  439 ----
 .../transport/https/HttpsURLConnectionFactory.java |  247 ---
 .../servicelist/ServiceListJAASAuthenticator.java  |  160 --
 .../AbstractBeanValidationInterceptor.java         |   65 -
 .../cxf/workqueue/AutomaticWorkQueueImpl.java      |  619 ------
 .../apache/cxf/ws/addressing/MAPAggregator.java    |  224 --
 159 files changed, 51893 deletions(-)


[tomee] 02/03: Test to ensure that a JMS destination does not need to be created for a MDB to work

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

jgallimore pushed a commit to branch tomee-8.x
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 2c07749163b774e73f3f8fd8f531a7f307cc3eb6
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Tue Oct 11 17:18:18 2022 +0100

    Test to ensure that a JMS destination does not need to be created for a MDB to work
---
 .../openejb/activemq/MDBAutoConfigOffTest.java     | 152 +++++++++++++++++++++
 1 file changed, 152 insertions(+)

diff --git a/container/openejb-core/src/test/java/org/apache/openejb/activemq/MDBAutoConfigOffTest.java b/container/openejb-core/src/test/java/org/apache/openejb/activemq/MDBAutoConfigOffTest.java
new file mode 100644
index 0000000000..fb7542afd6
--- /dev/null
+++ b/container/openejb-core/src/test/java/org/apache/openejb/activemq/MDBAutoConfigOffTest.java
@@ -0,0 +1,152 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.openejb.activemq;
+
+import org.apache.activemq.ActiveMQXAConnectionFactory;
+import org.apache.openejb.jee.MessageDrivenBean;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Configuration;
+import org.apache.openejb.testing.Module;
+import org.apache.openejb.testng.PropertiesBuilder;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.annotation.Resource;
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.XAConnectionFactory;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(ApplicationComposer.class)
+public class ActivationContainerOverwriteBothConfigurationTest {
+    private static final String TEXT = "foo";
+
+    @Configuration
+    public Properties config() {
+        return new PropertiesBuilder()
+
+                .p("amq", "new://Resource?type=ActiveMQResourceAdapter")
+                .p("amq.DataSource", "")
+                .p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
+
+                .p("target", "new://Resource?type=Queue")
+
+
+                .p("mdbs", "new://Container?type=MESSAGE")
+                .p("mdbs.ResourceAdapter", "amq")
+                .p("mdb.container.amq.activation.destination","wrongTarget")
+                .p("mdbs.activation.destination", "target")
+                .p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
+                .p("cf.ResourceAdapter", "amq")
+
+                .p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
+                .p("xaCf.BrokerURL", "vm://localhost")
+
+                .build();
+    }
+
+    @Module
+    public MessageDrivenBean jar() {
+        return new MessageDrivenBean(Listener.class);
+    }
+
+    @Resource(name = "target")
+    private Queue destination;
+
+    @Resource(name = "xaCf")
+    private XAConnectionFactory xacf;
+
+    @Resource(name = "cf")
+    private ConnectionFactory cf;
+
+    @Before
+    public void resetLatch() {
+        Listener.reset();
+    }
+
+    @Test
+    public void test() throws Exception {
+        assertNotNull(cf);
+
+
+        final Connection connection = cf.createConnection();
+        testConnection(connection);
+    }
+
+
+    private void testConnection(final Connection connection) throws JMSException, InterruptedException {
+        try {
+            final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            final MessageProducer producer = session.createProducer(destination);
+            producer.send(session.createTextMessage(TEXT));
+            assertTrue(Listener.sync());
+        } finally {
+            try {
+                connection.close();
+            } catch (final JMSException e) {
+                //no-op
+            }
+        }
+    }
+
+    @MessageDriven(activationConfig = {
+            @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+            @ActivationConfigProperty(propertyName = "destination", propertyValue = "toBeOverwrite")
+    })
+    public static class Listener implements MessageListener {
+        public static CountDownLatch latch;
+        public static boolean ok = false;
+
+        @Override
+        public void onMessage(final Message message) {
+            try {
+                try {
+                    ok = TextMessage.class.isInstance(message) && TEXT.equals(TextMessage.class.cast(message).getText());
+                } catch (final JMSException e) {
+                    // no-op
+                }
+            } finally {
+                latch.countDown();
+            }
+        }
+
+        public static void reset() {
+            latch = new CountDownLatch(1);
+            ok = false;
+        }
+
+        public static boolean sync() throws InterruptedException {
+            latch.await(1, TimeUnit.MINUTES);
+            return ok;
+        }
+    }
+}