- This topic has 7 replies, 3 voices, and was last updated 20 years, 4 months ago by Scott Anderson.
-
AuthorPosts
-
TomMemberMyEclipse WEB Development Tutorial fails on Eclipse 3.0.0 / MyEclipse 3.8 Beta-1 / Linux.
The error is JSP file not in base path.
Default location is used.
System info below including problem with config.ini file
Adding WEB-INF to the Base Path when creating the JSP doesn’t help.Error details:
JSP file (/opt/eclipse_workspace/HelloWorld/src/test/helloWorld.jsp) not in base path (/opt/eclipse_workspace/HelloWorld/WebRoot/) helloWorld.jsp HelloWorld/src/testExisting files are:
/opt/eclipse_workspace/HelloWorld/src/test/HelloWorld.java
/opt/eclipse_workspace/HelloWorld/src/test/helloWorld.jsp
/opt/eclipse_workspace/HelloWorld/WebRoot/WEB-INF/classes/test/HelloWorld.class
/opt/eclipse_workspace/HelloWorld/WebRoot/WEB-INF/classes/test/helloWorld.jsp– Problem history:
1) Fresh install of Eclipse 3.0.0
Renamed <eclipse>/configuration/config.ini which contains a previous build Id that prevents Eclipse from starting
2) Successfully started and then stopped Eclipse
3) Fresh install of MyEclipse 3.8 Beta-1
Assumed response to links question was <eclipse>/links
4) Began MyEclipse WEB Development Tutorial (first tutorial on list)System Information:
– Versions – RH EL AS 3 Linux, Eclipse 3.0.0 and MyEclipse 3.8 Beta-1
– Eclipse version and build id – Eclipse 3.0.0 200406251208
– Eclipse and MyEclipse are freshly installed
– No plugins added
– No plugins in the <eclipse>/plugins directory like org.eclipse.pde…
– The MyEclipse version is MyEclipse 3.8 Beta 1 (3.7.101)
– Using JDK version 1.4.2_04
– Application server specifies JDK version jdsdk1.4.2_04
– Using the Tomcat 5 application server
– No such file as <workspace>/.metadata/.log
TomMemberThe fix seems to be simply post-pending “WEB-INF” to the default “WebRoot” setting for “Web root folder” which is under Eclipse – Window – Preferences – J2EE – Project Templates.
D’oh.
support-michaelKeymasterHi Tom,
The problem you experience results from locating your JSPs (any webcontent) within an Eclipse (not MyEclipse) Java source folder. This Java source folder’s output location is <your project>/<your webroot>/WEB-INF/classes folder. When any resource in a Java source folder is modified Eclipse implicit behavior is to copy it to the output location – the <web-root>/WEB-INF/classes folder in the case of an ME WebProject.
A good point to remember is that any resource located within a WebProject’s Java source folder will be output to the WebProject’s <webroot>/WEB-INF/classes folder. Therefore limit the content in a src folder to Java source files and resources directly referenced by those classes such as resource files.
To fix this problem, relocate your web content (JSP, HTML, …) to <your prj>/<your webroot>/ folder and you should be good to go. Be sure to scrub to remove any old artifacts.
TomMemberHi again Michael,
I hope it’s acceptable to respond to a closed item, and to include the previous system information by reference.
As I understand you to recommed, the JSP Wizard does not place the created JSP under src with regular Java classes, and the Wizard’s default “File Path” is /HelloWorld/WebRoot, not /HelloWorld/WebRoot/WEB-INF, as specified in the (corresponding?) Preferences MyEclipse J2EE Project Templates “WEB root folder”.
But interestingly, 1) the JSP _is_ displayed under WEB-INF in the MyEclpise Perspective, and 2) the JSP properties say it’s location is not in WEB-INF where it displays, but in:
/opt/eclipse_workspace/HelloWorld/WebRoot/helloWorld.jsp, where I understand it should be, and also 3) the Preferences MyEclipse J2EE Project Templates “WEB project source folder” does specify “src:”.I must be missing something. Help?
Thanks again!!
TomMemberThe JSP is created in with the Java classes by default both with 2.1.3/2.7.1 and 3.0.0/3.8b1 but I am able to move it into WebRoot in both cases (which automatically places it under WEB-INF ), so I think I’m fine and am going forward.
Tom
Scott AndersonParticipantTom,
The JSP is created in with the Java classes by default both with 2.1.3/2.7.1 and 3.0.0/3.8b1
I think you’re confusing a *default* with your current workbench selection. You see, when you invoke any Eclipse wizard, it’s going to create something for you and to be helpful, it tries to guess where you’d like it by looking at the currently selected item in the workbench for context. When you invoked our new JSP wizard you most likely had your Java source directory selected in the package explorer view. As a result, the wizard decided that that was a good initial suggestion for its output. I think you’ll find that if you select your web root folder, and then invoke the wizard that it will then show it as the current output location. Please note that once the wizard is started, you can always change where the output goes by using the browse button to select a new destination on the first wizard page. Hope that clears things up.
TomMemberThanks again Scott – I had no idea the Wizard was paying such close attention 😉
Scott AndersonParticipantIt’s very clever that way. 😉
-
AuthorPosts