Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Jersey from 1.19.4 to 2.32 #72

Merged
merged 5 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.40.6
Update to killbill-oss-parent 0.144.46 (Jersey 2.x)

0.40.5
Update to killbill-oss-parent 0.144.40

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-oss-parent</artifactId>
<version>0.144.40</version>
<version>0.144.46</version>
</parent>
<artifactId>killbill-platform</artifactId>
<version>0.40.6-SNAPSHOT</version>
Expand Down
31 changes: 13 additions & 18 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dmurph</groupId>
Expand All @@ -63,12 +61,10 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<!-- Needed by jmxutils -->
Expand All @@ -79,7 +75,6 @@
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.izettle</groupId>
Expand Down Expand Up @@ -141,11 +136,6 @@
<artifactId>metrics-guice</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-guice</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
Expand Down Expand Up @@ -174,7 +164,6 @@
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-logback</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
Expand All @@ -196,6 +185,11 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>ST4</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>stringtemplate</artifactId>
Expand Down Expand Up @@ -406,20 +400,21 @@
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
</dependencies>
<configuration>
<webAppSourceDirectory>${basedir}/src/main/webapp</webAppSourceDirectory>
<systemProperties>
<systemProperty>
<name>logback.configurationFile</name>
<value>file:${basedir}/src/main/webapp/logback.xml</value>
</systemProperty>
<systemProperty>
<name>org.killbill.dao.seedFile</name>
<value>file:${basedir}/src/main/resources/org/killbill/billing/server/ddl.sql</value>
</systemProperty>
<systemProperty>
<name>org.killbill.server.updateCheck.skip</name>
<value>true</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class KillbillHealthcheck extends HealthCheck {
private Set<ServiceRegistry> serviceRegistries = Collections.emptySet();

@Inject(optional=true)
public void setServiceRegistries(Set<ServiceRegistry> serviceRegistries) {
public void setServiceRegistries(final Set<ServiceRegistry> serviceRegistries) {
this.serviceRegistries = serviceRegistries;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.killbill.billing.server.healthchecks;

import javax.inject.Inject;
import javax.inject.Singleton;

import org.killbill.billing.osgi.api.Healthcheck;
Expand All @@ -29,16 +28,17 @@
import org.slf4j.LoggerFactory;

import com.codahale.metrics.health.HealthCheck;
import com.google.inject.Inject;

@Singleton
public class KillbillPluginsHealthcheck extends HealthCheck {

private static final Logger logger = LoggerFactory.getLogger(KillbillPluginsHealthcheck.class);

private final OSGIServiceRegistration<Healthcheck> pluginHealthchecks;
private OSGIServiceRegistration<Healthcheck> pluginHealthchecks = null;

@Inject
public KillbillPluginsHealthcheck(final OSGIServiceRegistration<Healthcheck> pluginHealthchecks) {
@Inject(optional = true)
public void setPluginHealthchecks(final OSGIServiceRegistration<Healthcheck> pluginHealthchecks) {
this.pluginHealthchecks = pluginHealthchecks;
}

Expand All @@ -47,14 +47,16 @@ public Result check() {
final ResultBuilder resultBuilder = Result.builder();

boolean isHealthy = true;
for (final String pluginHealthcheckService : pluginHealthchecks.getAllServices()) {
final Healthcheck pluginHealthcheck = pluginHealthchecks.getServiceForName(pluginHealthcheckService);
if (pluginHealthcheck == null) {
continue;
if (pluginHealthchecks != null) {
for (final String pluginHealthcheckService : pluginHealthchecks.getAllServices()) {
final Healthcheck pluginHealthcheck = pluginHealthchecks.getServiceForName(pluginHealthcheckService);
if (pluginHealthcheck == null) {
continue;
}
final HealthStatus pluginStatus = pluginHealthcheck.getHealthStatus(null, null);
resultBuilder.withDetail(pluginHealthcheckService, pluginStatus.getDetails());
isHealthy = isHealthy && pluginStatus.isHealthy();
}
final HealthStatus pluginStatus = pluginHealthcheck.getHealthStatus(null, null);
resultBuilder.withDetail(pluginHealthcheckService, pluginStatus.getDetails());
isHealthy = isHealthy && pluginStatus.isHealthy();
}

return isHealthy ? resultBuilder.healthy().build() : resultBuilder.unhealthy().build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.killbill.commons.skeleton.listeners.GuiceServletContextListener;
import org.killbill.commons.skeleton.modules.BaseServerModuleBuilder;
import org.killbill.commons.skeleton.modules.JMXModule;
import org.killbill.commons.skeleton.modules.JaxrsJacksonModule;
import org.killbill.commons.skeleton.modules.StatsModule;
import org.killbill.notificationq.api.NotificationQueueService;
import org.skife.config.ConfigSource;
Expand Down Expand Up @@ -174,7 +173,6 @@ protected void initializeGuice(final ServletContextEvent event) {
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);

guiceModules = ImmutableList.<Module>of(getServletModule(),
getJacksonModule(),
new JMXModule(KillbillHealthcheck.class, KillbillQueuesHealthcheck.class, NotificationQueueService.class, PersistentBus.class),
new StatsModule(METRICS_SERVLETS_PATHS.get(0),
METRICS_SERVLETS_PATHS.get(1),
Expand Down Expand Up @@ -209,13 +207,6 @@ protected Module getModule(final ServletContext servletContext) {
return new KillbillPlatformModule(servletContext, config, configSource);
}

protected JaxrsJacksonModule getJacksonModule() {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
return new JaxrsJacksonModule(objectMapper);
}

protected void initializeMetrics(final ServletContextEvent event) {
final MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
final MetricRegistry metricRegistry = injector.getInstance(MetricRegistry.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@

package org.killbill.billing.server.modules;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.sql.SQLException;

Expand Down Expand Up @@ -78,7 +81,15 @@ protected void initializeEmbeddedDB(final EmbeddedDB embeddedDB) throws IOExcept
}

for (final String ddlFile : getDDLFiles()) {
final URL resource = Resources.getResource(ddlFile);
final URL resource;
try {
final URI uri = new URI(ddlFile);
final String scheme = uri.getScheme();
resource = scheme == null ? Resources.getResource(ddlFile) : new File(uri.getSchemeSpecificPart()).toURI().toURL();
} catch (final URISyntaxException e) {
throw new IllegalStateException(e);
}

final InputStream inputStream = resource.openStream();
try {
final String ddl = streamToString(inputStream);
Expand All @@ -91,7 +102,8 @@ protected void initializeEmbeddedDB(final EmbeddedDB embeddedDB) throws IOExcept
}

protected Iterable<String> getDDLFiles() {
return ImmutableList.<String>of("org/killbill/billing/server/ddl.sql");
final String seedFile = System.getProperty("org.killbill.dao.seedFile");
return seedFile == null ? ImmutableList.<String>of() : ImmutableList.<String>of(seedFile);
}

protected String streamToString(final InputStream inputStream) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@

import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.jdbi.InstrumentedTimingCollector;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.joda.JodaModule;
import com.google.inject.Injector;
import com.google.inject.Provider;
import com.google.inject.Provides;
Expand Down Expand Up @@ -78,6 +81,7 @@ public KillbillPlatformModule(final ServletContext servletContext, final Killbil

@Override
protected void configure() {
configureJackson();
configureClock();
configureDao();
configureConfig();
Expand All @@ -89,6 +93,13 @@ protected void configure() {
configureJNDI();
}

protected void configureJackson() {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
bind(ObjectMapper.class).toInstance(objectMapper);
}

protected void configureClock() {
if (serverConfig.isTestModeEnabled()) {
if (serverConfig.isRedisClockEnabled()) {
Expand Down
1 change: 0 additions & 1 deletion server/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li><a href="http://groups.google.com/group/killbilling-users" target="_blank">User Mailing-List</a></li>
<li><a href="http://groups.google.com/group/killbilling-dev" target="_blank">Dev Mailing-List</a></li>
</ul>
</div>
</div>
Expand Down