For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 12 replies, 2 voices, and was last updated 19 years, 9 months ago by
Riyad Kalla.
-
AuthorPosts
-
rigasminhoMemberHello,
I’m trying to setup the project environment in myEclipse 5.0I have the file folder setup for a JSP workspace.
It makes the folders and i move the files i have from before into those folders.
However i have a Java class file that needs to be used by the application. However the Java class file isnt called upon correctly in my application – or myEclipse forces it to give it errors when in reality it’s there.
<jsp:useBean id=”eagle” class=”bird” scope=”request”/>MyEclipse basically doesnt know where this class file is stored. I dont have the Java file that made this class so maybe myEclipse needs a java file stored in the SRC folder?
Any Ideas?
November 14, 2006 at 2:13 pm #261818
Riyad KallaMemberThe first problem I see is that your bird class has no package. You need to place it in a package. Also yes, if you don’t include the source code in your source folder, and only include the class in your output folder, your class will be erased every time your project builds. Part of the build cycle in Eclipse is to clear the output package before each compile.
November 15, 2006 at 10:49 am #261896
rigasminhoMemberSo basically if i dont have the source file i’m screwed huh?
Because right now i only have the class file.
November 15, 2006 at 11:05 am #261897
Riyad KallaMemberNo, not screwed. Just a bit more configuration to stop the default “cleaning” behavior.
I believe if you pop open your project properties, go to Java Compiler, then Building, you can turn off the “scrubbing” of the output dir when the project builds. Then place the class in the appropriate package and try and rebuild your project.
After rebuilding, check that the class file didn’t get erased from the output dir. If the error is still marked in the JSP page, chances are that the use of the default package is what is making it mad. If you are using 5.1, you can simply exclude this file from validation to get rid of those error markers if you know the page works and just don’t want to be bothered by it.
November 15, 2006 at 12:14 pm #261905
rigasminhoMemberThanks – I turned off scrubbing but you’re right:
Now it gives me the errors on the jsp sections.How would you exclude the file from validation?
November 15, 2006 at 12:18 pm #261907
Riyad KallaMemberYou can right click on the file, go down to MyEclipse, then select “Exclude from Validation”. You can manage these files under your project properties, then under MyEclipse > Validation > Exclusion.
November 15, 2006 at 12:31 pm #261921
rigasminhoMemberDarn – I tried doing the exclusion and now myeclipse works pretty well with it. However when I try to load up the files in Tomcat it gives me the error that the symbol can not be resolved.
So basically what i need to do is make the command line:
<jsp:useBean id=”eagle” class=”bird” scope=”request”/>Somehow see the class “bird” even though the java file isnt there but the class file is 🙂
November 15, 2006 at 12:40 pm #261926
Riyad KallaMemberActually if Tomcat can’t see the file either, then you might have a legitimate problem and want to reenabled validation on this file.
Also you might just have your fully qualified class name wrong… you sure there is NO package and that the class is actually named “bird”, like:
public class bird?
This is horrible practice…
November 15, 2006 at 12:50 pm #261930
rigasminhoMemberEh – if you worked where I worked this would all be part of the normal day 🙂 Yeah my job was to migrate applications from bea weblogic to websphere. But the files I got had no java source files only class files so in turn the beans cant find the class correctly.
Hmmm well i can use cavaj to make the java file from the class right?
In that it has:
public bird()And yes I tried making the java file by cavaJ and it still doesnt help because the program doesnt make the file correctly.
Steps I’ve done:
Made the project space in MyEclipse 5.0
Copied over the files into teh folders manually
Copied over the class file into the web-inf / class sub folder
Deployed to Tomcatstill error on finding that class file.
November 15, 2006 at 12:51 pm #261932
rigasminhoMemberIs there a way in myeclipse for it to point to the class file manually? Instead of having it look for it in some location that is wrong?
November 15, 2006 at 2:01 pm #261942
Riyad KallaMemberEh – if you worked where I worked this would all be part of the normal day 🙂
Ha, fair enough.
In that it has:
public bird()you mean the constructor looks like that? Is there a package statement of any kind? Like com.company? If so, your class arg in the taglib needs to be the whole fully qualified class:
com.company.birdIs there a way in myeclipse for it to point to the class file manually? Instead of having it look for it in some location that is wrong?
Well here’s the problem, is that Tomcat isn’t compiling the page correctly either, so I think you have a real problem, not just a “MyEclipse doesn’t understand my page” problem. You will need to figure out the right package and name for the class and then make sure to indicate it correctly in your JSP page.
To answer your question though, no.
November 15, 2006 at 2:37 pm #261957
rigasminhoMemberyou mean the constructor looks like that? Is there a package statement of any kind? Like com.company? If so, your class arg in the taglib needs to be the whole fully qualified class:
com.company.birdYeah definately no package is made / brought into.
Hmm so now the question becomes how do I make tomcat recognize the class file i have 🙂
November 15, 2006 at 2:57 pm #261959
Riyad KallaMemberI’m not sure off hand. Try googling for Tomcat Class default package or something.
-
AuthorPosts
