cancel
Showing results for 
Search instead for 
Did you mean: 

Build class path ?

Former Member
0 Kudos

Hi,

Is it possible to build class path i.e. updating .classpath file through coding.

Thanks,

RPN

Edited by: RPN on Jan 26, 2009 10:46 AM

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

As previously mentioned, it is not a good idea to change the .classpath during runtime using coding. Although this is technically possible when using plain-jane Java Code.

.classpath is actually a file used by eclipse to maintain classpath variables for the current project or workspace. It is readonly usually. To edit you need to open an IOStream (like FileWriter etc.) to the file in question to rewrite its contents. As mentioned the readonly may interfere unless you remove it manually from the file using windows explorer.

However, if you do use these sorts of projects on a track - then there will be consequences including the .classpath being corrupted inside of the dtr.

All in all - not worth the risk. If you do need the classpath to change - then probably you need to write multiple DCs that will have component usage so that each can run separately.

Most demanding clients will understand that .classpath cannot change at runtime.

Hope that helps.

Thanks.

p256960.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Sorry for late reply...

Thanks a lot for your suggestions.

Is there any other way to invoke EJB in Webdynpro with out adding the EJB jar in the library and in the classpath?

Please provide suggestions...

Thanks,

RPN

0 Kudos

Hi,

Yes. In fact there is.

You must do a few things to add the reference to your Web Dynpro Project.

1.) Add the ejb20 library to "Used DCs" section of WDJ project.

2.) Make public parts (both API and SDA) of your EJB project and add those to "Used DCs" section of WDJ project. Ensure that all the necessary files are part of both public parts.

3.) Add a project reference to WDJ project pointing to the EJB project.

If you do not wish to use the EJB directly then you may also expose the EJB as a web service and add the lookup code in the WDJ project to lookup the EJB at runtime. This will be a better use of the MVC arch. and will decouple your WDJ and EJB projects in an acceptable manner.

Hope that helps.

p256960.

former_member192434
Active Contributor
0 Kudos

Hi

I don't think so, we can update .class path file using any sort of coding....

the class file gets updated when you build/save any changes into java file of your project... if the class file not getting upadated then you can remove class file manually and whenever you rebuild/save your application class file gets created with upadated chages.

thanks

sanyev
Active Participant
0 Kudos

Hi RPN,

.classpath files are created and managed by the IDE. It is not a good idea to change it manually or through code. The changes might get overwritten when you work with the IDE.

Regards,

Sanyev