Lmhelp1 wrote:
Hello,

Thank you for reading my post.

I am getting a "ClassNotFoundException".

Below is the situation.
- I'm working with "Eclipse" ("Luna"), "Tomcat 8" and "Java 8".
- I have three projects "project1", "project2" and "project3".
- "project1" and "project2" depend on the third project "project3".
In "Project -> Properties -> Java Build Path -> Projects", I added "project3" for both projects "project1" and "project2".
- "project3" is a "Java project".
- "project1" and "project2" are "Dynamic Web Projects".
- "project3" defines the class "MyFilter" which implements "Filter" and which I put in the package "my.package". - "project1" contains a "web.xml" file which contains the following elements:
  [...]
  <filter>
    <filter-name>MyFilter</filter-name>
<filter-class>my.package.MyFilter</filter-class>
    <init-param>
      <param-name>requestEncoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>MyFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  [...]
- "project2" contains a "web.xml" file which contains the following elements (same as in "project 1"):
  [...]
  <filter>
    <filter-name>MyFilter</filter-name>
<filter-class>my.package.MyFilter</filter-class>
    <init-param>
      <param-name>requestEncoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>MyFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  [...]

When running a JSP of "project1" on the "Tomcat" server, I get the error:
SEVERE: Exception starting filter MyFilter
java.lang.ClassNotFoundException: my.package.MyFilter

There are no errors at build time.

I just would like to mention that I'm working with "Tomcat 8" for the first time. It used to work with "Tomcat 7" but I might have done something more to make it work... I don't remember what...

What can I do to solve that problem?
Please let me know if you need additional information or if I'm not clear enough.


I do not really know how to translate this for Eclipse but if this was a stand-alone Tomcat, the way you describe it above, project1 and project2 (when deployed) should also have the class available under their respective (catalina_base)/webapps/projectX/WEB-INF/classes/ directory (or /WEB-INF/classes/lib/, if in a jar). Is it the case ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to