Re: Tomcat is stoping Urgent

2004-04-22 Thread Niki Ivanchev
IMHO it is problem with jdbc-odbc bridge. However Access and HDBC-ODBC 
aren't the best solution for a production system.
IMHO  they are worst.

Kiran Patel wrote:

Urgent!

I am using Tomcat 4.1 for my application which is accessing data from =
the Access database through the ODBC connection.  Everything was working =
fine until today.  Suddenly when I tried to enter some records in the =
data base through the application, Tomcat is stopped.  I got following =
error in the error log.  Please help me.
Kiran



An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at =
PC=3D0xC08FA3C
Function=3DSQLFetch+0x16EF
Library=3DC:\WINNT\system32\odbcjt32.dll
Current Java thread:
at sun.jdbc.odbc.JdbcOdbc.bindInParameterString(Native Method)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterString(JdbcOdbc.java:972)
at =
sun.jdbc.odbc.JdbcOdbcPreparedStatement.setChar(JdbcOdbcPreparedStatement=
.java:3106)
at =
sun.jdbc.odbc.JdbcOdbcPreparedStatement.setString(JdbcOdbcPreparedStateme=
nt.java:764)
at =
 



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


Re: UTF-8 encoding

2004-04-06 Thread Niki Ivanchev
Simply I don't get it. You send data over HTTP. You can send data as you 
wish. What about servlet serving images?
Just send UTF8 encoded data and everything will be allright.
No way Tomcat knows do you want to send cyrrilic letter or french accent 
letter. It's up to you.
Niki
Harry Mantheakis wrote:

Okay, thanks Yoav.

I got the source, and I can see what's happening - thanks to Google - at
this URL:
http://java.sun.com/blueprints/code/jps131/src/com/sun/j2ee/blueprints/encod
ingfilter/web/EncodingFilter.java.html
The 'doFilter' method sets the encoding for the *request* which does not
seem to address the original question, which was asking how to 'force tomcat
to send data in UTF-8 encoding'.
Interesting filter nevertheless! It is a subject that concerns me.

Kind regards

Harry

 

Hi,

   

implement a EncodingFilter class
   

Where's the interface?
 

javax.servlet.Filter is the interface.  He probably had
http://java.sun.com/blueprints/code/jps131/api/com/sun/j2ee/blueprints/e
ncodingfilter/web/EncodingFilter.html in mind.
Yoav Shapira
   



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


 




Re: Of .war and .jar files - and .jsp class files

2004-04-01 Thread Niki Ivanchev
Reading http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html
I have noticed this
quote
   * *Java location*: The installer will use the registry or the
 JAVA_HOME environment variable to determine the base path of the
 JDK or a JRE. If only a JRE (or an incorrect path) is specified,
 Tomcat will run but will be unable to compile JSP pages at
 runtime. Either all webapps will need to be precompiled (this can
 be easily done using the Tomcat deployer), or the |lib\tools.jar|
 file from a JDK installation must be copied to the |common\lib|
 path of the Tomcat installation.
/quote
So your solution is named Tomcat deployer
Hope this helps
Niki
Malcolm Warren wrote:

I am changing from Jrun to Tomcat and I have just one problem remaining.

Jrun gave an additional security possibility that I am unable to 
extend to Tomcat. In Jrun you do not need to place your .jsp files, 
nor the automatically generated .java files on your production server. 
I could simply .jar up the automatically generated .class files and 
place the .jar file in the /WEB-INF/jsp folder on the production server.

That way I had 3 big advantages:
1) Nobody could look into my .jsp files.
2) Nobody could look into my .java files for my .jsps
3) Compilation on the production server of the .jsps was already done. 
- Everything was ready in the single .jar file.

Now perhaps I am missing something, so please put me right. And I'm 
just starting now to use ant and I've never bothered with .war files 
because I don't distribute my programmes, they're just used on our 
production server.

If I create a .war file for the production server then the .war file 
contains no compiled .jsps, just the original .jsp files - is that right?
There seem to me to be obvious advantages to what I was able to do in 
Jrun - can I do something similar in Tomcat?
In general I get many more security features with Tomcat 4.1, than I 
did with Jrun 3.1, but this particular possibility seems to me to be a 
good one. I have tried creating .jar files of the Tomcat's /work 
directory but without any success.

Can anybody enlighten me? Thanks for any help.

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





Re: What's happening to my beans?

2004-03-31 Thread Niki Ivanchev
Just don't forged to synchronize the access to the singleton mehtods... 
in standalone application synchronization is not needed,
but in server side code it is vital.
Singleton is a class that may have zero or one instance only. It is 
achived with private constructor.

Charles Daniel wrote:

Thanks, I'll try google first to see what it's all about.

Thanks Again,

