开发者

JSP - Package not found

开发者 https://www.devze.com 2023-04-11 20:12 出处:网络
I just installed tomcat 6 on my server with Apache. My jsp file return the following error: Only a type can be imported. x.y.Z resolves to a package

I just installed tomcat 6 on my server with Apache.

My jsp file return the following error:

Only a type can be imported. x.y.Z resolves to a package

In the source file, I have the following line:

<%@ page language="java" import=开发者_Go百科"x.y.Z" %>

I have checked on the Internet, and from what I understood, Tomcat can not find my class Z However, I have my Z.class file in /website/WEB-INF/classes/x/y/Z.class

In /etc/tomcat6/Catalina/www.mydomain.com/, I have in the ROOT.xml file:

< Context path="/website/" antiResourceLocking="false" />

The file /etc/tomcat6/server.xml contains:

<Host name="www.mydomain.com" appBase="/home/user/www/" unpackWARs="true" autoDeploy="true"> <Context path="/" docBase="./" debug="1" reloadable="true"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="/var/log/tomcat6" prefix="tomcat_access_" suffix=".log" pattern="common" resolveHosts="false"/> </Host>

(/home/user/www/website/ is where my jsp files are stored)

I have tried to define a servlet in my web.xml file in WEB-INF but it didn't help. I have tried to move WEB-INF in / but it did not solve anything.

Any idea about why my Tomcat can't find my class?

Thanks for your help : )


I eventually solved my problem.

The architecture of the WEB-INF was ok, but it was not properly placed. I wrote an article about it with my configuration here

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号