Working fine on Tomcat 5.0 but not on 5.5.7

2005-03-07 Thread micky none
Hi Friends,
I have this simple method which works fine on my system(Tomcat 5.0,jdk 
1.5)..but not on the server(Tomcat 5.5.7,jdk1.5).Can someone explain me why:


-
String syear = null;
int selectedYear = 0;
try{
syear = request.getParameter(year);
  if (syear != null){
  selectedYear = Integer.parseInt(syear);
  session.setAttribute(syear_sess,new Integer(selectedYear));
  }
  else{
  if(session.getAttribute(syear_sess) != null)
selectedYear = ((Integer)session.getAttribute(syear_sess)).intValue();
  else
  {
syear = 2005;
selectedYear = Integer.parseInt(syear);
  }

}
}catch (IllegalArgumentException _e){
throw new Exception(selectedYear error);
}
--
year is a combo box name.The error this code throws is:

--
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 12 in the jsp file: /CheckPointsAwarded.jsp
Generated servlet error:
Type mismatch: cannot convert from Integer to int



org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)

org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

--

Please help.Thanks

DBCP Object not closed- urgent help reuired.

2005-03-02 Thread micky none
Hi friends,
i've a program that takes in date from the user in a text box.Everything works 
fine except the log files shows something like this:

--

(Http11Protocol.java:738)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
DBCP object created 2005-03-01 23:06:58 by the following code was never closed:
java.lang.Exception
at org.apache.commons.dbcp.AbandonedTrace.init(AbandonedTrace.java:96)
at org.apache.commons.dbcp.AbandonedTrace.init(AbandonedTrace.java:79)
at 
org.apache.commons.dbcp.DelegatingStatement.init(DelegatingStatement.java:60)
at 
org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:173)
at 
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.createStatement(PoolingDataSource.java:209)
at com.ResSet.getResultSet(ResSet.java:30)
at com.TournamentDollars.retArrayList(TournamentDollars.java:119)
at 
org.apache.jsp.BonusReleased_jsp._jspService(org.apache.jsp.BonusReleased_jsp:158)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service

--

whereas i am calling the close method at the end of my JSP,after i am finished 
with my data display.The close method that i call is:


---
 public void close()
  {
   try { results.close(); } catch (Exception ex) {}
   try { st.close(); } catch (Exception ex) {}
   try { con.close(); } catch (Exception ex) {}
  }



Please help me friends asap,it's really urgent for me,your help would be really 
appreciated.Waitin for your replies,
bye

tomcat 5.5.7 startup

2005-02-13 Thread micky none
Hi,
I am also having a somewat similar problem.I installed tomcat5.5.7 on my 
windows xp system through the *.exe file.The server starts and stops properly 
but i dont know why I am not able to see the index file.When i give the command 
http://localhost:8080/,it displays nothing.I even tried to ping localhost 
and that works.Can someone please tell me where I am goin wrong.
thanks


On Sun, 13 Feb 2005 PM wrote :
I discover from where came the trouble...
JAVA_HOME pointed on J2SDK 1.4.2 and not JDK 5.0.
i changed it and not the scripts are working...
thanks a lot for help.

but admin application doesn't work :(

Maileen


--- Ben Souther [EMAIL PROTECTED] wrote:

  Are you running with a full JDK or just a JRE?
 
 
  On Sun, 2005-02-13 at 08:17, P.M wrote:
   Hi,
  
   Based on information from people of this list, i
  tried
   to use the startup.bat file to start tomcat
  server...
   but it doesn't work...in fact it's worse than
  windows
   installation with services. at least service works
  and
   i can use tomcat server.
  
   The startup.bat file seems to not work correctly
  under
   windows XP SP2.
  
   Does anyone have the same problem than me or am i
  the
   only one ?
  
   i tried to uncompress the zip file of tomcat 5.5.7
   under C:\ or to place file under C:\tomcat5, but
   nothing changed...
  
   so what's wrong on my PC ?
  
   thx,
   Maileen
  
  
  
   __
   Do you Yahoo!?
   Yahoo! Mail - now with 250MB free storage. Learn
  more.
   http://info.mail.yahoo.com/mail_250
  
  
 
-
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
   For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
 
 
 
