on 01-15-2008 10:45 PM
I am creating a Custom Action Block application. Everything works fine. In the XML file under the Lighthammer\Xacute\Components directory, I have the correct JAR file for "AssemblyName" (MyJar.jar). However, that manifest.mf file inside the MyJar.jar reference to other JARs. Currently,I have those JAR files under the same directory as the MyJar.jar (Lighthammer\WEB-INF\lib and Lighthammer\CMSLogicEditor). I am just wondering if I can create a folder and put all those other JARs inside and modify the manifest.mf and still make it work. In the manifest.mf file, I have
Class-Path: a.jar b.jar c.jar
and I have tried
Class-Path: ./subfolder/a.jar ./subfolder/b.jar ./subfolder/c.jar
Class-Path: /subfolder/a.jar /subfolder/b.jar /subfolder/c.jar
but it doesn't work. Does anyone knows the correct Class-Path in order to make it to work or those JARs just can't be put in a subfolder but the out most directories (Lighthammer\WEB-INF\lib and Lighthammer\CMSLogicEditor).
Thank you.
Tim,
Do you have the dependent jars specified in the action component XML?
<?xml version="1.0" encoding="utf-8"?>
<ComponentCatalog>
<Category Name="Name" Description="Desc">
<Component Type="Action" Name="ActionName" Description="" Label="ActionLabel" ClassName="com.company.xmii.custom.actions.classname" AssemblyName="My.jar" Dependencies="dependent1.jar,dependent2.jar" HelpFileName="" />
</Category>
</ComponentCatalog>
Hope this helps.
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For more information see [this Web Start FAQ entry|http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html#209] and the one a couple answers further down.
-tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tim, you didn't indicate whether you're trying to get this custom action block working on the client side (in the BLE) or the Xacute engine or both. On the client side, you're pretty much out of luck since the CLASSPATH is defined by the JNLP file which you have no access to. There's no requirement by the Java Classloader to load jars referenced by a jar's manifest.
On the server side, you could stick jars in the WEB-INF/lib folder and they'll be loaded into the web-app's CLASSPATH - there's no need to reference them in your jar manifest. But I'm fairly certain adding jars WEB-INF/lib would be frowned upon by SAP.
-tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello all,
For Tims question, I dont know, but I guess both client side and Xacute engine.
For Sams question, I dont have the dependent jars specified in the action component XML (should the jars be classified as dependent?)
For my case, I already have it working. But I guess I didnt present my question clearly and created much confusion. I apologize for that. So please allow me to restate my question.
I did put all my jars (a.jar b.jar c.jar) under WEB-INF/lib folder and reference them in the Class-Path in the manifest.mf file inside My.jar. It is working perfectly. But I am just wondering in I can put my jars (a.jar b.jar c.jar) in a subfolder and change the path in Class-Path and still make it work. The reason is that there is a decent amount of jars that I include in the Class-Path, and my team doesnt want to put all the jars under WEB-INF/lib and mix them up (sort of unorganized).
I guess to make it simpler, go under WEB-INF/lib. If you look inside the manifest.mf file inside xalan.jar, you will see that there is a line Class-Path: xercesImpl.jar xml-apis.jar . That line enables xalan.jar to load the other 2 jars when it got executed. I am wondering if you can create a subfolder under WEB-INF/lib, lets say myDir, change the Class-Path: to something like Class-Path: myDir\xercesImpl.jar myDir\xml-apis.jar and still have it working properly (I tried the above method and it apparently doesnt work). Or include those a.jar b.jar c.jar inside My.jar and maybe change the Class-Path or other methods. If you happen to know any similar method that would make it more organize (as in not mixing them up with the original jars under WEB-LIF/lib), please let me know.
I hope I did make a better job of clarifying my question, thank you.
Tim
Edited by: Tim Koo on Jan 21, 2008 5:09 PM
Tim, the manifest Class-path URIs are relative to the jar itself, so to load your dependent jars from a subdirectory it should be specified as:
Class-Path: subdir/dep1.jar subdir/dep2.jar
And remember that lines in the manifest cannot be longer than 72 characters and there must be a blank line at the end of the manifest.
-tim
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.