cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove the errors in code in NWDS

Former Member
0 Kudos

Hi Friends,

I have fallowed a document and made required changes, but i am getting below errors in my code:

and the error is as below:

Please help me how to get rid of this errors i have no idea on Java and NWDS as well, please help me out.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Firstly, if you are new to Web Dynpro, Java & NWDS, I'd suggest you try reading SAP Help and completing tutorials before diving in to changing code.

To help understand what has happened here, Web Dynpro Java is made up of lots of generated files that are "hidden" from you as a developer - you only really edit a restricted number of the Java files where you add your own custom logic but there are lots of others within the structure of your WD project DC that are generated based on things like your context, model usages, etc.

When you change a context for example and save the changes, NWDS should re-generate all of the files it needs (switch to the Resource perspective and check out the contents in folder gen_wdp for instance to see some of the files.)

As Rahul has said, the best way to fix this is to perform a Repair followed by a Rebuild - this should force NWDS to re-generate any missing/incorrect files and then you should just be left with only errors of your own creation.

Gareth.

Former Member
0 Kudos

Hi Ryan,

Even i tried Rebuild option of my project but still the errors still remains.

Can you help me how i can import the required class files/par files/jar file.

Thanks in advance!.

Former Member
0 Kudos

Hi Siva

You have to add 2 jars to your project:

com.sap.security.... soemthing

com.sap.km.  ....something

These jars can be found in the plugin folder of eclipse.

Once you import these two jars, try to rebuild your project

regards

yuval

Former Member
0 Kudos

Hi Yupal,

I have done the required changes as per this document:

http://www.sapgeek.net/2010/10/web-dynpro-java-how-to-use-km-api/

but still the same error.

for your information, i have installed NWDS in my personal system and not in the portal server machine. and NWDI is not configured, i am trying to develop custom application Suggestion Box.

junwu
Active Contributor
0 Kudos

it is long long story for newbie.....

you have to know how to use external lib

http://scn.sap.com/docs/DOC-2666

http://scn.sap.com/people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using...

please search first.....

junwu
Active Contributor
0 Kudos
if the project you created is DC type, adding jar in build path will not work.
Former Member
0 Kudos

Hi,

I would suggest you are in over your head with this.  I'm all for learning by doing but you need to understand the basics before you can dive into complex stuff.

Also bear in mind that once you've built stuff, often someone else has to support and look after it so doing it the wrong way or forcing it to work in a strange way only makes things harder and more complicated for them.

Gareth.

Former Member
0 Kudos

Hi

These errors are thrown bevuase you did not include the jars in your classpath

Add the jars I indicated: project -> properties -> java build path -> libraries-> add external jar

regards

yuval

Former Member
0 Kudos

Hi Yuval,

You can't simply add external jars to a Web Dynpro DC - as soon as you rebuild the DC the entries will be removed.  The DC framework acts as a wrapper around the basic Java project properties so you have to do it using the DC tools available in NWDS.

You have to define dependancies on other DC's that you want to re-use - whether these are standard SAP DC's offering functionality such as UME API's or external libraries packaging up independant jars, such as POI or similar, the process is still similar.

Either way, I still think the OP needs to go back to basics a bit to understand all of this.

Gareth,

Former Member
0 Kudos

Hi Ryan,

Thanks for your reply! Actually i am very bad with NWDS, but had been through this document:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30d8e626-d74c-2a10-a986-a86017ea6...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30d8e626-d74c-2a10-a986-a86017ea6...regarding suggestion box creation in portal. i have done accordingly but only thing is with the  errors in the code. I am having hard time to resolve the issue. please guide me to solve the issue.

junwu
Active Contributor
0 Kudos
go with project, not DC,  things will become a slight easy for you.
Former Member
0 Kudos

Hi Jun,

But Projects are the WRONG way of doing things now - you should always use DC's, else you lose all of the power of re-use and componentisation.  Ok, it may be a bit complex to get set up the first time around when you haven't done it before but its worth it in the end.

A lot of the posts on this thread are just re-enforcing my previous comments - walk before you run.  Don't take shortcuts just to make things work as it will end up causing problems in the long term, plus you end up learning bad habits.

Siva, have you tried to complete all of the tutorials available for Web Dynpro, starting from HelloWorld and working up?  There is lots of content here on SCN to guide you.

Gareth (not Ryan.)

junwu
Active Contributor
0 Kudos
based on his/her current situation, do you think reuse will be the concern?
forget about that.....
Former Member
0 Kudos

Hi Jun,

So basically, you are saying that because doing something the correct way is too hard, just do it the wrong way?  How does that help?

Gareth.

junwu
Active Contributor
0 Kudos
i don't think that is a wrong way.
comparing with current standard, it may be not compliant, but in nw 7, project is still supported and is right way to go.
Former Member
0 Kudos

Hi Gareth

1. You are right, but what I meant was adding sap jars to the build path.
     As for extrernal jars, like excel POI, if you are working with DC,  you are right they have to be    included in a different J2EE component.

2. And right you are again: he does indeed have to go to basics and work his way up....
     Luckily these are intricate matters that necessitate further study.

regards

yuval peery

regards

yuval peery

Former Member
0 Kudos

Hi,

Use organise import (shift+ctrl+o) to resolve this.

Regards,

Trilochan

Former Member
0 Kudos

Hi Trilochan,

When i use (shift+cntrl+o) at the bottom i am getting  0 import(s) added.

I am new to NWDS tool please help me out.

junwu
Active Contributor
0 Kudos
you have to add those km lib first
Former Member
0 Kudos

Hi Jun,

How do we add the km lib, can you explain me in detail as i am new to NWDS.

Thanks inadvance.

junwu
Active Contributor
0 Kudos
make a search in sdn regarding km lib
you will find a lot
Former Member
0 Kudos

Hi siva,

Right click on your project>Select Repair-->Select Project Structure and classpath after that Rebuild your project.Now close your NWDS and open and also check whether are you missing any imports.

Hope it helps...

Thanks,

Rahul.

Former Member
0 Kudos

Hi Rahul,

i have fallowed this document: http://www.sapgeek.net/2010/10/web-dynpro-java-how-to-use-km-api/

and imported six jar files required and finally added reference as in document :PORTAL:sap.com/com.sap.km.application

Right click on your project>Select Repair-->Select Project Structure and classpath after that Rebuild my project

but still the problem still exists.

for your information, i have installed NWDS in my personal system and not in the portal server machine. and NWDI is not configured, i am trying to develope custom application Sugeestion Box.