-
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
 
 




__
Do you Yahoo!?
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com

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



Type mismatch: cannot convert from long to Long

2005-02-01 Thread micky none
Hi Friends,
I went for help in the java forums,but I think you might help me better with 
this.I have a jsp that runs fine on my system,but when i upload it on the 
server it starts throwing this error:

Generated servlet error:
Type mismatch: cannot convert from long to Long

And the other thing is when i undeploy a war file on the server(5.5.7),the 
entry still remains there,altough the running status  turns to false...but on 
my system(5.0)..when i undeploy a file,the entry too is deleted.Might be,the 
server is not refllecting the changes i made to my JSP and loading the same old 
JSP.I dont know what the problem is and what to do??Can someone help me please??
Configuration:
Server-Tomcat 5.5.7
Jdk-1.5.0_01

My workstation:
Server-Tomcat 5.0
Jdk-1.5.0

My thead in the java forum is:
http://forum.java.sun.com/thread.jspa?threadID=591899tstart=0

Re: AW: Type mismatch: cannot convert from long to Long

2005-02-01 Thread micky none
thanks christoph,
I think the casting is fine...coz i have shown the code to the java guys.And 
even if i restart the server,the entries still remains there
and works fine...i.e its not undeploying it,thought it shows the message OK - 
Undeployed application at context path /xxx
And the other thing is when i restart the server it doesnt works properly 
unless i explictily kill the java processes.
And finally can you please tell me in which file the autodeploy=true entry 
goes.This work is really important for me,any help wud be appreciated



On Tue, 01 Feb 2005 [EMAIL PROTECTED] wrote :
autodeploying war files has to be configured in the webserver.
It seems that it isn't.
Perhaps you have an acces to the configurationfile of your productive
tomcat, than you can add the host element an attribute like autoDeploy=true,
else, try to restart the server.
The other thing, the exeption that you get, seems like a wrong
cast in your jsp.
Perhaps you have another version of tomcat than your provider.
So it could come to conflicts.


--
  BMW Group
  Herr Christoph Emmersberger
  Praktikant
  mailto: [EMAIL PROTECTED]
  Url: http://www.bmwgroup.de
