on 12-01-2004 7:52 PM
Hi,
I wonder how to use external JARu00B4s (e.g. the <b>commons-lang.jar</b> of the jakarta commons project) in a Web Dynpro Development Component.
I copied the JAR file into the lib directory of my Dev.component project, added it to the build path and built the project.
At runtime I get a "<b>java.lang.NoClassDefFoundError: org/apache/commons/lang/WordUtils</b>"
When inspecting the generated EAR resp. WDA file I can see that the JAR file is located in /PORTAL-INF/classes directory of the WDA file. It is also extracted to the folder
\usr\sap\...\server0\apps\<vendor>\<compname>\webdynpro\public\classes
This folder is displayed as classes directory in the classloader service of Visual Administrator.
So, why is the class not found at runtime?
Additionally I recognized another curious effect. When using the "development component - build" command from context menu of my dev. component the JAR file is deleted from the build path of my project whereas rebuilding the project works fine.
This is no problem as long as I donu00B4t define public parts for my dev. component. But when defining them they will only be generated and packed into the EAR file if I choose "development component - build" and this is not possible because the external JAR file is not found anymore at the build path.
Thx in advance
Helmut
You can't really use the lib directory since it is intended for local projects.
I described our workaround here
You have 2 options:
1. Add that jar to a library project. Deploy separatedly.
2. Create a DC component-like structure for the new jar by unzipping the jar file and creating an 'Assembly' public part that includes the folder tree of this jar.
Option 1 works best if you have many jars that you want to deploy. But you lose integration into the DTR.
Option 2 archieves the same effect as the lib directory, as you only need to compile your jar once and it gets added into the generated wda correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can import the jar files into your file system in the Navigator perspective. IIRC, the library approach only worked if you create it as a local project, not a DTR DC project.
I personally prefer the second approach as the whole idea of JAR files goes away, I just look at a jar file as another DC project.
Hi Helmut,
did you find out a workaround ? I have the same problem with external JARs.
Regards,
Claus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.