- This topic has 12 replies, 3 voices, and was last updated 19 years, 9 months ago by
Riyad Kalla.
-
AuthorPosts
-
anneliuMemberI am getting the same errors as Franck did in the following post (http://myeclipseide.com/PNphpBB2+file-viewtopic-t-4681.html)
I am getting a mixure of the following errors in my JSPs
– cannot access javax.servlet.Servlet: file javax\servlet\Servlet.class not found. NOTE: No JSP line number was avaliable so line 1 was used for the marker. index.jsp
– cannot resolve symbol: symbol : class HttpServletResponse. NOTE: No JSP line number was avaliable so line 1 was used for the marker. index.jsp
– package javax.servlet.http does not exist: import javax.servlet.http.*;. NOTE: No JSP line number was avaliable so line 1 was used for the marker. index.jspI know my classpath is correct since my Struts Action classes compile correctly, and when I run my application in Tomcat the JSP pages display fine and are recompiled correctly.
I have tried using a variety of JVMs to start eclipse (1.4.2_06, jre 1.4.2_06, 1.5.0_02, IBM J2RE 1.4.1), but each time I get the same errors.
Any help would be much appreciated!
>>What operating system and version are you running?
Windows 2000 5.00.2195 SP4>>What Eclipse version and build id are you using? (Help > About Eclipse Platform)
Version: 3.1.0
Build id: I20050627-1435Was Eclipse freshly installed for MyEclipse?
>> YesAre any other external plugins installed?
>> Only one, Nitrox JSPHow many plugins in the <eclipse>/plugins directory are like org.eclipse.pde.*
>> 4What MyEclipse version are you using? (Help > About Eclipse Platform > Features)
>> Version: 3.9.210What JDK version are you using to run Eclipse? (java -version)
>> 1.4.2_06What JDK version are you using to launch your application server?
>> tried 1.4.2_06, jre 1.4.2_06, 1.5.0_02, IBM J2RE 1.4.1What steps did you take that resulted in the issue?
>> tried the different JVMs listed aboveWhat application server are you using?
>> Tomcat 5.0.28Are there any exceptions in the Eclipse log file? (<workspace>/.metadata/.log)
>> nopeSystem properties
*** Date: Wed Aug 17 11:26:43 CDT 2005 *** Platform Details: *** System properties: awt.toolkit=sun.awt.windows.WToolkit eclipse.application=org.eclipse.ui.ide.workbench eclipse.buildId=I20050627-1435 eclipse.commands=-os win32 -ws win32 -arch x86 -launcher C:\eclipse\eclipse.exe -name Eclipse -showsplash 600 -exitdata 880_3c4 -vm C:\j2sdk1.4.2_06\bin\javaw.exe eclipse.product=org.eclipse.sdk.ide eclipse.startTime=1124295676496 eclipse.vm=C:\j2sdk1.4.2_06\bin\javaw.exe eclipse.vmargs=-Xms40m -Xmx256m -jar C:\eclipse\startup.jar eof=eof file.encoding=Cp1252 file.encoding.pkg=sun.io file.separator=\ java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment java.awt.printerjob=sun.awt.windows.WPrinterJob java.class.path=C:\eclipse\startup.jar java.class.version=48.0 java.endorsed.dirs=C:\j2sdk1.4.2_06\jre\lib\endorsed java.ext.dirs=C:\j2sdk1.4.2_06\jre\lib\ext java.home=C:\j2sdk1.4.2_06\jre java.io.tmpdir=c:\temp\ java.library.path=C:\j2sdk1.4.2_06\bin;.;C:\WINNT\system32;C:\WINNT;C:\j2re1.4.2_06\bin;c:\PROGRA~1\COMPUW~1\DEVPAR~1\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\DevTools\CVS;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;c:\Program Files\Common Files\Compuware\;c:\Program Files\Compuware\DevPartner Java Edition\bin;C:\workspace\TWC-BUILD\lib\ant\bin;C:\DevTools\jwsdp-1.3\jwsdp-shared\bin;C:\devtools\tomcat\jwsdp-1.3\jwsdp-shared\bin;C:\devtools\jwsdp-1.3\jwsdp-shared\bin;C:\Program Files\ESTsoft\ALZip\ java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition java.runtime.version=1.4.2_06-b03 java.specification.name=Java Platform API Specification java.specification.vendor=Sun Microsystems Inc. java.specification.version=1.4 java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory java.vendor=Sun Microsystems Inc. java.vendor.url=http://java.sun.com/ java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi java.version=1.4.2_06 java.vm.info=mixed mode java.vm.name=Java HotSpot(TM) Client VM java.vm.specification.name=Java Virtual Machine Specification java.vm.specification.vendor=Sun Microsystems Inc. java.vm.specification.version=1.0 java.vm.vendor=Sun Microsystems Inc. java.vm.version=1.4.2_06-b03 line.separator=
August 17, 2005 at 3:48 pm #235156
Riyad KallaMemberI know my classpath is correct since my Struts Action classes compile correctly, and when I run my application in Tomcat the JSP pages display fine and are recompiled correctly.
Actually the missing class exceptions you are getting aren’t needed to compile Struts classes and your App server ships the required libs so you wouldn’t notice the problem there either. Your build path is the problem. Check your Project Properties > Java Build Path > Libraries settings, do you have a J2EE library in your build path? If you expand it are there any error markers?
Try and add servlet-api.jar and jsp-api.jar from your <Tomcat>\common\lib directory.
August 18, 2005 at 10:17 am #235215
anneliuMemberThanks for your quick response; however I’m still getting the same errors.
I oringally had the JBoss libraries that shipped with MyEclipse, “J2EE 1.4 Library Set”, in my classpath (with no errors reported when I expanded it). I have now removed those and added the Tomcat jsp-api.jar and servlet-api.jar. I still get the same problems being reported.
Anything else I can try? Or, is there a way to supress these errors?
August 18, 2005 at 12:26 pm #235226
Riyad KallaMember1) Are you sure your using our JSP editor? (Right click on your JSP files, Open With > MyEclipse JSP Editor)
2) What kind of project is this? If you open your project properties and go to MyEclipse-Web, what values do you ahve typed in here?
3) Please list every JAR in your Library build path. Including the JARs that are part of the Libraries that are added to your build path. This error is very straight forward, it’s confusing me why it’s being so elusive, this has got to be somethign simple.
4) Try and restart MyEclipse with the -clean option.
August 18, 2005 at 4:30 pm #235245
anneliuMemberI finally fixed it after adding a j2ee.jar file into my classpath. I don’t understand why, since all the files it was complaining about was found in the servlet-api.jar. I just removed it and it’s still working.
Thanks for all our help! It was much appreciated!
August 18, 2005 at 5:26 pm #235248
Riyad KallaMemberI agree with you that is strange, but I am glad you got it working.
September 13, 2005 at 5:06 pm #237237
jakegageMemberPerhaps this is of interest. I was able to compile one of my projects by including the relevant JARs in the Java Build Path when I was compiling projects under Java 1.4.x for deployment into a Tomcat 4.x server; but I’ve recently tried to compile the project (same release of MyEclipse and Eclipse as above) into Tomcat 5.5 (again, referencing the servlet-api.jar), and now get exactly the errors described in the original post.
I’m really leary to include the j2ee.jar. Is there someplace I should start tracing this down?
Thanks much,
JakeSeptember 13, 2005 at 5:10 pm #237238
Riyad KallaMemberJake,
Try this:
Remove the J2EE library set from your build path, instead go add the servlet-api.jar and jsp-api.jar files from your Tomcat install under the common/lib dir, now rebuild your project. Did that work?September 13, 2005 at 5:12 pm #237239
jakegageMemberSorry to follow up again, but perhaps the most remarkable thing about the above errors (and perhaps Franck can say whether this was the case for him, as well): the .java source classes make many references to the javax.servlet packages, and the act of adding servlet-api.jar to the “Java Build Path” does make these errors disappear from the “Problems” list… it just doesn’t make the JSP errors go away.
Jake
September 13, 2005 at 5:25 pm #237243
Riyad KallaMemberJake please be specific, what are the errors exactly you are getting? (copy paste the text i fyou can)
September 13, 2005 at 5:28 pm #237244
jakegageMemberHey guys,
Wow. Thanks for the quick response, by the way: I didn’t even see it before I posted my little follow-up message.
I didn’t add the j2ee library to my build path, as per the instructions above: I actually had the servlet-api.jar added from Tomcat (notably not the jsp-api.jar, though… should that be there, as well?).
I was, however, able to make the errors in the Problem list go away by “Removing all Validation Markers” under the MyEclipse menu for the project, and a when I re-ran validation, the only error I get is one I’ve had before (File not found: “/home/jake/workspace/Pillar/etc/log4j.dtd (No such file or directory)”: I haven’t been able to find a satisfactory solution to referencing log4j DTDs).
…which is interesting. I wonder if there’s a little glitch in the validation code. Anyhow, if anybody else sees this problem, I’d suggest this workaround.
Does anybody know if there’s an open thread about referencing log4j DTDs, by the way?
Jake
September 13, 2005 at 5:30 pm #237245
jakegageMemberThe errors I was getting were exactly those mentioned in the original post:
– cannot access javax.servlet.Servlet: file javax\servlet\Servlet.class not found. NOTE: No JSP line number was avaliable so line 1 was used for the marker. index.jsp
– cannot resolve symbol: symbol : class HttpServletResponse. NOTE: No JSP line number was avaliable so line 1 was used for the marker. index.jsp
– package javax.servlet.http does not exist: import javax.servlet.http.*;. NOTE: No JSP line number was avaliable so line 1 was used for the marker. index.jspJake
September 13, 2005 at 5:51 pm #237247
Riyad KallaMemberCan you open up your Project Properties, go to Java Build Path, and then read everything you have listed under Projects as well as Libraries tab? (full JAR and Library names please, you don’t need to list the items in Libraries just yet, just give the name of the library). Thank you for your help in this matter, it looks to be a simple classpath issue, that’s why I want to get to the bottom of it fast so you can get back to work without issues.
-
AuthorPosts