Eclipse is only giving me option to include jar files in Java Build Path->Libraries .In some tutorial sites they are showing to add jar files in WEb-INF/lib,but iam not able to add jar here.i tried importing files to WEB-INF/lib,jars were added but they did not had jar icon instead some weird icon ,and when i m trying to run my struts login page its giving me error /index.jsp(8,40) File "/struts-tags" not found.Where to put jar to make it work,Also while learning struts sometime i get Http 404 error,but when i restart eclipse(I tried restarting server but it didnt help) the error is gone all of a sudden.why this is happening.Eclipse is so confusing.
Asked
Active
Viewed 9,074 times
2 Answers
0
As jars are showing some weird icon, I would suggest you to change the jar files. Also, make sure your added jar contains struts-tags.tld file. This will resolve error on index.jsp.
sorry, system is not allowing me to put comment. So editing the same.
Follow below steps to check the jars are added to build path correctly -
- switch to package explorer view.
- check whether your jars are added under web app Libraries. If yes your jars are added properly.
- Then check struts-tags.tld file is present inside struts2-core.jar. If not present then copy it or add new jar containing the same.

Umesh Awasthi
- 23,407
- 37
- 132
- 204

mahesh
- 597
- 11
- 23
-
Weird icon is shown when i add them to web-Inf/lib but not in Libraries.I have got jars struts2core,freemarker,ognl,commonfileupload,common logging,,xwork.Why its not happening i dont kno – saum22 Dec 30 '11 at 13:14
-
Also when iam adding jar by above method,when i check the workspace->project name folder,i cant find jars which were added through eclipse.When i copy past them to web-inf/lib folder in workspce (Not through eclipse).Eclipse is not showing them in lib .its showing java resources->libraries. – saum22 Dec 31 '11 at 07:56
0
Go to the your web-project folder outside the eclipse.Cope your jars (which are required for your project).
Than open-up Eclipse, follow these steps
- Right Click on project(Project Explorer) choose -->Configure build path.
- Go to Library tab and click on add jars, it will open this wizard
Add required jars and i hope this will solve your problem. Make sure you have required jars in your class-path..

Umesh Awasthi
- 23,407
- 37
- 132
- 204
-
Sorry for late reply ,I was doing this only and it is adding jars in Java Resources->Libraries.But when I see example http://www.vaannila.com/struts-2/struts-2-example/struts-2-annotation-example-1.html .In Directory structure of hello,jars are added in WEB-INF/lib folder which might solve problem but following the above step it adding jar to Java Resources->Libraries and is not recognizing my jar – saum22 Dec 31 '11 at 07:01
-
I am using maven so in this case maven will take care of the things but when you have to run your project on server jars need to be there inside `WEB-INF/lib` folder. i suggest you to read a bit about J2EE application structure and how things are being arranged – Umesh Awasthi Dec 31 '11 at 07:12
-
problem solved,i was able to put jar in web-inf/lib,same weird icon are still showing but im not getting the error:) – saum22 Dec 31 '11 at 08:11
-
you can even change the workbench or can use new installation of eclipse.might be workbench got corrupted – Umesh Awasthi Dec 31 '11 at 08:12
-
-
strange behavior of eclipse ,should i change my eclipse as, 1.my application was running ,2.then i added struts tag in index.jsp,then it gave error dispatcher not found,then i added dispatcher in web.xml ,then it gave HTTP 404 error ,and when i am undoing the changes it is stuck at 404 ,after restarting the server it again gave dispatcher not found(as i removed the dispatcher).So adding the dispatcher its giving 404 removing it giving dispatcher not found,And after every change i have to restart the tomcat why this ..is it because of eclipse problem – saum22 Jan 02 '12 at 07:13
-
basically when you deploy application using eclipse they are not actually being deployed a context is being created by Eclipse and some time it did not simple pick the changes.many times its a pain – Umesh Awasthi Jan 02 '12 at 07:21
-
Also when i create new dynamic project and try to run it .A pop up comes giving error "An internal error occurred during: "Launching client". java.lang.NullPointerException" and 404 then i create 1st fie index.jsp and run it ,give 404 again i have to restart server and run project this time it run with the same pop up error "An internal error occurred during: "Launching client". java.lang.NullPointerException" – saum22 Jan 02 '12 at 07:23
-
My suggestion is to give some time to eclipse documentation how web-prroject run and work inside the editor – Umesh Awasthi Jan 02 '12 at 07:24
-
ok.So do i need to restart server again and again after doing any changes..ok thanks – saum22 Jan 02 '12 at 07:24
-
Look if the changes are only with jsp no need to change it.will be picked up by container and for classed and xml it needs to be dependent upon the env.For better control use any build tool like `ant` whcih ensure that things are getting copied and deployed properly. – Umesh Awasthi Jan 02 '12 at 07:32