sergiomn
asked on
Only a type can be imported. MyClass.anyclass resolves to a package error
I have an app that uses JSP's, java libraries (API) with Tomcat and MySQL. The app works fine, however, since I migrate to a new server, I start getting this error.
"Only a type can be imported. MyClass.anyclass resolves to a package error"
The funny thing here is that JSP's that are located in the root directory (public_html) works fine, while all the other JSP's throw this exception:
If I move any JSP from "public_html/any_directory " to "public_html", then that very same JSP works fine.
The java libraries are located in a jar file, in WEB-INF/lib, and it's classpath is perfectly written.
As you may know, Tomcat compiles JSP's the first time they're executed, so I checked the code generated for both JSP's (public_html/my_jsp.jsp and public_html/someFolder/my_ jsp.jsp), and they are exactly the same, however, only the one located in public_html works.
Evidently, there is a problem with tomcat's classpath, but I've been trying to fix this for many days, and still having the problem.
Altough, I know there's nothing wrong with the code of the JSP's, here it is, in case that helps. I'm sure that this error is caused by some Tomcat's configuration, however, I haven't been able to find it.
<%@ page import="Solutio.AdminRH.En tity.ICata logosAdmin DB" %>
<%!
private ICatalogosAdminDB theObj = null;
public void jspInit() {
try {
theObj = new ICatalogosAdminDB();
} catch (Exception ex) {
System.out.println(ex);
}
}
public void jspDestroy() {
theObj = null;
}
%>
<html>
...
...
Any help will be really appreciated.
Thank you.
"Only a type can be imported. MyClass.anyclass resolves to a package error"
The funny thing here is that JSP's that are located in the root directory (public_html) works fine, while all the other JSP's throw this exception:
If I move any JSP from "public_html/any_directory
The java libraries are located in a jar file, in WEB-INF/lib, and it's classpath is perfectly written.
As you may know, Tomcat compiles JSP's the first time they're executed, so I checked the code generated for both JSP's (public_html/my_jsp.jsp and public_html/someFolder/my_
Evidently, there is a problem with tomcat's classpath, but I've been trying to fix this for many days, and still having the problem.
Altough, I know there's nothing wrong with the code of the JSP's, here it is, in case that helps. I'm sure that this error is caused by some Tomcat's configuration, however, I haven't been able to find it.
<%@ page import="Solutio.AdminRH.En
<%!
private ICatalogosAdminDB theObj = null;
public void jspInit() {
try {
theObj = new ICatalogosAdminDB();
} catch (Exception ex) {
System.out.println(ex);
}
}
public void jspDestroy() {
theObj = null;
}
%>
<html>
...
...
Any help will be really appreciated.
Thank you.
where are you importing MyClass.anyclass?
be worth clearing tomcats work directory and restart tomcat
ASKER
at the begining of any JSP, in the code I paste, is the first line:
<%@ page import="Solutio.AdminRH.En tity.ICata logosAdmin DB" %>
I said "MyClass.anyclass" because it happens with any class, and any jsp of the app (except for those located in public_html, as mentioned.
However, In this specific case, the error says:
"Only a type can be imported. Solutio.AdminRH.Entity.IPr uebaAdminD B resolves to a package"
And yes, I've tried cleaning the work directory.
Thank you, any help will be really appreciated.
<%@ page import="Solutio.AdminRH.En
I said "MyClass.anyclass" because it happens with any class, and any jsp of the app (except for those located in public_html, as mentioned.
However, In this specific case, the error says:
"Only a type can be imported. Solutio.AdminRH.Entity.IPr
And yes, I've tried cleaning the work directory.
Thank you, any help will be really appreciated.
any other apps running on that instance of tomcat?
Anything unusual in the logs when the context starts up?
Anything unusual in the logs when the context starts up?
http://forums.sun.com/thread.jspa?threadID=5368651&tstart=0
is it the same problem ( & are you the same person as above post? evidently it states that it was fixed)
is it the same problem ( & are you the same person as above post? evidently it states that it was fixed)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.