cancel
Showing results for 
Search instead for 
Did you mean: 

Export a "FAT" Jar file

Former Member
0 Kudos

Hi all.

I created a new Java project as a DC in NWDS. This project references jars stored in a library DC with in the same SC.

I am trying to export the java project as an executable jar. The jar will export, but when I try running the Jar, main throws an exception. I have tried updating the build path in NWDS with no luck. I am able to get the jar file to run from the command line if I include the class-path to each external jar. I believe the issue is that the external jars from the library DC are not being included in the executable jar.

Does anyone know how to export a fat jar file which includes the external jars?

Thanks

Ryan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Found an answer. You can simply use the eclipse plug in called FAT jar.

Former Member
0 Kudos

Glad you found an answer, the issue you were having sounds similar to mine (using 3rd-party jars for axis / wsdl4j). According to SDN docs, you create an external library to wrap the jars (sounds like you did). In your public parts for the external library DC, you need to create both the COMPILATION and ASSEMBLY public parts (both representing the jars) and grant access to them from your consuming DC. Sounds like you did that too, I certainly did.

In my case, I had:

SC

DC -> extjars

libraries -> contains qname.jar and wsdl4j.jar

extjars_assm_pp -> ASSEMBLY public part ref's both jars

extjars_comp_pp -> COMPILATION public part ref's both jars

DC -> wsdl4jEJB -> references javax stuff in wsdl4j.jar

dependencies -> extjars:extjars_comp_pp

DC -> wsdl4jEAR -> packages the extjars and the wsdl4jEJB

dependencies -> extjars:extjars_assm_pp

...Web Dynpro DC that uses the wsdl4jEAR to import the EJB model...

The trick to making the wrapped jars appear in the compilation command line for the DC deployment of the wsdl4jEAR (from Development Infrastructure perspective) was adding the ASSEMBLY public part reference to the wsdl4jEAR dependenciens. Also, the SAP doco was a bit confusing; on the extjars project the doc states to add the jar files to the public part. Be sure to add the jar files as Archives and not as regular Files (otherwise, the jars aren't added to the buildpath during DC deployment build).

Hope this helps someone else if it doesn't actually pertain to the OP's issue, it would have saved me a bit of digging and debugging...

Edited by: ANDY BRUCE on Jan 28, 2009 5:06 PM