--


 -Ursprüngliche Nachricht-
 Von: micky none [mailto:[EMAIL PROTECTED]
 Gesendet: Dienstag, 1. Februar 2005 15:29
 An: Tomcat Users List
 Betreff: Type mismatch: cannot convert from long to Long
 
 
 Hi Friends,
 I went for help in the java forums,but I think you might help
 me better with this.I have a jsp that runs fine on my
 system,but when i upload it on the server it starts throwing
 this error:
 
 Generated servlet error:
 Type mismatch: cannot convert from long to Long
 
 And the other thing is when i undeploy a war file on the
 server(5.5.7),the entry still remains there,altough the
 running status  turns to false...but on my system(5.0)..when
 i undeploy a file,the entry too is deleted.Might be,the server
 is not refllecting the changes i made to my JSP and loading
 the same old JSP.I dont know what the problem is and what to
 do??Can someone help me please??
 Configuration:
 Server-Tomcat 5.5.7
 Jdk-1.5.0_01
 
 My workstation:
 Server-Tomcat 5.0
 Jdk-1.5.0
 
 My thead in the java forum is:
 http://forum.java.sun.com/thread.jspa?threadID=591899tstart=0
 

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



I guess this is a BUG!!!

2005-02-01 Thread micky none

Can anyone please tell me if it's a BUGi think it is one.
I'm using Tomcat5.5.7 and i am not able to undeploy the file,it shows that the 
file is undeployed 
and loads the new file.But it still keeps showing the old file contents.Can 
anyone tell me what's the fix??
Secondly,the server does not restarts until I explicitly use the kill 
proccess_id for the java process.
Please enlighten me.

Specifying context details in web.xml

2005-01-31 Thread micky none
Hi Friends,
I need to ask you guys that is it possible that I can move the context details 
from my server.xml to web.xml.Like when i make a war,i want that i should 
specify the database url,driver,username,password etc. details .Presently i 
have 2 contexts(one for alpha databse other for the live one)in the server.xml 
file in the server.But i need these details in my web.xml.Can you tell me if I 
can do soany help would be appreciated.
Thanks

Dynamic Connection

2005-01-26 Thread micky none
Hi Friends,
I want to dynamically configure the database,username and password 
settings,instead of putting them in conf/server.xml.In other words,I dont know 
beforehand which database to use,
with which username and password.It all depends upon the person and the machine 
from which it tries to make a connection.In yet another words,I just need to do 
what the BasicDataSource is doing i.e get the 
connection details before making a connection.I am not quite sure if you got my 
point,but this is what i've been asked to do and I 
have no clue as to where to go or what to do.If anyone of you got my 
point,please help me.
Thanks

Re: Re: Dynamic Connection

2005-01-26 Thread micky none
Thanks David,
I am already using the Datasource class to vreate a connection.For eg.
Context ctx = (Context) init.lookup(java:comp/env);
ds = (DataSource) ctx.lookup(jdbc/abc);
The problem is that to know which database is selected I am trying to do 
exactly what the BasicDataSource class does,if that's possible.Is there any way 
by which I can read the environment variables that TOMCAT has setplease 
help.


On Thu, 27 Jan 2005 David Smith wrote :
Sounds like you can just about totally abandon the idea of using any pooling 
functions provided by DBCP.  If I were designing, I'd construct an object that 
implements javax.sql.DataSource and store it in the session as soon as you 
know what db is being used.  Then on each request, get the DS from the session 
and use it as needed.  Just be sure you only store the DS in the session -- 
don't store the connections.

I'm sure there are other ideas out there as well.

--David

micky none wrote:

Hi Friends,
I want to dynamically configure the database,username and password 
settings,instead of putting them in conf/server.xml.In other words,I dont 
know beforehand which database to use,
with which username and password.It all depends upon the person and the 
machine from which it tries to make a connection.In yet another words,I just 
need to do what the BasicDataSource is doing i.e get the connection details 
before making a connection.I am not quite sure if you got my point,but this 
is what i've been asked to do and I have no clue as to where to go or what to 
do.If anyone of you got my point,please help me.
Thanks
  

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



Packing web application

2005-01-25 Thread micky none
Hi Friends,
I have a application with the following file structure:
Tomcat5.0
  webapps
project
WEB-INF
  classes
   bean
 *.java files  
  web.xml 
*.jsp files  

I want to package in into a war.The more tutorials I go through the more 
confused I get.I tried using the ant-1.6.2 and in turn busted my server.I even 
followed a tutorial and tried:
catalina_home/webapps:/jar cvf project.war
But when I tried to rerun it onto different machine,it failed.Can someone 
please give me directions to the right and easy path.Any help would be 
appreciated.Thanks.

p.s:Someone even told me just make a project.zip and rename it to project.war 
and it should work.
  

Re: Packing web application

2005-01-25 Thread micky none
Hi Friends,
I am still waiting for your replies.I am also sendin you my web.xml file:
  ?xml version=1.0 encoding=ISO-8859-1 ? 
- web-app xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4
  display-nameTITLE/display-name 
  session-timeout30/session-timeout 
- servlet
  servlet-nameTR/servlet-name 
  servlet-classbean.TR/servlet-class 
  servlet-nameA1/servlet-name 
  servlet-classbean.A1/servlet-class 
  servlet-nameT1/servlet-name 
  servlet-classbean.T1/servlet-class 
  load-on-startup1/load-on-startup 
- init-param
  param-namename/param-name 
  param-valuevalue/param-value 
  /init-param
  /servlet
  /web-app 
 
When i try to do this:
C:\Tomcat 5.0\webapps\projectjar cvf project.war

It gives me the error:
'c' flag requires that input files be specified..
Please help me.





On Tue, 25 Jan 2005 micky none wrote :
Hi Friends,
I have a application with the following file structure:
Tomcat5.0
   webapps
 project
 WEB-INF
   classes
bean
  *.java files
   web.xml
 *.jsp files

I want to package in into a war.The more tutorials I go through the more 
confused I get.I tried using the ant-1.6.2 and in turn busted my server.I even 
followed a tutorial and tried:
catalina_home/webapps:/jar cvf project.war
But when I tried to rerun it onto different machine,it failed.Can someone 
please give me directions to the right and easy path.Any help would be 
appreciated.Thanks.

p.s:Someone even told me just make a project.zip and rename it to project.war 
and it should work.


Re: Re: Re: ConnectionPooling

2005-01-20 Thread micky none
Thanks Doug,Harry and rest of my friends,
After going thru the links ,I was able to make it work.Before I end this thread 
I just want to clarify some doubts.I am querying a database ,but I have some 
delay getting back the results.Now I want to check if the query is causing the 
delay or am I going wrong with allocating connections.So,I want to log all my 
program steps in a log file,can u just tell me what code I have to add and 
where?? Would this code help me??
Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_DBTest_log. suffix=.txt
timestamp=true/

Looking for these answers and thanks for your generous help.
cheers.



On Thu, 20 Jan 2005 Parsons Technical Services wrote :
People who have to figure out how to use other peoples work either have messy 
hair or are bald.

There are three main pages for reference:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/globalresources.html

Now the basics. There are four pieces to the puzzle.

I am going for a Global Setup.

First is the server.xml Resource and ResourceParams elements. It appears that 
you have these. Connects to the database and create a pool of connections.

Second is the web.xml entry for the resource-ref.

Third is the Resource link placed in the apps context.

Fourth is the calling of the resource from code.

When you say use to BasicDataSource to see thw no. of active connections  is 
this you application or something built into Tomcat?

Doug

- Original Message - From: micky none [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Wednesday, January 19, 2005 4:54 PM
Subject: Re: Re: ConnectionPooling


Tried that too my friend,isn't there any sure shot answer for this one..im 
like half mad after this...as of now.


On Thu, 20 Jan 2005 Harry Mantheakis wrote :
This may not help, but try swapping the order of the ResourceParams and
Resource elements in your 'server.xml' file.

Also, you seem to be declaring the DefaultContext element three times (!)
which seems wrong.

HTH

Harry Mantheakis


  Hi Friends,
  This is my first message on this list.I want to use the dbcp connection
  pooling.I set up the server.xml according to an example,but when i  
  trying to
  use to BasicDataSource to see thw no. of active connections it's  throwing
  errors.I tried searching a lot but to no use.If I go into the  
  administrator
  tool,it shows nothing there?I am using tomcat5.0..please tell me ..where  
  i am
  going wrong and if there is any other way to see the number of active
  connections.
 
 
  Here's my server.xml,please tell me if there's anything wrong with it:
 
  Logger className=org.apache.catalina.logger.FileLogger  
  directory=logs
  prefix=localhost_log. suffix=.txt timestamp=true /
  DefaultContext reloadable=true /
  DefaultContext path=/database docBase=database debug=0
  reloadable=true /
  - DefaultContext
  - ResourceParams name=jdbc/conversion
  - parameter
  nameusername/name
  value/value
  /parameter
  - parameter
  namepassword/name
  value/value
  /parameter
  - parameter
  namedriverClassName/name
  valuecom.ibm.db2.jcc.DB2Driver/value
  /parameter
  - parameter
  nameurl/name
  valuejdbc:db2j:net/value
  /parameter
  - parameter
  nameremoveAbandoned/name
  valuetrue/value
  /parameter
  - parameter
  nameremoveAbandonedTimeout/name
  value0/value
  /parameter
  - parameter
  namelogAbandoned/name
  valuetrue/value
  /parameter
  - parameter
  namemaxActive/name
  value1/value
  /parameter
  - parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  /ResourceParams
  Resource name=jdbc/conversion auth=Container  
  type=javax.sql.DataSource
  /
  /DefaultContext
  Loader className=org.apache.catalina.loader.WebappLoader
  loaderClass=org.apache.catalina.loader.WebappClassLoader  
  checkInterval=3
  /
  /Host
 
  please,please,please help me...its very urgent.


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




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



Logger file

2005-01-20 Thread micky none

Hi Friends,
I am using this file for outputting log data,can someone please tell me how to 
save this data to some file instead of outputting,so that I can have a look at 
it later on...
any help would be appreciated
 import org.apache.log4j.Logger;
 import org.apache.log4j.BasicConfigurator;


 public class MyApp {

   static Logger logger = Logger.getLogger(MyApp.class);

   public static void main(String[] args) {


 BasicConfigurator.configure();

 logger.info(Entering application.);
 System.out.println(Log file);

 logger.info(Exiting application.);
   }
 }


ConnectionPooling

2005-01-19 Thread micky none
Hi Friends,
This is my first message on this list.I want to use the dbcp connection 
pooling.I set up the server.xml according to an example,but when i trying to 
use to BasicDataSource to see thw no. of active connections it's throwing 
errors.I tried searching a lot but to no use.If I go into the administrator 
tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i am 
going wrong and if there is any other way to see the number of active 
connections.  


Here's my server.xml,please tell me if there's anything wrong with it:

Logger className=org.apache.catalina.logger.FileLogger directory=logs 
prefix=localhost_log. suffix=.txt timestamp=true / 
  DefaultContext reloadable=true / 
  DefaultContext path=/database docBase=database debug=0 
reloadable=true / 
- DefaultContext
- ResourceParams name=jdbc/conversion
- parameter
  nameusername/name 
  value/value 
  /parameter
- parameter
  namepassword/name 
  value/value 
  /parameter
- parameter
  namedriverClassName/name 
  valuecom.ibm.db2.jcc.DB2Driver/value 
  /parameter
- parameter
  nameurl/name 
  valuejdbc:db2j:net/value 
  /parameter
- parameter
  nameremoveAbandoned/name 
  valuetrue/value 
  /parameter
- parameter
  nameremoveAbandonedTimeout/name 
  value0/value 
  /parameter
- parameter
  namelogAbandoned/name 
  valuetrue/value 
  /parameter
- parameter
  namemaxActive/name 
  value1/value 
  /parameter
- parameter
  namefactory/name 
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value 
  /parameter
  /ResourceParams
  Resource name=jdbc/conversion auth=Container type=javax.sql.DataSource 
/ 
  /DefaultContext
  Loader className=org.apache.catalina.loader.WebappLoader 
loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3 / 
  /Host

please,please,please help me...its very urgent.

Re: Re: ConnectionPooling

2005-01-19 Thread micky none
Tried that too my friend,isn't there any sure shot answer for this one..im like 
half mad after this...as of now.


On Thu, 20 Jan 2005 Harry Mantheakis wrote :
This may not help, but try swapping the order of the ResourceParams and
Resource elements in your 'server.xml' file.

Also, you seem to be declaring the DefaultContext element three times (!)
which seems wrong.

HTH

Harry Mantheakis


  Hi Friends,
  This is my first message on this list.I want to use the dbcp connection
  pooling.I set up the server.xml according to an example,but when i trying to
  use to BasicDataSource to see thw no. of active connections it's throwing
  errors.I tried searching a lot but to no use.If I go into the administrator
  tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i 
  am
  going wrong and if there is any other way to see the number of active
  connections.
 
 
  Here's my server.xml,please tell me if there's anything wrong with it:
 
  Logger className=org.apache.catalina.logger.FileLogger directory=logs
  prefix=localhost_log. suffix=.txt timestamp=true /
  DefaultContext reloadable=true /
  DefaultContext path=/database docBase=database debug=0
  reloadable=true /
  - DefaultContext
  - ResourceParams name=jdbc/conversion
  - parameter
  nameusername/name
  value/value
  /parameter
  - parameter
  namepassword/name
  value/value
  /parameter
  - parameter
  namedriverClassName/name
  valuecom.ibm.db2.jcc.DB2Driver/value
  /parameter
  - parameter
  nameurl/name
  valuejdbc:db2j:net/value
  /parameter
  - parameter
  nameremoveAbandoned/name
  valuetrue/value
  /parameter
  - parameter
  nameremoveAbandonedTimeout/name
  value0/value
  /parameter
  - parameter
  namelogAbandoned/name
  valuetrue/value
  /parameter
  - parameter
  namemaxActive/name
  value1/value
  /parameter
  - parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  /ResourceParams
  Resource name=jdbc/conversion auth=Container 
  type=javax.sql.DataSource
  /
  /DefaultContext
  Loader className=org.apache.catalina.loader.WebappLoader
  loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3
  /
  /Host
 
  please,please,please help me...its very urgent.


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