jQuery in Action, 2nd edition*
The moose likes Java in General and the fly likes ServiceLoader API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "ServiceLoader API" Watch "ServiceLoader API" New topic
Author

ServiceLoader API

Dominik Müller
Ranch Hand

Joined: Apr 28, 2009
Posts: 36
Hi together,

try to build up a little application with a small plugin-concept (not enough for osgi etc.). so i use the ServiceLoad API.

In eclipse i set up a project and add 2 implementations of the services (with the needed Interface-Implementation and META-INF/Service/file) to the projects lib folder and the classpath.
TestCoding like this:



Worked fine in eclipse.

Than i build up an jar of theses files, and update the manifest file to set the correct classpath:


the programm still works, even if code some references to the load-method above (so: the classpath is set correct) But the ServiceLoader didn't recognize an Service?

Is there any Problem for the ServiceLoader to recognize Service-Implementations from the packed jar?

Hope somebody can help.
Thanks a lot
Dom
 
Don't get me started about those stupid light bulbs.
 
subject: ServiceLoader API
 
Similar Threads
Problem about running jar file from netbean dist directory
Executable jar problem
Problem with Ant using JUnit
Problem with Eclipse and the servicegen task of weblogic
Ant ftp task creating problem