Questions tagged [serviceloader]

ServiceLoader is a Java SDK way to load different providers for a class from the classpath. It uses special configuration files in META-INF/services.

The full documentation is provided by Oracle at http://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html

163 questions
0
votes
1 answer

How to limit Java ServiceLoader to only load service providers defined in test packages

I have an app which uses ServiceLoader. There is one service interface MyFancyService and its implementations: AppClassA, AppClassB and test implementations: TestClassC, TestClassD There is META-INF.services in the app package and another…
0
votes
1 answer

Why I do not see all of the folders in Eclipse package Explorer that I see in File Explorer

I created a Maven modul in Eclipse, and there I have a folder called 'target'. That on I see in package explorer in Eclipse. If I open it there are several folder. If I open it in File Explorer on Windows I see even more folder, e.g. one of them…
Armin Beda
  • 109
  • 9
0
votes
1 answer

Spring Not Creating Proxy For ServiceListFactoryBean Objects

I'm collecting some SPI implementing instances using ServiceFactoryBean and ServiceListFactoryBean and auto-wiring to my service beans. Now I've created some aspects to intercept these classes to measure performance and log invocations. I notice…
elvorin
  • 1
  • 3
0
votes
0 answers

Jetty-9 HTTP/2 in OSGi container. Cannot load a HttpFieldPreEncoder implementation for HTTP/2 over ServiceLoader

recently I'm trying to call a REST-service, published over Apache-CXF. Everything is embedded in an Equinox 3.11.0 with Jetty 9.4.1. Container starts Jetty, configured for HTTP/2: [main] INFO org.eclipse.jetty.server.Server -…
0
votes
1 answer

How to customize where ServiceLoader looks for Plugin Jars

I have a multimodule project with two projects: Core and A. The idea is to launch/ run A whenever Core is launched. How can I customize the ServiceLoader to look up and call the modules in the Plugins folder from core? plugin-Project + Core …
Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142
0
votes
0 answers

Exception 'Provider is not a subtype' when using hibernate-ogm-neo4j in glassfish4

I'm trying to get hibernate-ogm-neo4j (5.1.0.Alpha1) running in my glassfish (4.1.1). When starting the application server with the datastorprovider it shows a long…
Richard
  • 582
  • 5
  • 19
0
votes
2 answers

Java/Maven - Saxon without SeviceLoader override

We are building a common component that is a dependency for multiple other projects. Our project does some XSLT transformations and we need to use the Saxon engine. We have full control over the specific XSLT transformation that must use Saxon, but…
J Barclay
  • 481
  • 2
  • 7
  • 18
0
votes
2 answers

ServiceLoader not finding Plugin

I have a ServiceLoader that tries to load anything that extends Plugin. It is not finding anything, even though I have the service file set up. Source code (com.otabi.firestar.pajamatale.plugin.loader.PluginFinder is the class):…
Aly
  • 847
  • 1
  • 6
  • 30
0
votes
0 answers

Genericity and services in java

My application use ServiceLoader, and I have two types of services : Algorithm and Exporter. The code : public abstract class Algorithm { public abstract E process(); public abstract void askParameters(); } public abstract…
ArkDeus
  • 143
  • 9
0
votes
1 answer

ServiceLoader with maven, when dependency not given in the pom

I have a maven application and I like to use the ServiceLoader mechanism to load plugins. Currently I achieve this by adding the dependency to the pom, so that the dependency jar is in the classpath and the ServiceLoader can pick it up. But how can…
Emerson Cod
  • 1,990
  • 3
  • 21
  • 39
0
votes
2 answers

Subclass obtained from Serviceloader throws AbstractMethodError

I am trying to make a Java app that can load plugins implementing an abstract class and am having an AbstractMethodError with the instances generated from ServiceLoader. The code is a bit heavy so I've made a simplification below. First, I have an…
0
votes
2 answers

Class-Path setting in executable jar doesn't seem to work for plugins

I've looked here and the wider web to find a solution to this. There's related material, but I've been unable to find anything useful about my specific question. I'm working on some Java software that needs to accept plugins. I don't want to use a…
SteveR
  • 31
  • 3
0
votes
0 answers

Classloader issue in tomcat ? (xercesImpl)

I have two applications that I must deploy on the same tomcat (version 7.0.56). Application A uses xerces (have a dependency to xercesimpl.jar). The second application (B) does not have that dependency, but is doing some xml work. When deploying…
baraber
  • 3,296
  • 27
  • 46
0
votes
0 answers

Java: Can't get a working ServiceLoader

I am very new to Java (coming from C# .NET background). Trying to create an "expansion/IoC" style architecture via a combination of Google Guice and ServiceLoader, but can't seem to get the ServiceLoader part working running Java 1.7.0_75 and…
tommed
  • 1,521
  • 2
  • 19
  • 33
0
votes
1 answer

Service Loader config file doesn't explode properly

So I am writing a webapp in Eclipse and I want to use the serviceloader in one of my classes. Question is where to put the META-INF/services stuff. From here (https://stackoverflow.com/a/3421191/2742995) I found: But the ideal way is to have it…
Lucasvw
  • 157
  • 1
  • 9
1 2 3
10
11