Charles
 - Original Message - 
 From: Shapira, Yoavmailto:[EMAIL PROTECTED] 
 To: Tomcat Users Listmailto:[EMAIL PROTECTED] 
 Sent: Tuesday, March 30, 2004 12:56 PM
 Subject: RE: What's happening to my beans?



 Hi,
 You can google for the exact definition of the singleton design pattern.
 In this case, you would write a singleton to hold all the beans, one per
 user, instead of putting them in the session object.  Because there will
 be only one instance of this singleton in the JVM, it will be shared by
 the non-SSL and SSL hosts.  Your JSP pages and servlets would get the
 user bean from this singleton instead of from the session.
 If you need specific code we'll be glad to help.

 Yoav Shapira
 Millennium Research Informatics
 -Original Message-
 From: Charles Daniel [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 30, 2004 1:53 PM
 To: Tomcat Users List
 Subject: Re: What's happening to my beans?
 
 Thanks Yoav, I've figured as much.  From my old C programming days I am
 well aware of scoping rules.  Yet I am still at a loss of how to solve
 this
 particular problem.  I'm not certain how to using a database would
 solve
 the problem and I'm not familiar with singleton. What is it and how can
 I
 use it.
 
 Thanks
 
 Charles
   - Original Message -
   From: Shapira, Yoavmailto:[EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
   To: Tomcat Users Listmailto:[EMAIL PROTECTED]mailto:[EMAIL PROTECTED]
   Sent: Tuesday, March 30, 2004 12:41 PM
   Subject: RE: What's happening to my beans?
 
 
 
   Hi,
   I think you can't have the same session for both SSL and non-SSL
   activity.  You get different sessions, each with its own bean, hence
 the
   behavior you describe.  Can you use a database?  A share singleton?
 
   Yoav Shapira
   Millennium Research Informatics
 
 
   -Original Message-
   From: Charles Daniel [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, March 30, 2004 1:37 PM
   To: [EMAIL PROTECTED]mailto:tomcatmailto:[EMAIL PROTECTED]mailto:tomcat-
 [EMAIL PROTECTED]
   Subject: What's happening to my beans?
   
   My installation is Apache2+Tomcat4+mod_ssl.  I am running a http
 main
   server along with a https virtual host on an aliased ip address.  To
   track
   users I created a session bean which holds user info ( e-mail, login
   status
   ).  Naturally this bean holds vital information as it allows links
 to
   the
   users transactions such as shopping cart transactions.
   
   The bean is accessible by both servers (same machine and application
   directory tree). The SSL enabled virtual host now serves my Login,
   Registration and Shopping Cart JSP's while the main server serves
 the
   non-
   secure pages.
   
   Before I implemented SSL the strategy of using a bean to track users
   was
   sound, but now it seems that the bean is not persistant between the
   main
   server and virtual host. My guess is that main server and the
 virtual
   host
   have their own version of the bean.  Therefore, the bean in my
 virtual
   host
   is out of scope once I navigate back to page controlled by the main
   server.
   The result is that the main server is left unaware if the user has
   logged
   in or whether or not the user has a shopping cart containing items.
   
   Is there a better strategy for communicating information like this
   between
   the main server and the virtual host. I am reluctant to try using
   cookies.
   
   I've tried the java.sun.com JSP forum with no success.  Maybe you
 guys
   can
   help even if this post is a little off subject for this forum.
 
 
 
   This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential,
 proprietary and/or privileged.  This e-mail is intended only for the
 individual(s) to whom it is addressed, and may not be saved, copied,
 printed, disclosed or used by anyone else.  If you are not the(an)
 intended
 recipient, please immediately delete this e-mail from your computer
 system
 and notify the sender.  Thank you.
 
 
   -
   To unsubscribe, e-mail: tomcat-user-
 [EMAIL PROTECTED]mailto:tomcat-usermailto:tomcat-user-
 [EMAIL PROTECTED]
   For additional commands, e-mail: tomcat-user-
 [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]mailto:[EMAIL PROTECTED]


 This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, 

Re: What is the the maximum characters that Tomcat can handle in a Se rvlet URL (doGet request) ?

2004-03-31 Thread Niki Ivanchev
As far as I remember 1024 is the limit of URL by RFC.
Niki
[EMAIL PROTECTED] wrote:

Hi,

What is Tomcat's limitation in getting requests through the URL - to use the
doGet method 
I.e if i run a Servlet, and i want to receive the request in the url ,what
is the the maximum characters i can get ?
Regards 
Yair Fine

 



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


Re: Of .war and .jar files - and .jsp class files

2004-03-31 Thread Niki Ivanchev
I think, he means that he can redistribute his application wihtout 
giving the person who will install the application on it's server the 
access to jps code.
Obviously no one can access jsp code via web server.
Niki

Shapira, Yoav wrote:

Hi,
You can precompile your JSPs and include the class files in the WAR.  In
addition, no one can see the compiled .java files for your JSPs anyways
because they're in tomcat's work directory, not in a web-accessible
location.
Yoav Shapira
Millennium Research Informatics
 

-Original Message-
From: Malcolm Warren [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 7:55 AM
To: Tomcat Users List
Subject: Re: Of .war and .jar files - and .jsp class files
Thank you very much for your answers, but they haven't quite hit the
   

mark
 

yet.

Every .jsp page in Tomcat, as we all know, is compiled in
/work/Standalone/localhost/ in an appropriate application folder e.g.
   

_
 

is the folder in the case of the ROOT application.
It's fine by me if this is done when I first access the page in a
   

browser
 

in my test environment.

Now when I transfer everything to my production server I would like to
eliminate all of the .jsp pages from the application, and all of the
   

.java
 

files, and just send a .jar file containing the .class files in
/work/Standalone/localhost/$applicationDir.
That way the compilation is already done, and nobody can study my .jsp
files. In theory I could just create a directory tree somewhere of
org/apache/jsp/ copy all the automatically generated .class files into
this directory tree and .jar it all up, and Tomcat should find them
   

either
 

in /WEB-INF/lib or in /work/Standalone/localhost/$applicationDir, but
   

it
 

doesn't.

Of course I could be missing the point entirely here, and I shouldn't
   

even
 

by thinking about doing these things, but as I say, in Jrun I could
   

send
 

the automatically generated .jsp .class files to the production
environment in a nice .jar file and I had more security because noone
could read the original .jsp files, although to be honest there aren't
   

any
 

people in my company who would be interested in reading them, but I
   

feel
 

more secure that way.

Any more enlightenment on this would be very helpful.

On Wed, 31 Mar 2004 06:00:22 -0600, QM [EMAIL PROTECTED] wrote:

   

On Wed, Mar 31, 2004 at 12:02:40PM +0200, Malcolm Warren wrote:
: Jrun gave an additional security possibility that I am unable to
extend to
: Tomcat. In Jrun you do not need to place your .jsp files, nor the
: automatically generated .java files on your production server. I
 

could
 

: simply .jar up the automatically generated .class files and place
 

the
 

.jar
: file in the /WEB-INF/jsp folder on the production server.
Tomcat does something similar:

- As one poster already mentioned, keep all of your jar files in
 WEB-INF/lib.
- make sure the JSPs are mapped to servlet paths in WEB-INF/web.xml.

(I'm out on a limb here, but it sounds as if Jrun automagically loads
your JSP jar file and creates the mappings for you.)
If the latter sounds like a pain in the rear, there are Ant tasks to
 

do
 

the precompilation for you and generate the web.xml snippet.

: If I create a .war file for the production server then the .war
 

file
 

: contains no compiled .jsps, just the original .jsp files - is that
right?
Not true.  The war file contains whatever you put in it.  JSPs,
 

images,
 

jars, whatever.

-QM

 

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





This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.

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


 




tomcat performance with 100 webapps

2004-03-30 Thread Niki Ivanchev
Have some one tested Tomcat with more than 100 webapps. For example 
e-commrece solution, without many bells and whistles - jsut shopbuilder 
and  sopiing cart
Each webapp is based on trubine/velocity/torque. Each webapp using it's 
own firebird database.
Can I expect smooth performance on dual xeon with raid controler and lot 
of RAM (16G) on RedHat EAS?
Niki
Icygen Co.

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


Re: tomcat performance with 100 webapps

2004-03-30 Thread Niki Ivanchev
God save our apps from any memory leaks.
Of course we will test them for this issue. And perform stress testing
20 sounds fair enought. Frankly I don't expect too much traffic per e-shop.
Niki
Shapira, Yoav wrote:

Hi,
We have tomcat instances that run ~20 webapps without a problem.  Beyond
that, we haven't tried, but then again that's why we have tools like
JMeter, no? ;)
In large part this will depend on the soundness of the application.
Especially if it's 100 of the same app, because then each memory leak
would be multiplied by 100.
Yoav Shapira
Millennium Research Informatics
 

-Original Message-
From: Niki Ivanchev [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 30, 2004 9:43 AM
To: Tomcat User
Subject: tomcat performance with 100 webapps
Have some one tested Tomcat with more than 100 webapps. For example
e-commrece solution, without many bells and whistles - jsut shopbuilder
and  sopiing cart
Each webapp is based on trubine/velocity/torque. Each webapp using it's
own firebird database.
Can I expect smooth performance on dual xeon with raid controler and
   

lot
 

of RAM (16G) on RedHat EAS?
Niki
Icygen Co.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   





This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.

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