wood burning stoves 2.0*
The moose likes Java in General and the fly likes How to create a jar file that suits this specification? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "How to create a jar file that suits this specification?" Watch "How to create a jar file that suits this specification?" New topic
Author

How to create a jar file that suits this specification?

Yun Shang
Greenhorn

Joined: Dec 06, 2005
Posts: 2
I am trying to add a customized provider to Axis. In the Axis code, it specifies:

/**
Look for file META-INF/services/org.apache.axis.deployment.wsdd.Provider in all the JARS, get the classes listed in those files and add them to providers list if they are valid providers.

Here is how the scheme would work.

A company providing a new provider will jar up their provider related
classes in a JAR file. The following file containing the name of the new
provider class is also made part of this JAR file.

META-INF/services/org.apache.axis.deployment.wsdd.Provider

By making this JAR part of the webapp, the new provider will be automatically discovered.
*/

So for example, if I have a new Provider called AAAProvider,
I have to put it under the "org.apache.axis.deployment.wsdd.Provider" package, right?

But I don't quite understand the "META-INF/services/" part. Does it means that I put the class file in a dir like the following?

services/org/apache/axis/deployment/wsdd/Provider/AAAProvider

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14193
    
  20

It means this:

1. Create a file named org.apache.axis.deployment.wsdd.Provider (with dots, not a directory tree!).
2. In the file, add one line with the fully qualified class name of your implementation ("org.my.package.AAAProvider", for example).
3. Make sure the file you created in step 1 is in the directory META-INF/services in your JAR file (not in a directory services/org/... as you think!).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Yun Shang
Greenhorn

Joined: Dec 06, 2005
Posts: 2
Thank you, it works!
 
GeeCON Prague 2014
 
subject: How to create a jar file that suits this specification?