cancel
Showing results for 
Search instead for 
Did you mean: 

Always getting 'import cannot be resolved' for IPrivate* imports

Former Member
0 Kudos

Hi,

Everytime I import a Web Dynpro DC from our NWDI I see 'import cannot be resolved' errors when I open for example the Component Controller implementation. An Organize Imports does not fix this. If I rightclick inside the code and select 'Show in Package Explorer' it jumps to the .java file for the implementation (within the gen_wdp folder). In that same tree I can see the IPrivate*.java files as well.

I also tried Repairing and Rebuilding the project. All to no avail...

Why is this happening and how can I resolve it?

Kind regards,

Pascal Willemsen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pascal,

Do the generated .java-files contain any compilation errors?

If for example the bindings in the imported DC are broken, broken JAVA-files will be generated in gen_wdp, and you won't be able to import them in your Component Controller.

Usually, for me at least, this depends on broken data-bindings.

Regards

Mattias

Former Member
0 Kudos

If I open the generated Java files in gen_wdp I see loads of errors (all '...cannot be resolved...'), but the Tasks view contains no errors at all (answer to Armin).

A development component build runs and seems to succeed without problems.

It seems that the Web Dynpro's contain a circular dependency, which I think is the cause of the problem:

1. wdThis in the Component Controller is an IPrivateComponent instance.

2. IPrivateComponent extends IPublicComponent.

3. IPublicComponent has a gen_delegate member which is an InternalComponent instance.

4. InternalComponent implements IPrivateComponent.

I guess NWDS doesn't know where to start...?

Former Member
0 Kudos

You could try to delete all generated files (gen_wdp, den_ddic) and do a rebuild.

Armin

Former Member
0 Kudos

You're never gonna believe this:

Closing and reopening the project did the trick. Maybe we should add 'fix the initial Web Dynpro project create and load bug' to the list of suggestions?

Thanks for your help guys.

Former Member
0 Kudos

Pascal-

Thanks for posting your success. I had the exact same issue and was also able to successfully resolve with a close/re-open.

Former Member
0 Kudos

...and I thought only restarting Windows would solve every problem

Armin

Former Member
0 Kudos

hi

abolutely yes that is how i have been removing all these errors but i thought something was wrong with my NDS!!

regards

vln

Former Member
0 Kudos

Pascal,

Fantastic! Had the same problem (with SP15). Thanks to your suggestion, closing and opening the project solves the problem!

Jonathan.

Former Member
0 Kudos

Hi Armin

my NWDS is Sp14 .when i try to create DC it giving error called "com.sap" not resolved.so all defalut generated code by webdynpro gives errors.all imports also showing error.it also shows some jar file are not available.but if i create Project instead of DC it works well.How to resolve this?Please help

Thanks

Prasad

Former Member
0 Kudos

c

Message was edited by:

Maruti cr

Answers (2)

Answers (2)

Former Member
0 Kudos

Pascal, Thanks so much for the solution mentioned, opening and closing the project helped me too.

MSR

Former Member
0 Kudos

Sometimes a Project -> Reload helps. Do you see any errors in the "Tasks" view?

Armin

Former Member
0 Kudos

Hi, Armin.

Great! Your answer is the best and reasonable solution in my case

(ESS/MSS related WDJ development).