You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2016/08/25 17:55:42 UTC
[1/2] cxf git commit: Don't log the warning about the jmx stuff if
the start method isn't there. Its not there on recent jetty
Repository: cxf
Updated Branches:
refs/heads/master a5f53af77 -> ce9332b71
Don't log the warning about the jmx stuff if the start method isn't there. Its not there on recent jetty
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/65b0f60d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/65b0f60d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/65b0f60d
Branch: refs/heads/master
Commit: 65b0f60d75ae3b25f5a4ecd8a7b10874161ae31d
Parents: a5f53af
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Aug 25 13:54:46 2016 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Aug 25 13:54:46 2016 -0400
----------------------------------------------------------------------
.../transport/http_jetty/JettyHTTPServerEngineFactory.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/65b0f60d/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
index 4e0d91e..bd468a6 100644
--- a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
+++ b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
@@ -338,8 +338,11 @@ public class JettyHTTPServerEngineFactory {
mBeanContainer = (Container.Listener) cls.
getConstructor(MBeanServer.class).newInstance(mbs);
-
- cls.getMethod("start", (Class<?>[]) null).invoke(mBeanContainer, (Object[]) null);
+ try {
+ cls.getMethod("start", (Class<?>[]) null).invoke(mBeanContainer, (Object[]) null);
+ } catch (NoSuchMethodException mex) {
+ //ignore, Jetty 9.1 removed this methods and it's not needed anymore
+ }
} catch (Throwable ex) {
//ignore - just won't instrument jetty. Probably don't have the
//jetty-management jar available
[2/2] cxf git commit: Check other locations for the FaultMode
Posted by dk...@apache.org.
Check other locations for the FaultMode
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ce9332b7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ce9332b7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ce9332b7
Branch: refs/heads/master
Commit: ce9332b717be75e4500d1456a926b6cc468d3c0c
Parents: 65b0f60
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Aug 25 13:55:09 2016 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Aug 25 13:55:09 2016 -0400
----------------------------------------------------------------------
.../codahale/CodahaleMetricsContext.java | 6 ++++++
systests/jaxws/pom.xml | 9 +++++++++
.../cxf/systest/jaxws/ClientServerMiscTest.java | 7 +++++++
.../DocLitWrappedCodeFirstServiceImpl.java | 3 +++
.../apache/cxf/systest/jaxws/ServerMisc.java | 21 ++++++++++++++++++++
5 files changed, 46 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/ce9332b7/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
index 9670b55..27dbc80 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
@@ -89,6 +89,12 @@ public class CodahaleMetricsContext implements MetricsContext, Closeable {
outgoingData.mark(outSize);
}
FaultMode fm = ex.get(FaultMode.class);
+ if (fm == null && ex.getOutFaultMessage() != null) {
+ fm = ex.getOutFaultMessage().get(FaultMode.class);
+ }
+ if (fm == null && ex.getInMessage() != null) {
+ fm = ex.getInMessage().get(FaultMode.class);
+ }
if (fm != null) {
switch (fm) {
case CHECKED_APPLICATION_FAULT:
http://git-wip-us.apache.org/repos/asf/cxf/blob/ce9332b7/systests/jaxws/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jaxws/pom.xml b/systests/jaxws/pom.xml
index f8e17a3..9806ee4 100644
--- a/systests/jaxws/pom.xml
+++ b/systests/jaxws/pom.xml
@@ -139,6 +139,15 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-features-metrics</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.dropwizard.metrics</groupId>
+ <artifactId>metrics-core</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-server</artifactId>
<version>${cxf.jetty9.version}</version>
http://git-wip-us.apache.org/repos/asf/cxf/blob/ce9332b7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
index 0ae5a02..0635b73 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
@@ -39,6 +39,7 @@ import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Holder;
import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.soap.SOAPFaultException;
import javax.xml.xpath.XPathConstants;
@@ -622,6 +623,12 @@ public class ClientServerMiscTest extends AbstractBusClientServerTestBase {
}
try {
+ port.throwException(-4);
+ fail("Expected exception not found");
+ } catch (WebServiceException ex) {
+ assertEquals("RuntimeException!!", ex.getMessage());
+ }
+ try {
Foo foo = new Foo();
foo.setNameIgnore("DoNoName");
port.modifyFoo(foo);
http://git-wip-us.apache.org/repos/asf/cxf/blob/ce9332b7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
index 7d195e2..344e679 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
@@ -190,6 +190,9 @@ public class DocLitWrappedCodeFirstServiceImpl implements DocLitWrappedCodeFirst
ex.setInts(new int[] {1, 2, 3});
throw ex;
}
+ case -4: {
+ throw new RuntimeException("RuntimeException!!");
+ }
default:
throw new ServiceTestFault(new ServiceTestFault.ServiceTestDetails(i));
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/ce9332b7/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
index d3b62ed..597abfe 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
@@ -19,17 +19,26 @@
package org.apache.cxf.systest.jaxws;
+import java.util.Arrays;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import javax.xml.ws.Endpoint;
+import com.codahale.metrics.MetricRegistry;
+
+import org.apache.cxf.Bus;
import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeImpl;
import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
+import org.apache.cxf.bus.CXFBusFactory;
import org.apache.cxf.jaxb_element_test.JaxbElementTestImpl;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.jaxws.JAXWSMethodInvoker;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.metrics.MetricsFeature;
+import org.apache.cxf.metrics.codahale.CodahaleMetricsProvider;
import org.apache.cxf.ordered_param_holder.OrderedParamHolderImpl;
import org.apache.cxf.service.invoker.Factory;
import org.apache.cxf.service.invoker.PerRequestFactory;
@@ -80,9 +89,21 @@ public class ServerMisc extends AbstractBusTestServerBase {
JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(factory);
JaxWsServerFactoryBean factoryBean;
+ Map<String, Object> properties = new HashMap<>();
+ properties.put("bus.jmx.usePlatformMBeanServer", Boolean.TRUE);
+ properties.put("bus.jmx.enabled", Boolean.TRUE);
+ Bus b = new CXFBusFactory().createBus(null, properties);
+ setBus(b);
+ MetricRegistry registry = new MetricRegistry();
+ CodahaleMetricsProvider.setupJMXReporter(b, registry);
+ b.setExtension(registry, MetricRegistry.class);
+
+
factoryBean = new JaxWsServerFactoryBean();
+ factoryBean.setBus(b);
factoryBean.setAddress(DOCLIT_CODEFIRST_URL);
factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class);
+ factoryBean.setFeatures(Arrays.asList(new MetricsFeature()));
factoryBean.setInvoker(invoker);
servers.add(factoryBean.create());