You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Karthikeyan.K.V" <ka...@attbi.com> on 2002/02/21 19:12:19 UTC

RE: java.lang.NoClassDefFoundError (help a newbie plz...)

U have to put the compiled class of HitCountBean(HitCountBean.class) in
WEB-INF/classes/hit

Karthik
-----Original Message-----
From: Claudiu Bran [mailto:ubik@romtelecom.ro]
Sent: Thursday, February 21, 2002 10:09 PM
To: tomcat-user@jakarta.apache.org
Subject: java.lang.NoClassDefFoundError (help a newbie plz...)


I have a simple .jsp which wants to use a bean named HitCountBean, but upon
execution I get

Internal Servlet Error: javax.servlet.ServletException: hit/HitCountBean
[...]
Root Cause:
java.lang.NoClassDefFoundError: hit/HitCountBean
[...]

Here is HitCountBean.jsp, located in /var/tomcat/webapps/myex/
----
<jsp:useBean id="counter" scope="application" class="hit.HitCountBean" />
<jsp:setProperty name="counter" property="newSession" value="<%=
session.isNew() %>" />
[...]
----
And this is HitCountBean.java located in
/var/tomcat/webapps/myex/WEB-INF/classes/hit/
----
package hit;
import java.util.Date;
import java.text.DateFormat;
import java.io.Serializable;

public class HitCountBean implements Serializable {
   private boolean b;
   private int hitCount;
   private String serverStart;
   private Date date = new Date();
[...]
}

So, what do I have to do, where do I have to put  HitCountBean.java ?
Thanks in advance

PS: I am *very* newbie to jsp, java.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: java.lang.NoClassDefFoundError (help a newbie plz...)

Posted by Claudiu Bran <ub...@romtelecom.ro>.
Thanks Karthik ! I thought tomcat will compile it, lol. Anyway, I compiled
it, and it works, thanks a lot :)

From: "Karthikeyan.K.V" <ka...@attbi.com>

> U have to put the compiled class of HitCountBean(HitCountBean.class) in
> WEB-INF/classes/hit
>
> Karthik
> -----Original Message-----
> From: Claudiu Bran [mailto:ubik@romtelecom.ro]
> Sent: Thursday, February 21, 2002 10:09 PM
> To: tomcat-user@jakarta.apache.org
> Subject: java.lang.NoClassDefFoundError (help a newbie plz...)
>
>
> I have a simple .jsp which wants to use a bean named HitCountBean, but
upon
> execution I get
>
> Internal Servlet Error: javax.servlet.ServletException: hit/HitCountBean
> [...]
> Root Cause:
> java.lang.NoClassDefFoundError: hit/HitCountBean
> [...]
>
> Here is HitCountBean.jsp, located in /var/tomcat/webapps/myex/
> ----
> <jsp:useBean id="counter" scope="application" class="hit.HitCountBean" />
> <jsp:setProperty name="counter" property="newSession" value="<%=
> session.isNew() %>" />
> [...]
> ----
> And this is HitCountBean.java located in
> /var/tomcat/webapps/myex/WEB-INF/classes/hit/
> ----
> package hit;
> import java.util.Date;
> import java.text.DateFormat;
> import java.io.Serializable;
>
> public class HitCountBean implements Serializable {
>    private boolean b;
>    private int hitCount;
>    private String serverStart;
>    private Date date = new Date();
> [...]
> }
>
> So, what do I have to do, where do I have to put  HitCountBean.java ?
> Thanks in advance
>
> PS: I am *very* newbie to jsp, java.
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> ###########################################
>
> This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
> For more information, connect to http://www.F-Secure.com/


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>