All jars for a service do not have to be nested.  Note that your STAF Java 
service is accessing classes in an external jar file, the JSTAF.jar file.

You can have a STAF Java service access external classes if you put the 
external jar file in the classpath.  For example, when registering the 
service specify

service MyService library JSTAF execute C:/myService/myService.jar \
        OPTION J2=-cp 
C:/myService/myUtils.jar{STAF/Config/Sep/Path}{STAF/Env/CLASSPATH}

There's an example of this in section "4.4.2 JSTAF service proxy library" 
in the STAF User's Guide.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




clayton neal <clayton_n...@yahoo.co.uk> 
06/17/2009 11:01 AM

To
Sharon Lucas/Austin/i...@ibmus
cc
staf-users@lists.sourceforge.net
Subject
Re: [staf-users] external jar files






So all jar's for the service have to be nested?
They cannot be external ?

I mean i have:

myService.jar
myUtils.jar

and inside the manifest for myService.jar i have:

Class-Path: myUtils.jar

wont work with your class loader?

Cheers


From: Sharon Lucas <luc...@us.ibm.com>
To: clayton neal <clayton_n...@yahoo.co.uk>
Cc: staf-users@lists.sourceforge.net
Sent: Wednesday, 17 June, 2009 16:49:43
Subject: Re: [staf-users] external jar files


See sub-section "How to Package Nested Jar Files" in section "5.2 Building 
a Java STAF Service" at 
http://staf.sourceforge.net/current/stafsdg.html#Header_Building_Java_Service
.  If you are still having a problem after following these instructions, 
provide the output from:  jar tf YourSTAFService.jar 

How to Package Nested Jar Files 
You can also package nested jar files within your service's jar file. If 
your service requires additional jar files, rather than having your 
service users download the jar file and add it to the CLASSPATH, you can 
nest the additional jar files within your service's jar file. 
To include nested jar files, you must have the following entry in the 
service's MANIFEST.MF file: 
Packaged-Jars: <list of space-separated jar file names, without the .jar 
suffix> 
Here is an example of nesting xercesImpl.jar, xmlParserAPIs.jar, and 
jython.jar: 
Packaged-Jars: xercesImpl xmlParserAPIs jython 
Note that the nested jar files must reside in the STAF-INF/jars directory 
when creating the service jar file. For the example shown above, the 
service jar file would contain the following: 
STAF-INF/jars/
STAF-INF/jars/xercesImpl.jar
STAF-INF/jars/xmlParserAPIs.jar
STAF-INF/jars/jython.jar 
When you register your service with STAF, the embedded jar files should be 
located in: 
{STAF/DataDir}/lang/java/service/<service-name>/jars

Note that you do not need to include the nested jar files in the 
CLASSPATH. STAF's class loader will be able to find the classes contained 
within the jar files. 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313



clayton neal <clayton_n...@yahoo.co.uk> 
06/17/2009 10:28 AM 


To
staf-users@lists.sourceforge.net 
cc

Subject
[staf-users] external jar files








Hiya

Ive written a new service in Java and packaged into a .jar file
My service needs to connect to oracle so also needs the oracle jdbc jar 
file

On the test machine ive placed both .jar files into the same directory
In the maifest for the service i put:

Class-Path: ojdbc6.jar

to point to oracle .jar file.

The problem is when i add my service, i get an exception, saying it cant 
find the oracle classes

Can anyone help?!

Cheers


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects_______________________________________________

staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to