Tomcat plugn for Eclipse

2007-02-04 Thread Awaneesh Shatmanyu
Hi All,

 

 

I want Tomcat plug-in for Eclipse 3.2 Can anyone mail me the link where
to download. My Tomcat version is 6.

 

Regards,

Awaneesh  

 

 

 



RE: HSQLDB and Tomcat ServletContextListener

2006-09-21 Thread Awaneesh Shatmanyu
Also for you information ...the auto-commit of HSQLDB is off by default.

  
 
 

-Original Message-
From: Awaneesh Shatmanyu [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 21, 2006 8:15 PM
To: Tomcat Users List
Subject: RE: HSQLDB and Tomcat ServletContextListener

Hi Feris,

I am currently working with the HSQLDB for my project.
I had similar problem, which got solved.
1. Make sure your jdbc connection is closed every time.
2. Do not run you application as long as you are looking into the
HSQLDB,
   close the DB and then run the application.

Regards,
Awaneesh Shatmanyu

  
 
 
-Original Message-
From: Feris Thia [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 21, 2006 7:55 PM
To: Tomcat Users List
Subject: HSQLDB and Tomcat ServletContextListener

Dear All,

 I'm using HSQLDB as embedded in-process mode for my web application. I
used
 to schedule every 1 minutes to check on the HSQLDB database. I open the
db
 when context initialized and close it when context destroyed. But when
the
 context reloaded I always get Java.lang.NullPointerException when
trying to
 execute SQL statement.

 What is wrong ?? It looks like everytime the context is destroyed...
the
 hsqldb gets lock.

 The snippet code like below :
 ===

 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextListener;
 import javax.servlet.ServletContextEvent;

 import java.nio.channels.ClosedByInterruptException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.util.Random;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;

 public class ContextStartUp implements ServletContextListener {

 private ServletContext context = null;
 MyThread objThread = null;

 ResultSet rs = null;
 Connection conn = null;

 public void openDB()
 {

 try {
 conn = DriverManager.getConnection("jdbc:hsqldb:file:" +
 context.getRealPath("/data/testdb") + ";ifexists=true;shutdown=true;",
"sa",
 "phidmspassword");

 } catch (SQLException e) {
 e.printStackTrace();
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 }


 public void closeDB()
 {
 Statement stmt = null;
 try {
 if(conn!=null)
 {
 stmt = conn.createStatement();
 stmt.execute("SHUTDOWN COMPACT");
 stmt.close();
 conn.close();
 stmt = null;
 conn = null;
 }
 } catch (SQLException e) {
 e.printStackTrace();
 }
 }

 public class MyThread implements Runnable {

 int nomor = 0;

 Thread currentthread = null;

 public MyThread() {
 if (currentthread == null) {
 currentthread = new Thread(this);
 currentthread.setPriority(new Random().nextInt(5) + 1);
 currentthread.start();
 }
 }

 public void run() {
 Statement stmt = null;

 String sqltodo = "";
 Thread myThread = Thread.currentThread();

 while (myThread == currentthread) {
 try {
 stmt = conn.createStatement();

 if (stmt.execute("A select statement.. "))
 {
 rs = stmt.getResultSet();

 if (rs.next()) {
 ..
 }
 }


sqltodo = Update queries ..;

 stmt.executeUpdate(sqltodo);
 stmt.execute("SHUTDOWN");
 stmt.close();
 }
 else
 {
 stmt.close();
 }
 } catch (SQLException e) {
 e.printStackTrace();
 } catch (Exception e) {
 e.printStackTrace();
 } finally {
 stmt = null;
 }

 try {
 Thread.sleep(10);
 } catch (InterruptedException e) {
 }
 }
 }

 }

 public void initThread() {
 openDB();
 objThread = new MyThread();
 }

 public void stopThread() {
 objThread = null;
 closeDB();
 }

 public void contextDestroyed(ServletContextEvent event) {
 context = null;
 stopThread();
 }

 public void contextInitialized(ServletContextEvent event) {
 try {
 Class.forName("org.hsqldb.jdbcDriver").newInstance();
 } catch (InstantiationException e) {
 

RE: HSQLDB and Tomcat ServletContextListener

2006-09-21 Thread Awaneesh Shatmanyu
Hi Feris,

I am currently working with the HSQLDB for my project.
I had similar problem, which got solved.
1. Make sure your jdbc connection is closed every time.
2. Do not run you application as long as you are looking into the
HSQLDB,
   close the DB and then run the application.

Regards,
Awaneesh Shatmanyu

  
 
 
-Original Message-
From: Feris Thia [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 21, 2006 7:55 PM
To: Tomcat Users List
Subject: HSQLDB and Tomcat ServletContextListener

Dear All,

 I'm using HSQLDB as embedded in-process mode for my web application. I
used
 to schedule every 1 minutes to check on the HSQLDB database. I open the
db
 when context initialized and close it when context destroyed. But when
the
 context reloaded I always get Java.lang.NullPointerException when
trying to
 execute SQL statement.

 What is wrong ?? It looks like everytime the context is destroyed...
the
 hsqldb gets lock.

 The snippet code like below :
 ===

 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextListener;
 import javax.servlet.ServletContextEvent;

 import java.nio.channels.ClosedByInterruptException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.util.Random;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;

 public class ContextStartUp implements ServletContextListener {

 private ServletContext context = null;
 MyThread objThread = null;

 ResultSet rs = null;
 Connection conn = null;

 public void openDB()
 {

 try {
 conn = DriverManager.getConnection("jdbc:hsqldb:file:" +
 context.getRealPath("/data/testdb") + ";ifexists=true;shutdown=true;",
"sa",
 "phidmspassword");

 } catch (SQLException e) {
 e.printStackTrace();
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 }


 public void closeDB()
 {
 Statement stmt = null;
 try {
 if(conn!=null)
 {
 stmt = conn.createStatement();
 stmt.execute("SHUTDOWN COMPACT");
 stmt.close();
 conn.close();
 stmt = null;
 conn = null;
 }
 } catch (SQLException e) {
 e.printStackTrace();
 }
 }

 public class MyThread implements Runnable {

 int nomor = 0;

 Thread currentthread = null;

 public MyThread() {
 if (currentthread == null) {
 currentthread = new Thread(this);
 currentthread.setPriority(new Random().nextInt(5) + 1);
 currentthread.start();
 }
 }

 public void run() {
 Statement stmt = null;

 String sqltodo = "";
 Thread myThread = Thread.currentThread();

 while (myThread == currentthread) {
 try {
 stmt = conn.createStatement();

 if (stmt.execute("A select statement.. "))
 {
 rs = stmt.getResultSet();

 if (rs.next()) {
 ..
 }
 }


sqltodo = Update queries ..;

 stmt.executeUpdate(sqltodo);
 stmt.execute("SHUTDOWN");
 stmt.close();
 }
 else
 {
 stmt.close();
 }
 } catch (SQLException e) {
 e.printStackTrace();
 } catch (Exception e) {
 e.printStackTrace();
 } finally {
 stmt = null;
 }

 try {
 Thread.sleep(10);
 } catch (InterruptedException e) {
 }
 }
 }

 }

 public void initThread() {
 openDB();
 objThread = new MyThread();
 }

 public void stopThread() {
 objThread = null;
 closeDB();
 }

 public void contextDestroyed(ServletContextEvent event) {
 context = null;
 stopThread();
 }

 public void contextInitialized(ServletContextEvent event) {
 try {
 Class.forName("org.hsqldb.jdbcDriver").newInstance();
 } catch (InstantiationException e) {
 e.printStackTrace();
 } catch (IllegalAccessException e) {
 e.printStackTrace();
 } catch (ClassNotFoundException e) {
 e.printStackTrace();
 }

 context = event.getServletContext();

 initThread();
 }
 

RE: Problem with Tomcat upgrade to 5.0.28 from 4.x

2006-03-01 Thread Awaneesh Shatmanyu
Hi Nagendra,

 

I had the similar problem..its fine now..

You need to change the  in web.xml in Tomcat 5.x 

Please Follow below

 

In Tomcat 4.1...the web.xml had the following for
ActionServlet.



ActionServlet

 
com/NRI/TStar/servlets/ActionServlet



   

ActionServlet

/com/NRI/TStar/servlets/ActionServlet



 

When I upgraded it to Tomcat 5.x...the web.xml should be.for the
..



ActionServlet

 
com.NRI.TStar.servlets.ActionServlet





ActionServlet

/com/NRI/TStar/servlets/ActionServlet



 

Use .(dot) instead of /

I hope this should solve the probs...:-)

 

Regards,

Awaneesh Shatmanyu 

 

 

-Original Message-
From: Devireddy, Nagendra Reddy (STSD) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006 1:23 PM
To: Tomcat Users List
Subject: Problem with Tomcat upgrade to 5.0.28 from 4.x

 

Hi,

 

I have upgraded tomcat from 4.x to 5.0.

This is how I hv done the upgrade ..

I took backup of webapps/test_apps

Installed Tomcat 5.0 and 

Then I copied the test_apps to the new webapps

 

I have not changed any thing else ..

 

Tomcat is throwing class defination not found error .. But I searched

for the same class and its available in

test_apps/WEB-INF/lib/test_apps.jar 

 

Do we need to change web.xml ?? Or the same which was working with 4.0

will work here ??

 

Is there any extra configuration needs to be changed ??

 

Please help me ..

 

Thanks,

Nagendra

 

-

To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]

 

 


This email may contain confidential or privileged information for the 
intended recipient(s) and the views expressed in the same are not 
necessarily the views of Zensar Technologies Ltd. If you are not the intended 
recipient or have received this e-mail by error, its use is strictly 
prohibited, please delete the e-mail and notify the sender. Zensar 
Technologies Ltd. does not accept any liability for virus infected mails.



RE: Assistance required

2006-02-16 Thread Awaneesh Shatmanyu
Hi,

You can visit the site www.coreservlets.com , it will help to configure
the Tomcat.
You would be able to get the examples of server.xml and web.xml too.

Regards,
Awaneesh Shatmanyu



-Original Message-
From: Medha Parathasarathy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 16, 2006 11:29 AM
To: Tomcat Users List
Subject: Assistance required

Hi,

I am new to tomcat. I am trying to configure tomcat, jdbc and mysql. I
am facing problem in the configuration of jdbc. Can some body assist me
with a prototype of server.xml and web.xml

environement fedore core4 

regards


-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This email may contain confidential or privileged information for the 
intended recipient(s) and the views expressed in the same are not 
necessarily the views of Zensar Technologies Ltd. If you are not the intended 
recipient or have received this e-mail by error, its use is strictly 
prohibited, please delete the e-mail and notify the sender. Zensar 
Technologies Ltd. does not accept any liability for virus infected mails.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help me

2006-02-09 Thread Awaneesh Shatmanyu
Hi Mir,
The problem is because your using <%@ page import="" %> multiple
times...
Use only once like <%@ page
import="org.apache.commons...,org.apache." %>

Use commas to separate each importI think then it should work
fine.:-).

Regards,
Awaneesh

-Original Message-
From: Mir Kasim Ali [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 09, 2006 5:17 PM
To: users@tomcat.apache.org
Subject: Help me

I am getting following error
*
org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
Only a type can be imported.
org.apache.commons.fileupload.DiskFileUpload resolves to a package

Generated servlet error:
Only a type can be imported. org.apache.commons.fileupload.FileItem
resolves to a package

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
DiskFileUpload cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
DiskFileUpload cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
FileItem cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
FileItem cannot be resolved to a type
WHEN I AM COMPILING THE A JSP FILE(REQESTING THE JSP FILE THROUGH
BROWSER)
IN JSP I IMPORTED FOLLOWINGS
<%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
<%@ page import="org.apache.commons.fileupload.FileItem"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>

sO PLEASE HELP ME TO GET IT WORK.IS THIS ERROR IS DUE TO
CLASS PATH.IF YES THEN PLS SUGGEST ME WHAT PATH I SET FOR IT



This email may contain confidential or privileged information for the 
intended recipient(s) and the views expressed in the same are not 
necessarily the views of Zensar Technologies Ltd. If you are not the intended 
recipient or have received this e-mail by error, its use is strictly 
prohibited, please delete the e-mail and notify the sender. Zensar 
Technologies Ltd. does not accept any liability for virus infected mails.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help me

2006-02-09 Thread Awaneesh Shatmanyu

Hi Mir,
The problem is because your using <%page import="" %>  multiple
times...
Use only once like <% page
import="org.apache.commons...,org.apache." %>

Use commas to separate each importI think then it should work
fine.:-).

Regards,
Awaneesh

-Original Message-
From: Mir Kasim Ali [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 09, 2006 5:17 PM
To: users@tomcat.apache.org
Subject: Help me

I am getting following error
*
org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
Only a type can be imported.
org.apache.commons.fileupload.DiskFileUpload resolves to a package

Generated servlet error:
Only a type can be imported. org.apache.commons.fileupload.FileItem
resolves to a package

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
DiskFileUpload cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
DiskFileUpload cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
FileItem cannot be resolved to a type

An error occurred at line: 12 in the jsp file: /ProcessFileUpload.jsp
Generated servlet error:
FileItem cannot be resolved to a type
WHEN I AM COMPILING THE A JSP FILE(REQESTING THE JSP FILE THROUGH
BROWSER)
IN JSP I IMPORTED FOLLOWINGS
<%@ page import="org.apache.commons.fileupload.DiskFileUpload"%>
<%@ page import="org.apache.commons.fileupload.FileItem"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>

sO PLEASE HELP ME TO GET IT WORK.IS THIS ERROR IS DUE TO
CLASS PATH.IF YES THEN PLS SUGGEST ME WHAT PATH I SET FOR IT



This email may contain confidential or privileged information for the 
intended recipient(s) and the views expressed in the same are not 
necessarily the views of Zensar Technologies Ltd. If you are not the intended 
recipient or have received this e-mail by error, its use is strictly 
prohibited, please delete the e-mail and notify the sender. Zensar 
Technologies Ltd. does not accept any liability for virus infected mails.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



I want to subscribe

2006-02-09 Thread Awaneesh Shatmanyu
 


This email may contain confidential or privileged information for the 
intended recipient(s) and the views expressed in the same are not 
necessarily the views of Zensar Technologies Ltd. If you are not the intended 
recipient or have received this e-mail by error, its use is strictly 
prohibited, please delete the e-mail and notify the sender. Zensar 
Technologies Ltd. does not accept any liability for virus infected mails.