cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Java Project from Webdynpro Project

Former Member
0 Kudos

How can I call Java code of a Java project from my Webdynpro project.

After I add the java project in java build path and project preferences,the design time error vanishes but it fails at runtime saying "Class Not Found".

The class is there in the java project and I can navigate to it from webdynpro project during design time.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anurag,

Did you able to solve the problem?

If yes, then please close the thread.

Regards,

Bhavik

Answers (2)

Answers (2)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Anurag,

try out the following instructions:

1) Put your Java utility classes in another Web Dynpro DC/Project. This Web Dynpro Project does not contain any application or component but only JAR Files under the /lib folder. These JAR-files are deployed with the embedding Web Dynpro Project. The classloader will load them at runtime.

2.) The Web Dnypro applications (Web Dnypro projects), which want to access these JARS, must declare a "SharingReference" to the other Web Dynpro Project/DC. For local Web Dynpro projects this is done via the context menue item WD project node -> Properties -> Web Dynpro References. For Web Dynpro DC a DC-Usage relation should be sufficient.

Also look at the Web Dynpro help page http://help.sap.com/saphelp_nw04/helpdata/en/5b/a0480cb4a14747b60cf4d6b23c0a44/frameset.htm

Regards, Bertram

Former Member
0 Kudos

Hi

u can create a folder in Src -> Packages and add the Java File and u can use it

Go to your Package explorer and in the Src folder of your project create another folder and add the Java File and u can use it in the WebDynpro Project giving the Path in the import statments

Former Member
0 Kudos

No I cannot do that ,since I have to access a web service proxy .

Former Member
0 Kudos

Hi Anurag,

You can do one thing. Goto nevigatore tab and there choose your webdynpro application.

Under this you find one lib folder. right click it and choose import.

Now import your JAVA project's jar file.

Now rebuild your project and deploy on server.

It will work. Let me know.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

Even this did not work.

Has it worked for you ?

Or have u ever been able to access a java project from webdynpro project?

Former Member
0 Kudos

Hi,

If your requirement is to access the java file from your webdynpro you can access it by creating a jar file and adding it in the build path.

Or you can even import the file to the src->package and directly access it your webdynpro project

Former Member
0 Kudos

Kareem,

Strangely this has not worked.

That is what we are troubled with.

Former Member
0 Kudos

try including both the .java and .class file of the jva classes you need to include in the jar file

Former Member
0 Kudos

Hi Anurag,

Yes its works for me.

How did you add that jar file in lib folder?

Manualy or from the navigator tab and using import facility?

Don't do that manualy copy and paste jar file in lib folder.

What excat steps you have done?

Let me know.

Regards,

Bhavik