cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Apache Struts under JDI

Former Member
0 Kudos

Hi there,

I would like to develop a web-application based on the framework "Apache Struts". I am using JDI with the following structure:

- MyApplication

|-> DC: ear_project

|-> DC: web_project

This web_project will be used for the struts application. The whole web-content and the servlets will be developed here. The web_project will be transported onto the server by the ear_project.

Now my problem: When I put the struts-libraries (several .jar-files) into the project and add them to the Java-Build-Path (-> add external jars), everything works fine. I get the references to the libraries. When I want to build the web_project and deploy it onto the server, then all added libraries are missing. I copied them into an additional folder under WEB-INF.

Does anyone know how to reference these libraries? How can I use Struts with JDI?

Regards,

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I'm not sure if this will help as I'm only guessing but...

Have you tried creating a Library DC containing all the required struts .jar files and referencing this DC in your other two DC's. Then when you deploy all three DC's to the server it might work?!

Good luck,

Gareth Ryan.

Former Member
0 Kudos

Hi Gareth,

what type of DC should I use?

- Java-Project

- J2EE-Server -> Library

- ...

Your suggestion sounds really good. This could work.

Best Regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

It's an external library DC. Have a look here - /people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro - for more info.

Hope this helps,

Gareth.

Former Member
0 Kudos

Hi Gareth,

I tried to deploy the jars as described in the link you suggested. Everything works fine until the last step: When I want to build the "J2EE - Server library", I get the following errors:


- The project was not built due to classpath errors (incomplete or involved in cycle). DTR_CFP22SP0_D~cfp~conv_jar~technidata.de		

- Missing required Java project: DTR_CFP22SP0_D~cfp~conv_libs~technidata.de.	DTR_CFP22SP0_D~cfp~conv_jar~technidata.de		Build path

DC DTR_CFP22SP0_Dcfpconv_jar~technidata.de is the deployable project "J2EE - Server library"

DC DTR_CFP22SP0_Dcfpconv_libs~technidata.de is the "external library" project containing the struts-archive.

After pressing the "Build" button, the SDA file does not contain the jars, but they are visible under "gen - default - public- defLib - lib - java".

Do you have some ideas to solve this?

Best Regards,

Thomas

former_member182372
Active Contributor
0 Kudos

Hi Thomas,

Did you add public part from DTR_CFP22SP0_Dcfpconv_jartechnidata.de (ExternalLibs I guess, as in Valery`s blog) DC to DTR_CFP22SP0_Dcfpconv_libstechnidata.de as descibed on step "Add used DC (External Library) to J2EE library". Did you build DTR_CFP22SP0_Dcfpconv_libs~technidata.de as DC (Development component - build)?

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim,

thanks for your answer. I did every step as described in the blog. I built the DTR_CFP22SP0_Dcfpconv_libstechnidata.de and after that I synced the sources (DCs) in the DTR_CFP22SP0_Dcfpconv_jartechnidata.de. Then I wanted to build the DTR_CFP22SP0_Dcfpconv_jar~technidata.de. Then the errors (build path) occures.

Best regards,

Thomas

former_member182372
Active Contributor
0 Kudos

Hi Thomas,

Just build DTR_CFP22SP0_Dcfpconv_libstechnidata.de. As DTR_CFP22SP0_Dcfpconv_libstechnidata.de contains link to public part of DTR_CFP22SP0_Dcfpconv_jar~technidata.de it should resolve dependencies and you don`t need to do anything manually.

BTW, did you add jar file from DTR_CFP22SP0_Dcfpconv_jartechnidata.de to build path of DTR_CFP22SP0_Dcfpconv_libstechnidata.de directly? Or only through public part?

Best regards, Maksim Rashchynski.

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Hi Thomas,

Just repeated scenario on my local NWDS:

1) crate web DC

2) manually create lib folder under WEB-INF

3) copy couple of jar files to this new created folder

4) add jars as external libraries

5) "development component"->build

After build

comp\gen\default\public\war\lib\java\<DCNAME>.war contains jars under WEB-INF\lib

Are you doing the same?

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim,

you are right, I did the same. The .war contains all libraries but after "development component" -> build, I get compile errors "The import org.ápache.struts cannot be resolved". I think NWDS modifies the java-build-path after building the DC.

Best Regards,

Thomas