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 make Java serviceLoader of a external library work

I'm working on a plugin for a 3rd party software that is quite undocumented. For the plugin I'm using a external lib (.jar) managed by maven and is later on executed on a tomcat server. Everything was working great till I updated to the latest…
omni
  • 4,104
  • 8
  • 48
  • 67
0
votes
1 answer

How to create a composite that uses components from a provider where it should itself be added to?

The title maybe a bit complicated but I didn't see any other way of verbalizing my problem. I'm working on a project where certain components are initialized by loading several files and transforming them into Java components, others are loaded by a…
ckuepker
  • 442
  • 1
  • 6
  • 18
0
votes
1 answer

Problems using image resources of plug in jars

I am currently working on an app that supports plug ins. The plug ins are located in a root folder called modules as jar files. My main application loads all the jars located in the modules folder using the java service loader Application src …
MykelXIII
  • 1,085
  • 1
  • 8
  • 16
0
votes
1 answer

Service loader in java loading modules but can display loaded views properly

So my application has a main project that loads all classes that implement IModule. Each Module has a view that extends AbstractView. Here is the sample code public abstract class AbstractView extends JPanel{ //Init panel } public Module…
MykelXIII
  • 1,085
  • 1
  • 8
  • 16
0
votes
0 answers

Neo4J without ServiceLoader

I have been using Neo4J 1.8.x as an embedded database in an application framework that breaks the regular ServiceLoader used by Neo4j. So far, I've worked around this issue by using the OSGi instructions for Neo4j. This has worked great. However,…
Thomas
  • 101
  • 1
  • 3
0
votes
1 answer

ServiceLoader usage in Axis2 web service code deployed on Tomcat web server

I have an .aar file deployed on Tomcat,Axis2 platform in Ubuntu. I'm using Oracle JDK1.7 Tomcat 7.0.35 and Axis2 1.6.2 Recently I made a refactoring to use java.util.ServiceLoader class to load implementations of some classes dynamically. Here is my…
0
votes
1 answer

Java Applet and ServiceLoader

Java Applet doesn't load service classes from someJar.jar!/META-INF/services/ by default causing NoClassDefFoundError exception. How to make it work?
Evgeny
  • 51
  • 5
0
votes
1 answer

Multiple Classes with same FQN (ServiceLoader)

I am using java.util.ServiceLoader to create a lightweight plugin framework. I am currently wrestling with how to have multiple implementing classes with the same FQN. I would like to have two copies of the same plugin on the classpath and have…
mainstringargs
  • 13,563
  • 35
  • 109
  • 174
0
votes
1 answer

How to include a custom text file into the build process

Recently i have been playing around with writing plugins which i then load using a ServiceLoader. In order for the ServiceLoader to find my Plugins, there has to be a text file included in my jar under META-INF/services/. The text file has to be…
thousands
  • 75
  • 3
0
votes
1 answer

JBoss 7 ServiceLoader

There is an intefrace MyIntefrace. System has several EARs, each with own implementations of that intefrace. I need to find all implementations without their names (? extends MyInterface). I decided to use java.util.ServiceLoader and created a jar…
Vladimir Kishlaly
  • 1,872
  • 1
  • 16
  • 26
0
votes
1 answer

Dynamic library loading with pre and post check using ServiceLoader

This question is next step in solving of attach library dynamic loading problem. I have some like this: public static void loadAttachProvider(String binPath) throws Exception { /* * If AttachProvider is already available now then propably…
kbec
  • 3,415
  • 3
  • 27
  • 42
-1
votes
1 answer

java.util.ServiceLoader.load() function is useless and only returns empty result

I'm trying to use Java ServiceLoader in Scala 2.10 to find all my test classes by reflection: val services = ServiceLoader.load(classOf[MyClass]) for (service <- services.asScala) { test(service.getClass.getCanonicalName) { …
tribbloid
  • 4,026
  • 14
  • 64
  • 103
-3
votes
1 answer

ServiceConfigurationError: not a subtype

I have been working on a quite complex project for a while. It involves 2 Modules, net.lightbluefoxlabs.dev.multirealm.core.multirealmcore and net.lbflabs.dev.realms.survivalrealm, where the first has an abstract class which in itself is derived…
Jakob Tinhofer
  • 313
  • 3
  • 16
1 2 3
10
11