cancel
Showing results for 
Search instead for 
Did you mean: 

Imports gone after saving metadata.

Former Member
0 Kudos

My imports disappear if I want to save my metadata in the NWDS. Due to this errors appear and I cannot run my application.

Does anybody have a solution???

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Unfortunally, the errors still appear. After the solution of Arnau it worked once time. I can save with out error, but when I change something and save again. The errors appear.

Former Member
0 Kudos

Hi,

Have u tried to create a new Workspace and resynced the project from DTR.

Regards

Ayyapparaj

Former Member
0 Kudos

It seems like it is solved. I will keep an eye on it.

Former Member
0 Kudos

Hi,

I think the best solution is to go to Development Configuraion Perspective, on Inactive DCs view, and remove this DC from client. Then, close Developer Studio and go to workspace directory. Look at some existing files from your DC just deleted, because sometimes there are still files on workspace. If you find any file of the deleted DC, delete them.

If you are sure there are no files of this DC on your workspace, the open Developer Studio again, go to Development Configuration Perspective on Inactive DCs view and select Create Project of this DC. When you've created the project, repeat the solution of my previous post (delete "gen_wdp" and make a Rebuild Project), and save metadata.

I've used this procedure sometimes to repair broken DCs.

Hope it helps!

Arnau Rovira

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi!

Probably, one of your UI elements'properties in your view its missing a value, or its wrong placed/configurated, and that's what invalidates the implementation, that could have happened by copying UI elements between views or deleting binded context variables.

Sometimes those kind of errors won't be shown, because by being invalid, that code cant be compiled until that UI element issue is solved, so implementation become valid again.

I'd reccomend to check carefully all UI elements, and remember backup often your project.

Regards.

Julio Herrera

former_member197348
Active Contributor
0 Kudos

Hi,

Select and right click on Project-> properties -> Select Java Build path-> select Libraries tab. Add the required JRE LIB and .jar files and build it.

regards,

Siva

Former Member
0 Kudos

Hi,

The libraries are added but I still have the problem.

regards,

Michael

former_member751941
Active Contributor
0 Kudos

Hi Ouden,

What error you are getting?

If your project is DC project then add the necessary DCs in your project

• In the Web Dynpro Explorer of the

Web Dynpro perspective expand the

Web Dynpro project.

• Expand the nodes DC Meta Data =>

DC Definition and right click on

Used DCs.

• Choose Add used DC…

• A Add Dependency wizard will appear.

• Choose the necessary DC required for your project

• Check Dependency Type Build Time, Deploy Time and Run Time

• Click on Finish.

Regards,

Mithu

Former Member
0 Kudos

It is not a DC project but a "simple" Java development.

I do not receive a specific error, but I built my Java-code in the implemtation of a view with all imports in the head of the code it looks all right (no "red" errors). Until the moment I want to save the metadata. Then all my imports disappear and the "cannot be resolved"-errors appear.

former_member197348
Active Contributor
0 Kudos

Hi,

First add JRE LIB. Like this:

Right click on the project ->Select Properties. Select Java Build path-> Select Libraries tab->Select Add Library->Select JRE System Library->Select Java Directory.

If still the proble persists

Try these 3 options:

Option 1:

1.Reload the project (Right click on project)

2.Repair the project (Right click on project -> Select Project Structure and ClassPath)

Option 2:

1.Close th project.

2.Open the project and rebuild it.

Option 3:

1. Close the NWDS.

2. Open NWDS.

3.Rebuild it.

former_member197348
Active Contributor
0 Kudos

Hi Michael,

First add JRE LIB. Like this:

Right click on the project ->Select Properties. Select Java Build path-> Select Libraries tab->Select Add Library->Select JRE System Library->Select Java Directory.

If still the proble persists

Try these 3 options:

Option 1:

1.Reload the project (Right click on project)

2.Repair the project (Right click on project -> Select Project Structure and ClassPath)

Option 2:

1.Close th project.

2.Open the project and rebuild it.

Option 3:

1. Close the NWDS.

2. Open NWDS.

3.Rebuild it.

Next time can you please post part of or all errors ?

regards,

Siva

Former Member
0 Kudos

Hi Siva,

I removed the JRE library and added it once again. I also tried the given options but they all unsuccesfull.

I copied the code to notepad to not lose it again. And when I paste it back after the "crash" and save it is ok, until I change something and want to save.

I also see if I change something in the code (after paste) and I save the code, only the method I am working in is displayed, if i want to change something else (f.e. in the wdDoModifyView) I need to click it in the navigation window on the left (I cannot scroll to it). After the unsuccesfull save of metadata my wdDoInit is empty (in the original code he is filled).

Former Member
0 Kudos

The problem is I do not receive any specific errors but "normal" Java error like "WDVisibility cannot be resolved" and/or "Properties cannot be resolved or is not a type" this kind of errors I have 44 times in the whole source and when I right click in the source and point to "source->organize imports" everything is ok, until the save or run of the application.

former_member197348
Active Contributor
0 Kudos

Hi Michael,

Is this problem for only one project or others too?

Test once with a new project. If the problem is with all projects then it means the problem with studio(NWDS) itself.

If the problem is only with this project.

Option 1:

1.Add code to your methods.

2.Right click on the project-> Rebuild it (It saves and builds).

Option 2:

Still there is problem.

1.Close all projects except this

2. Now rebuild this.

If still there is a problem better create a new project.

regards,

Siva

Former Member
0 Kudos

The problem appears only in this one. I tried te 2 options but is doesn't work. It is lready a new project (after the first version with the same problem), but I will try to create a third new one.

Former Member
0 Kudos

Hi,

Try to go to Navigation view, go to "gen_wdp" folder for your project and delete subfolder named "packages". Then on Web Dynpro Explorer view, make a Rebuild Project.

Regards,

Arnau Rovira