cancel
Showing results for 
Search instead for 
Did you mean: 

Subdirectory for JAR for Custom Action Block

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello all,

For Tim’s question, I don’t know, but I guess both client side and Xacute engine.

For Sam’s question, I don’t 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 didn’t 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 doesn’t 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, let’s 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 doesn’t 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

Former Member
0 Kudos

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

Former Member
0 Kudos

Yeah, but I created a folder under WEB-INF/lib/subdir and put my dependent jars in it and reference them like you stated Class-Path: subdir/dep1.jar subdir/dep2.jar and it doesn't work.

Tim