Re: Cannot create object of class

2007-01-10 Thread Stephan Schöffel

i took the example from the head first ooad book.

i now created separate classes for timertask and runnable. works fine.

thanks for the help
stephan


Caldarale, Charles R wrote:

From: Stephan Schöffel [mailto:[EMAIL PROTECTED] 
Subject: Cannot create object of class
   



 


java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1
   



It's not MyClass that can't be found, it's a failure to create the anonymous 
inner class:

 


   timer.schedule(new TimerTask(){
   public void run(){
   timer.cancel();
   }
   }, 60*1000);
   



The TimerTask definition (interface or superclass) must also be available in 
the manager app's classpath (i.e., WEB-INF/lib or WEB-INF/classes).

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cannot create object of class

2007-01-09 Thread Li

Hi, it seems that catalina was trying to find your MyClass in her manager's
classpath java.lang.NoClassDefFoundError:
org/apache/catalina/manager/MyClass$1.

Make sure your class path is correct. A faster way to test if to write a
simple jsp and run your thread inside
% ... %. You can need configure your system to give tomcat permission to
run process or executable files...



On 1/9/07, Stephan Schöffel [EMAIL PROTECTED] wrote:


hi,

have a problem with creating a class in the doPost method of a servlet:

MyClass mc= new MyClass();

if i do so i get the following error message:


  HTTP Status 500 -



*type* Exception report

*message*

*description* _The server encountered an internal error () that
prevented it from fulfilling this request._

*exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1
org.apache.catalina.manager.AgroManagerServlet.doPost(
AgroManagerServlet.java:112)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*note* _The full stack trace of the root cause is available in the
Apache Tomcat/5.5.20 logs._




  Apache Tomcat/5.5.20




i belive it has something to to with the timer i use in the class:

public class MyClass implements Runnable{
public void run(){
final Timer timer = new Timer();
timer.schedule(new TimerTask(){
public void run(){

timer.cancel();
}
}, 60*1000);
}
public void startUpdate(){
try{
System.out.println(do something);
Process p =
Runtime.getRuntime().exec(TomcatPath.getAbsInstPath
()+update/check_for_updates.exe);
}catch(Exception e){

}
}
}


dont know what do to since i need the timer task and i need it in a
separate thread...

--stephan

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
When we invent time, we invent death.


Re: Cannot create object of class

2007-01-09 Thread Stephan Schöffel

MyClass is in the manage lib.

if i delete this timer-stuff it works fine... but i need the timer



Li wrote:

Hi, it seems that catalina was trying to find your MyClass in her 
manager's

classpath java.lang.NoClassDefFoundError:
org/apache/catalina/manager/MyClass$1.

Make sure your class path is correct. A faster way to test if to write a
simple jsp and run your thread inside
% ... %. You can need configure your system to give tomcat 
permission to

run process or executable files...



On 1/9/07, Stephan Schöffel [EMAIL PROTECTED] wrote:



hi,

have a problem with creating a class in the doPost method of a servlet:

MyClass mc= new MyClass();

if i do so i get the following error message:


  HTTP Status 500 -



*type* Exception report

*message*

*description* _The server encountered an internal error () that
prevented it from fulfilling this request._

*exception*

javax.servlet.ServletException: Servlet execution threw an exception

*root cause*

java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1
org.apache.catalina.manager.AgroManagerServlet.doPost(
AgroManagerServlet.java:112)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*note* _The full stack trace of the root cause is available in the
Apache Tomcat/5.5.20 logs._




  Apache Tomcat/5.5.20




i belive it has something to to with the timer i use in the class:

public class MyClass implements Runnable{
public void run(){
final Timer timer = new Timer();
timer.schedule(new TimerTask(){
public void run(){

timer.cancel();
}
}, 60*1000);
}
public void startUpdate(){
try{
System.out.println(do something);
Process p =
Runtime.getRuntime().exec(TomcatPath.getAbsInstPath
()+update/check_for_updates.exe);
}catch(Exception e){

}
}
}


dont know what do to since i need the timer task and i need it in a
separate thread...

--stephan

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cannot create object of class

2007-01-09 Thread Li

try to call your time in a single jsp file. say test.jsp ...

%@ page import=yourtimerpath %

%
 ... I am calling my timer here 
%

See if you can make it work ...

On 1/9/07, Stephan Schöffel [EMAIL PROTECTED] wrote:


MyClass is in the manage lib.

if i delete this timer-stuff it works fine... but i need the timer



Li wrote:

 Hi, it seems that catalina was trying to find your MyClass in her
 manager's
 classpath java.lang.NoClassDefFoundError:
 org/apache/catalina/manager/MyClass$1.

 Make sure your class path is correct. A faster way to test if to write a
 simple jsp and run your thread inside
 % ... %. You can need configure your system to give tomcat
 permission to
 run process or executable files...



 On 1/9/07, Stephan Schöffel [EMAIL PROTECTED] wrote:


 hi,

 have a problem with creating a class in the doPost method of a servlet:

 MyClass mc= new MyClass();

 if i do so i get the following error message:


   HTTP Status 500 -




 *type* Exception report

 *message*

 *description* _The server encountered an internal error () that
 prevented it from fulfilling this request._

 *exception*

 javax.servlet.ServletException: Servlet execution threw an exception

 *root cause*

 java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1
 org.apache.catalina.manager.AgroManagerServlet.doPost(
 AgroManagerServlet.java:112)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

 *note* _The full stack trace of the root cause is available in the
 Apache Tomcat/5.5.20 logs._





   Apache Tomcat/5.5.20




 i belive it has something to to with the timer i use in the class:

 public class MyClass implements Runnable{
 public void run(){
 final Timer timer = new Timer();
 timer.schedule(new TimerTask(){
 public void run(){

 timer.cancel();
 }
 }, 60*1000);
 }
 public void startUpdate(){
 try{
 System.out.println(do something);
 Process p =
 Runtime.getRuntime().exec(TomcatPath.getAbsInstPath
 ()+update/check_for_updates.exe);
 }catch(Exception e){

 }
 }
 }


 dont know what do to since i need the timer task and i need it in a
 separate thread...

 --stephan

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
When we invent time, we invent death.


RE: Cannot create object of class

2007-01-09 Thread Caldarale, Charles R
 From: Stephan Schöffel [mailto:[EMAIL PROTECTED] 
 Subject: Cannot create object of class

 java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1

It's not MyClass that can't be found, it's a failure to create the anonymous 
inner class:

 timer.schedule(new TimerTask(){
 public void run(){
 timer.cancel();
 }
 }, 60*1000);

The TimerTask definition (interface or superclass) must also be available in 
the manager app's classpath (i.e., WEB-INF/lib or WEB-INF/classes).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]