Manager Deployer and build.xml

2007-07-23 Thread Sangoi, Nehal (Gexpro, consultant)
Hi
 
I have implemented manager-deployer config in my tomcat 5.5.23 setup.
And using ant for my build.xml to deploy webapps. I am recieveing below
errors while deployment of one of my applications named :custdash .
 
deploy:
 
BUILD FAILED
/opt/apps/custdash/home/build/build.xml:107: java.io.IOException: Server
returned HTTP response code: 403 for URL:
http://10.33.9.71:7181/manager/deploy?path=%2Fcustdashupdate=true
 
Total time: 26 seconds

 
 
For such kind of errors, i found a thread like, 
http://www.oneofthosedays.org.uk/archives/2005/09/18/deploying-java-apps
-to-tomcat-via-ant/
 
Well, I did not find ReloadTask.java file on my server.
 
What could be remedy to this problem?
 
 
 
Thanks
Nehal
 
 


Cluster monitoring

2007-07-23 Thread Mark Faircloth
Hi,

 

We have been monitoring Tomcat 5.5 clusters with LambdaProbe but this
doesn't work with Tomcat 6. It appears that the JMX MBeans list no
longer contains any Catalina:type=Cluster objects that Probe uses,
despite the Tomcat documentation saying they are there.

 

Have they been removed, are they hidden or replaced by something else?

 

Any clues welcome.

 

Mark



Connaught wins RoSPA Gold Award for fifth year running 

Considerate Contractor Gold Award in 2006 

Partnering Contractor of the Year Award in 2005 

Please visit our website to see a full list of Connaught's Registered Companies 
www.connaught.plc.uk/Investors/Registered-Companies 
  
Disclaimer: 
The information transmitted is intended only for the person or entity to which 
it is addressed and may contain confidential and/or privileged material. Any 
review, retransmission, dissemination or other use of, or taking of any action 
in reliance upon, this information by persons or entities other than the 
intended recipient is prohibited. If you received this in error, please contact 
the sender and delete this message. 
Connaught plc, Head Office 01392 444546 


Re: MySql Connector

2007-07-23 Thread Pid

Mohammed Zabin wrote:
Thank you, what about testing the connection, i am afraid that the test 
code

is the reason:


Looks fine.  Your log error messages?


Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);
 DataSource ds = (DataSource)envContext.lookup(jdbc/TestMySql);
 Connection conn = ds.getConnection();

 out.println(Connection Established);

what is java:/comp/env??


(Please just reply to the list, not me as well)

An explanation for the policy behind naming JNDI environment variables 
is here:


http://java.sun.com/products/jndi/tutorial/beyond/misc/policy.html




p



On 7/22/07, Pid [EMAIL PROTECTED] wrote:


You can define either:

a) Resource inside a Context - either in META-INF/context.xml or
host/appname.xml

b) ResourceLink inside a Context (as above) referring to a global
Resource defined in server.xml.

You're doing both at the moment, so one of them isn't being used,
depending on where you placed the Resource in server.xml.

Just defining a Resource inside your META-INF/context.xml and the
corresponding WEB-INF/web.xml reference should be sufficient.



p




Mohammed Zabin wrote:
 Would you please be more specific? which file you mean? I have created
 Oracel connection Pool as the stated way above, and it's worked fine,
shall
 i put resource defeninitoin in context.xml only?

 On 7/22/07, Pid [EMAIL PROTECTED] wrote:

 You only need one resource definition.
 You only need a resource link definition if your resource is a global
 one.

 Simplify your configuration and then post the error message from the
 logs so we can see Tomcat says is wrong.

 p


 Mohammed Zabin wrote:
  Hi All
 
  I have confiured oracle connection pool on my tomacat 6, and it
worked
  fine.
  When i came to configure MySql, I repeated the same steps for Oracle
  databse, with considering the specfication of MySql database. But
it's
  didn't work. Any Help please about configuring MySql,
  I downloaded MySql connector from mysql website and place it in
  CATALINA_HOME/lib directory, and i put the following:
 
  1. in server.xml file:
  Resource name=jdbc/TestMySql auth=Container
  type=javax.sql.DataSource
maxActive=100 maxIdle=30 maxWait=1
username=* password=* driverClassName=
  com.mysql.jdbc.Driver
 
  url=jdbc:mysql://localhost:3306/exam?autoReconnect=true/
 
  2. in web.xml file
  resource-ref
   descriptionOracle Datasource example/description
   res-ref-namejdbc/TestMySql/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
  /resource-ref
 
  3. in context.xml file (on server's context.xml file):
  Resource name=jdbc/TestMySql auth=Container
  type=javax.sql.DataSource
 maxActive=100 maxIdle=30 maxWait=1
 username=* password=* driverClassName=
  com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/exam/
 
  4. in cotext.xml file ( In my web application's context.xml file):
  ResourceLink global=jdbc/TestMySql name=jdbc/TestMySql type=
  javax.sql.DataSource/
 
  Any Help please?
 













smime.p7s
Description: S/MIME Cryptographic Signature


Bean and Servlet

2007-07-23 Thread Mohammed Zabin

Hi All
What is the best way to pass a list collection from a Bean to a Servlet?
Thank you


Re: My error-pages does not show in IE7 everything worked in IE 4 - IE6

2007-07-23 Thread David Delbecq
in IE6 there was a configuration option to let IE handle error
messages. If this was active, error page from server would be replaced
by a custom non informative IE page. This may be activated in your IE7.

En l'instant précis du 23/07/07 11:32, Søren Blidorf s'exprimait en ces
termes:
 Hi.

  

 Does anybody know why my error-pages does not show in IE7 everything worked
 in IE 4 – IE6

  

  

 Web.xml:

   error-page

 error-code500/error-code

 location/error?error=500/location

   /error-page

   error-page

 error-code404/error-code

 location/error?error=404/location

   /error-page

   error-page

 error-code403/error-code

 location/error?error=403/location

   /error-page

   error-page

 error-code400/error-code

 location/error?error=400/location

   /error-page

   error-page

 error-code408/error-code

 location/error?error=408/location

   /error-page

   error-page

 exception-typejava.lang.NullPointerException/exception-type

 location/error?error=NullPointerException/location

   /error-page

   error-page

 exception-typejava.net.UnknownHostException/exception-type

 location/error?error=UnknownHostException/location

   /error-page

  

 BR

  

 Soren, DK


   


-- 
http://www.noooxml.org/


-
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: Tomcat access log question

2007-07-23 Thread Tim Funk
Extend or copy (and change) the appropriate AccessLogValve. Then place 
the (changed or new) files into the server/lib or server/classes 
directory as needed. (tomcat 5 speak)


Then add to server.xml (or appropriate) the new access log class.

-Tim

John Hui wrote:

Does this mean I need to get the source for Tomcat and change the
org/apache/catalina/valves/AccessLogValve.java.  Then build and use my own
version of Tomcat.

Or is there a way that I somehow create my own
org/apache/catalina/valves/AccessLogValve.java or class and put it in a
directory in my Tomcat environment and modify the server.xml to point to my
customer AccessLogValve.

I'm very new to tomcat so any help or link to how to do this would help a
lot!

Thanks for taking the time to respond to my question!

John

On 7/21/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:


 From: John Hui [mailto:[EMAIL PROTECTED]
 Subject: Re: Tomcat access log question

 I am actually not permitted to store any of these
 confidential information any where including ( the
 access logs ).

Due to the rather specialized nature of your requirements, your best bet
may well be to use your own access logger, extending the Tomcat-supplied
one.  That way you can strip out or mask the confidential information
without worrying about who has read access to the logs.  Just override
the invoke() method of whichever access log valve you're using:
org/apache/catalina/valves/AccessLogValve.java
org/apache/catalina/valves/ExtendedAccessLogValve.java
org/apache/catalina/valves/FastCommonAccessLogValve.java




-
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: WebDav - mapping question?

2007-07-23 Thread Johnny Kewl

For future reference the WEBDAV problems between Microsoft and Tomcat
seem to be as follows
First thanks for pointing me to the MS patch, although like the other poster
said... it didnt help, or maybe it did, but only on the MS side.

 MICROSOFT doesnt like the lagging folder slash 
Tomcats mapping wants you to use a slash at the end ie webapp/webdav/
When the MS webfolder client sends a request, it drops that lagging
slash and tomcat promptly tells it to get lost see below for actual
web conversations

Ok... this is not too big a problem to solve... I created a servlet mapped
to
/webapp/webdav/start   (no lagging slash) and dispatched the requests off to
/webapp/webdav/
This solves the lagging slash problem... so now MS and tomcat will actually
talk

 Tomcat thinks Microsoft is an alien **

But unfortunately, tomcat thinks microsoft is asking stupid questions and
really craps all
over MS. PROPFIND is not defined in RFC 2068 go play with yourself
MS ;)

It (PROPFIND) does actually seem to be defined in
http://www.ietf.org/rfc/rfc2518.txt
and it seems MS was the main modifier of the RFC

So there you have it RFC 2068 is now too old because it seems MS
just had the spec changed and didnt bother with any compatibility... like
role back to 2068 if a new feature failed.
I dont know anything about webdav, it could be the old rfc was impossible to
make work with the system shell, or they just figured, stuff it, we the
desktop standard anyway, we'll do it our way. hey Bill, change the spec
;)... who knows?

Anyway it seems 2 things need to happen tomcat needs to be brought up to
the current rfc, and all MS users out there beg the developer to please
allow it to work with and without the lagging slash then I think life
will be good in webdav lane ;)

As it stands it will never work with MS

=== Here is the lagging slash problem web conversation ==

PROPFIND /TestRemoteIp/webdav HTTP/1.1   (MICROSOFT drops the slash)

Content-Language: en-us

Accept-Language: en-za, en-us;q=0.2

Content-Type: text/xml

Translate: f

Depth: 1

Content-Length: 489

User-Agent: Microsoft Data Access Internet Publishing Provider DAV

Host: hplt1:8080

Connection: Keep-Alive



?xml version=1.0 encoding=UTF-8 ?

a:propfind xmlns:a=DAV: xmlns:b=urn:schemas-microsoft-com:datatypes

a:prop

a:name/

a:parentname/

a:href/

a:ishidden/

a:isreadonly/

a:getcontenttype/

a:contentclass/

a:getcontentlanguage/

a:creationdate/

a:lastaccessed/

a:getlastmodified/

a:getcontentlength/

a:iscollection/

a:isstructureddocument/

a:defaultdocument/

a:displayname/

a:isroot/

a:resourcetype/

/a:prop

/a:propfind


HTTP/1.1 404 /webdav

Server: Apache-Coyote/1.1

Content-Type: text/html;charset=utf-8

Content-Length: 973

Date: Mon, 23 Jul 2007 09:40:55 GMT

htmlheadtitleApache Tomcat/5.5.23 - Error report/titlestyle!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}HR {color : #525D76;}--/style
/headbodyh1HTTP Status 404 - /webdav/h1HR size=1
noshade=noshadepbtype/b Status report/ppbmessage/b
u/webdav/u/ppbdescription/b uThe requested resource (/webdav)
is
not available./u/pHR size=1 noshade=noshadeh3Apache
Tomcat/5.5.23/h3/body/html
==

=== Here is the dont ask stupid questions conversation==

PROPFIND /TestRemoteIp/webdav/start HTTP/1.1

Content-Language: en-us

Accept-Language: en-za, en-us;q=0.5

Content-Type: text/xml

Translate: f

Depth: 0

Content-Length: 0

User-Agent: Microsoft Data Access Internet Publishing Provider DAV

Host: hplt1:8080

Connection: Keep-Alive

Cookie: JSESSIONID=6AF6D3D8CB24D0311A4641068C4AA21D




HTTP/1.1 501 Method PROPFIND is not defined in RFC 2068 and is not supported
by the Servlet API

Server: Apache-Coyote/1.1

Content-Type: text/html;charset=utf-8

Content-Length: 1238

Date: Mon, 23 Jul 2007 09:29:35 GMT

Connection: close


(MICROSOFT is told that it cant talk webdav 2068)
htmlheadtitleApache Tomcat/5.5.23 - Error report/titlestyle!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B

Tags and Servlets

2007-07-23 Thread Mohammed Zabin

Hi all

I am trying to pass an object from a tag to a servlet. i did the following,

1. In the tag class, i put:

pageContext.getRequest().setAttribute(QList, list);



The above Tag will go to a servlet, i need to read the above request
attribute in the servlet, how can i do this?, i tried

ListInteger list = (ListInteger)request.getAttribute(QList);

, but when i tried to access the read list, it gave me NullPointerException,


any help please

Jotnarta


Re: WebDav - mapping question?

2007-07-23 Thread David Delbecq
Have never used the tomcat webdav servlet. I use the slide webdav
servlet. I thought i needed to correct your suppositions and mistakes in
handling protocol.
En l'instant précis du 23/07/07 12:31, Johnny Kewl s'exprimait en ces
termes:
 For future reference the WEBDAV problems between Microsoft and Tomcat
 seem to be as follows
 First thanks for pointing me to the MS patch, although like the other
 poster
 said... it didnt help, or maybe it did, but only on the MS side.

  MICROSOFT doesnt like the lagging folder slash 
 Tomcats mapping wants you to use a slash at the end ie webapp/webdav/
 When the MS webfolder client sends a request, it drops that lagging
 slash and tomcat promptly tells it to get lost see below for
 actual
 web conversations
Tomcat should not refuse webapp/webdav if you have a mapping to
/webdav/*. It should at least dispatch to servlet mapped on /webdav/*. I
have a slide webdav servlet mapped to /DAV/* and MS webfolder can mount
it without major troubles. However, maybe the tomcat servlet does not
recognize request properly when there is no trailing slashes. Then it
should be fixed to handle properly the root.

 Ok... this is not too big a problem to solve... I created a servlet
 mapped
 to
 /webapp/webdav/start   (no lagging slash) and dispatched the requests
 off to
 /webapp/webdav/
 This solves the lagging slash problem... so now MS and tomcat will
 actually
 talk

  Tomcat thinks Microsoft is an alien **

 But unfortunately, tomcat thinks microsoft is asking stupid questions and
 really craps all
 over MS. PROPFIND is not defined in RFC 2068 go play with
 yourself
 MS ;)

 It (PROPFIND) does actually seem to be defined in
 http://www.ietf.org/rfc/rfc2518.txt
 and it seems MS was the main modifier of the RFC
You redirecting servlet does not handle the propfind method. You
probably only implemented GET/POST in your servlet. Other methods are
handled by the default generic servlet behaviour which is some sort of
unrecognized command message. To handle all kind of http methods in
your servlet, override the following method:
protected  void service(HttpServletRequest req, HttpServletResponse
resp)
  Receives standard HTTP requests from the public service method
and dispatches them to the doXXX methods defined in this class.
It's not tomcat container job's to handle rfc2518 but it's the servlet's
job.

 So there you have it RFC 2068 is now too old because it seems MS
 just had the spec changed and didnt bother with any compatibility... like
 role back to 2068 if a new feature failed.
You get it wrong, 2068, is simple http (GET/POST/PUT/OPTIONS). 2518 is
WEBDAV protocol (PROPFIND, PROPPATCH, multi status responses, etc). No
webdav client would be able to handle a simple http server. It need
webdav commands to be available and server to send proper webdav
responses. That has nothing to do with MS.
 I dont know anything about webdav, it could be the old rfc was
 impossible to
 make work with the system shell, or they just figured, stuff it, we the
 desktop standard anyway, we'll do it our way. hey Bill, change the
 spec
 ;)... who knows?

 Anyway it seems 2 things need to happen tomcat needs to be brought
 up to
 the current rfc, and all MS users out there beg the developer to please
 allow it to work with and without the lagging slash then I think life
 will be good in webdav lane ;)

 As it stands it will never work with MS
webdav servlet should be able to respond to requests without trailing
slashes. If not it should be fixed. There is no reason webapp/webdav/
and webapp/webdav would provide different responses.
 snip


-- 
http://www.noooxml.org/


-
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: My error-pages does not show in IE7 everything worked in IE 4 - IE6

2007-07-23 Thread Mark Deneen

In addition, there is a minimum page length required for IE to show
your custom error pages.  If your error page is less than 512 bytes,
the friendly error page will be shown.

http://support.microsoft.com/kb/294807

Mark

On 7/23/07, David Delbecq [EMAIL PROTECTED] wrote:

in IE6 there was a configuration option to let IE handle error
messages. If this was active, error page from server would be replaced
by a custom non informative IE page. This may be activated in your IE7.

En l'instant précis du 23/07/07 11:32, Søren Blidorf s'exprimait en ces
termes:
 Hi.



 Does anybody know why my error-pages does not show in IE7 everything worked
 in IE 4 – IE6





 Web.xml:

   error-page

 error-code500/error-code

 location/error?error=500/location

   /error-page

   error-page

 error-code404/error-code

 location/error?error=404/location

   /error-page

   error-page

 error-code403/error-code

 location/error?error=403/location

   /error-page

   error-page

 error-code400/error-code

 location/error?error=400/location

   /error-page

   error-page

 error-code408/error-code

 location/error?error=408/location

   /error-page

   error-page

 exception-typejava.lang.NullPointerException/exception-type

 location/error?error=NullPointerException/location

   /error-page

   error-page

 exception-typejava.net.UnknownHostException/exception-type

 location/error?error=UnknownHostException/location

   /error-page



 BR



 Soren, DK





--
http://www.noooxml.org/


-
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: Bean and Servlet

2007-07-23 Thread Johnny Kewl

Hi Mohammed,
Cant say I really understand the question

In general this is what the Session Objects are for
So say you have a servlet and a JSP page and say the servlet makes the
bean with the Array List in it then if you

session.setAttribute(MyBean, MyBean);

you can get it (MyBean) back when the next call comes into say the JSP
page

Now if you read up on this you will see you can also set 'request'
objects and these are good for when you say dispatch a request to a JSP
page from the servlet and want to pass a bean across.

Anyway...  if you just google for servlet session and setAttribute you
will be on your way... I think ;)
This area of servlet programming is one of the things that make it such a
powerful technology.
Have fun...

- Original Message - 
From: Mohammed Zabin [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, July 23, 2007 11:18 AM
Subject: Bean and Servlet



Hi All
What is the best way to pass a list collection from a Bean to a Servlet?
Thank you




-
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: Bean and Servlet

2007-07-23 Thread Mohammed Zabin

Thank you Johnny,
To be specific this is my question
Hi all

I am trying to pass an object from a tag to a servlet. i did the following,

1. In the tag class, i put:

pageContext.getRequest().setAttribute(QList, list);



The above Tag will go to a servlet, i need to read the above request
attribute in the servlet, how can i do this?, i tried

ListInteger list = (ListInteger)request.getAttribute(QList);

, but when i tried to access the read list, it gave me
NullPointerException...What do u think?


On 7/23/07, Johnny Kewl [EMAIL PROTECTED] wrote:


Hi Mohammed,
Cant say I really understand the question

In general this is what the Session Objects are for
So say you have a servlet and a JSP page and say the servlet makes the
bean with the Array List in it then if you

session.setAttribute(MyBean, MyBean);

you can get it (MyBean) back when the next call comes into say the JSP
page

Now if you read up on this you will see you can also set 'request'
objects and these are good for when you say dispatch a request to a
JSP
page from the servlet and want to pass a bean across.

Anyway...  if you just google for servlet session and setAttribute
you
will be on your way... I think ;)
This area of servlet programming is one of the things that make it such a
powerful technology.
Have fun...

- Original Message -
From: Mohammed Zabin [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, July 23, 2007 11:18 AM
Subject: Bean and Servlet


 Hi All
 What is the best way to pass a list collection from a Bean to a Servlet?
 Thank you



-
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: Bean and Servlet

2007-07-23 Thread David Smith
Typical design is servlet forwarding to jsp for view.  Tags being jsp 
elements occur after servlets have executed.  So you can see how your 
problem is a little curious in that jsps don't typically forward to 
servlets.  If you are forwarding a request from jsp to servlet, let us know.


However if you are storing a object in a request during jsp execution 
intending it to be available to the servlet on the next request, that 
doesn't work.  The request is cleared and recycled when jsps finish 
writing to the client.  When a new request comes in, the request 
attribute list is empty.  If you need this list to live between 
requests, you need to place it in the session.


--David

Mohammed Zabin wrote:


Thank you Johnny,
To be specific this is my question
Hi all

I am trying to pass an object from a tag to a servlet. i did the 
following,


1. In the tag class, i put:

pageContext.getRequest().setAttribute(QList, list);



The above Tag will go to a servlet, i need to read the above request
attribute in the servlet, how can i do this?, i tried

ListInteger list = (ListInteger)request.getAttribute(QList);

, but when i tried to access the read list, it gave me
NullPointerException...What do u think?


On 7/23/07, Johnny Kewl [EMAIL PROTECTED] wrote:



Hi Mohammed,
Cant say I really understand the question

In general this is what the Session Objects are for
So say you have a servlet and a JSP page and say the servlet 
makes the

bean with the Array List in it then if you

session.setAttribute(MyBean, MyBean);

you can get it (MyBean) back when the next call comes into say the JSP
page

Now if you read up on this you will see you can also set 'request'
objects and these are good for when you say dispatch a request to a
JSP
page from the servlet and want to pass a bean across.

Anyway...  if you just google for servlet session and setAttribute
you
will be on your way... I think ;)
This area of servlet programming is one of the things that make it 
such a

powerful technology.
Have fun...

- Original Message -
From: Mohammed Zabin [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, July 23, 2007 11:18 AM
Subject: Bean and Servlet


 Hi All
 What is the best way to pass a list collection from a Bean to a 
Servlet?

 Thank you



-
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: My error-pages does not show in IE7 everything worked in IE 4 - IE6

2007-07-23 Thread Asensio, Rodrigo
Do you have turned off the advanced option in IE

{x} Show friendly error pages 

??

-Original Message-
From: Søren Blidorf [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 23, 2007 5:32 AM
To: [EMAIL PROTECTED]
Subject: My error-pages does not show in IE7 everything worked in IE 4 - IE6

Hi.

 

Does anybody know why my error-pages does not show in IE7 everything worked in 
IE 4 - IE6

 

 

Web.xml:

  error-page

error-code500/error-code

location/error?error=500/location

  /error-page

  error-page

error-code404/error-code

location/error?error=404/location

  /error-page

  error-page

error-code403/error-code

location/error?error=403/location

  /error-page

  error-page

error-code400/error-code

location/error?error=400/location

  /error-page

  error-page

error-code408/error-code

location/error?error=408/location

  /error-page

  error-page

exception-typejava.lang.NullPointerException/exception-type

location/error?error=NullPointerException/location

  /error-page

  error-page

exception-typejava.net.UnknownHostException/exception-type

location/error?error=UnknownHostException/location

  /error-page

 

BR

 

Soren, DK


This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law.  If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system.  If you
have any questions about this e-mail please notify the sender
immediately.

-
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: MySql Connector

2007-07-23 Thread David Smith

A few things to consider:

1. Either place your Resource definition in server.xml as a 
GlobalResource *OR* in your webapp's context.xml file.


2. If you have the Resource defined in the GlobalResources, that's the 
only time you need to use a ResourceLink element in context.xml.


3. Drop the autoReconnect parameter in your mysql URL.  It has it's 
uses, but not in a pooled environment.


4. You should probably be attempting to use the path 
java:comp/env/jdbc/TestMySQL (note the lack of a '/' before comp) as 
described in the JNDI howto on tomcat's website.  I think I saw you 
using java:/comp/env/jdbc/TestMySQL in one of your posts.


5. Please post relevant messages from your logs if this isn't working.

--David

Mohammed Zabin wrote:


Would you please be more specific? which file you mean? I have created
Oracel connection Pool as the stated way above, and it's worked fine, 
shall

i put resource defeninitoin in context.xml only?

On 7/22/07, Pid [EMAIL PROTECTED] wrote:



You only need one resource definition.
You only need a resource link definition if your resource is a global 
one.


Simplify your configuration and then post the error message from the
logs so we can see Tomcat says is wrong.

p


Mohammed Zabin wrote:
 Hi All

 I have confiured oracle connection pool on my tomacat 6, and it worked
 fine.
 When i came to configure MySql, I repeated the same steps for Oracle
 databse, with considering the specfication of MySql database. But it's
 didn't work. Any Help please about configuring MySql,
 I downloaded MySql connector from mysql website and place it in
 CATALINA_HOME/lib directory, and i put the following:

 1. in server.xml file:
 Resource name=jdbc/TestMySql auth=Container
 type=javax.sql.DataSource
   maxActive=100 maxIdle=30 maxWait=1
   username=* password=* driverClassName=
 com.mysql.jdbc.Driver

 url=jdbc:mysql://localhost:3306/exam?autoReconnect=true/

 2. in web.xml file
 resource-ref
  descriptionOracle Datasource example/description
  res-ref-namejdbc/TestMySql/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
 /resource-ref

 3. in context.xml file (on server's context.xml file):
 Resource name=jdbc/TestMySql auth=Container
 type=javax.sql.DataSource
maxActive=100 maxIdle=30 maxWait=1
username=* password=* driverClassName=
 com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/exam/

 4. in cotext.xml file ( In my web application's context.xml file):
 ResourceLink global=jdbc/TestMySql name=jdbc/TestMySql type=
 javax.sql.DataSource/

 Any Help please?









-
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: OracleConnectionPoolDataSource

2007-07-23 Thread Julio J. Suárez Salinero

Zdeněk Vráblík escribió:

Hi,


4. I use OracleConnectionPoolDataSource because with
javax.sql.DataSource it doesn't close correctly close connections from
pool and server got to hang up.


Have you got any exception?

It throwed Closed Statement, Exhausted Resultset and 
NullPointerException, but only when I do stress test. If I browse page 
with navigator it works correctly and throws no exceptions.


This is my resource:

Resource name=IC
auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
user=IC
password=IC
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@192.168.100.119:1521:orcl

maxActive=20 maxIdle=10 maxwait=-1/ 
and this is my java code I use

try
{
// Look up the data source on the JNDI tree
DataSource ds = (DataSource) ctxt.lookup(java:/comp/env/ + poolName);


if (ds instanceof OracleDataSource)
{
log.debug(oracleDatasource found);
}

conn = ds.getConnection();

if (conn instanceof OracleConnection)
{
log.debug( OracleConnection - delegated );
}
}
catch ( Exception ex )
{
log.error( classId + Error getting Oracle Connection., ex );
throw ex;
}

With OracleDataSource instead of OracleConnectionPoolDataSource I can 
use user and password in the context, but when I run stress test 
with 10 users, I see it uses more connections than I put in context (It 
uses one per user and I put 8 in the context). It's seems not to respect 
the pool. And it throws no exceptions.

What jdbc driver do you use?

I use the driver from www.oracle.com that corresponds with my oracle 
version 
(http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html) 
Oracle9/i/ 9.2.0.1 JDBC Drivers for JDK 1.4.

And one question. Are you going to use any user transaction manager? :)
I use simpleJTA, but I have tested it only in developement...


I'm not using any user transaction manager. I think my page doesn't need it.

Regards,
Zdenek


Regards.

-
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]



Exception occurs when shutdown my apache-tomcat 4.1

2007-07-23 Thread senthil gugan
Hi all,
 I am using the apache-tomcat 4.1 in my Linux Suse OS. 
Here is my question,
 An exception is occurs every time I shutdown the tomcat server.
Here is the Exception, 
manickam:~ # $CATALINA_HOME/bin/shutdown.sh
Using CATALINA_BASE:   /root/Tomcat/apache-tomcat-4.1.34-LE-jdk14
Using CATALINA_HOME:   /root/Tomcat/apache-tomcat-4.1.34-LE-jdk14
Using CATALINA_TMPDIR: /root/Tomcat/apache-tomcat-4.1.34-LE-jdk14/temp
Using CATALINA_OUT:
/root/Tomcat/apache-tomcat-4.1.34-LE-jdk14/logs/catalina.out
Using JAVA_HOME:   /usr/java/j2sdk1.4.2_14
Catalina.stop: java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at  java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:464)
at java.net.Socket.connect(Socket.java:414)
at java.net.Socket.init(Socket.java:310)
at java.net.Socket.init(Socket.java:125)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:527)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:347)
at  org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:150)

Environment  Variable :
export CATALINA_HOME=/root/Tomcat/apache-tomcat-4.1.34-LE-jdk14

Thanks in advance,
Senthil.

   
-
 Download prohibited? No problem. CHAT from any browser, without download.

RE: OracleConnectionPoolDataSource

2007-07-23 Thread Propes, Barry L
Zdenek, I had gotten those errors, but like I said, it entailed me going back 
and properly closing each opened statement and connection.

-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 9:08 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


Zdeněk Vráblík escribió:
 Hi,

 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.

 Have you got any exception?

It throwed Closed Statement, Exhausted Resultset and 
NullPointerException, but only when I do stress test. If I browse page 
with navigator it works correctly and throws no exceptions.

 This is my resource:

 Resource name=IC
 auth=Container
 type=oracle.jdbc.pool.OracleDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 user=IC
 password=IC
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@192.168.100.119:1521:orcl

 maxActive=20 maxIdle=10 maxwait=-1/ 
 and this is my java code I use
 try
 {
 // Look up the data source on the JNDI tree
 DataSource ds = (DataSource) ctxt.lookup(java:/comp/env/ + poolName);


 if (ds instanceof OracleDataSource)
 {
 log.debug(oracleDatasource found);
 }

 conn = ds.getConnection();

 if (conn instanceof OracleConnection)
 {
 log.debug( OracleConnection - delegated );
 }
 }
 catch ( Exception ex )
 {
 log.error( classId + Error getting Oracle Connection., ex );
 throw ex;
 }

With OracleDataSource instead of OracleConnectionPoolDataSource I can 
use user and password in the context, but when I run stress test 
with 10 users, I see it uses more connections than I put in context (It 
uses one per user and I put 8 in the context). It's seems not to respect 
the pool. And it throws no exceptions.
 What jdbc driver do you use?

I use the driver from www.oracle.com that corresponds with my oracle 
version 
(http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html)
 
Oracle9/i/ 9.2.0.1 JDBC Drivers for JDK 1.4.
 And one question. Are you going to use any user transaction manager? :)
 I use simpleJTA, but I have tested it only in developement...

I'm not using any user transaction manager. I think my page doesn't need it.
 Regards,
 Zdenek

Regards.
 -
 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: I still cannot run a basic struts2 app on tomcat55

2007-07-23 Thread Phi-Long LE

try to comment this within catalina.policy:

grant codeBase file:${catalina.home}/webapps/- {
 permission java.security.AllPermission;
};


**

Le 21/07/2007 16:23, Michelle Baert a écrit :

Hi all,

I'm trying to start learning struts2.

I have a tomcat 5.5 server running fine with simple jsp applications.

But I found no way to start a struts2 app, even struts2-blank-2.0.8
or any of the supplied examples.

I tried several examples from various tutorials, they give the same
error.
However, it works with jetty, through mvn jetty:run.
Looking at the classpath used, I copied jars from the .m2 repository to
WEB-INF/lib, i.e.
  aopalliance-1.0.jar
  commons-fileupload-1.1.1.jar
  commons-io-1.1.jar
  commons-logging-1.0.4.jar
  dwr-1.1-beta-3.jar
  freemarker-2.3.8.jar
  ognl-2.6.9.jar
  sitemesh-2.2.1.jar
  spring-beans-2.0.1.jar
  spring-context-2.0.1.jar
  spring-core-2.0.1.jar
  spring-web-2.0.1.jar
  struts2-api-2.0.5.jar
  struts2-core-2.0.5.jar
  struts2-sitemesh-plugin-2.0.5.jar
  struts2-spring-plugin-2.0.5.jar
  xwork-2.0.0.jar

I even copied them to /usr/share/tomcat5.5/shared/lib, no result.

here's part of my /var/log/tomcat5.5/localhost.2007-07-21.log

---
INFO: ContextListener: attributeAdded('org.apache.catalina.MBeanServer',
'[EMAIL PROTECTED]')
21 juil. 2007 11:59:05 org.apache.catalina.core.StandardContext
filterStart
GRAVE: Exception au démarrage du filtre struts2
Caught exception while loading file struts-default.xml - Class:
java.security.AccessControlContext
File: AccessControlContext.java
Method: checkPermission
Line: 264 - java/security/AccessControlContext.java:264:-1
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:839)
...
---
in my /etc/tomcat5.5/policy.d/04webapps.policy, I tried to add,
according to 
https://bugs.launchpad.net/ubuntu/+source/tomcat5.5/+bug/74784

:
---
grant codeBase file:${catalina.home}/webapps/- {
  permission java.security.AllPermission;
};

---
it didn't help.


I'm using Linux Ubuntu 7.04 Feisty Fawn, java 1.5.0_11
(JAVA_HOME=/usr/lib/j2sdk1.5-sun), tomcat 5.5, struts-2.0.8.

In my $CATALINA_HOME/conf/tomcat-users.xml, I have
user username=mich password=*** roles=admin,manager/

--
I would greatly appreciate any help.
TIA,

--- Michelle


-
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: OracleConnectionPoolDataSource

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio J. Suárez Salinero wrote:
 Zdeněk Vráblík escribió:
 Hi,

 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.

 Have you got any exception?

 It throwed Closed Statement, Exhausted Resultset and
 NullPointerException, but only when I do stress test. If I browse page
 with navigator it works correctly and throws no exceptions.

This suggests that the connections and statements are not being managed
properly. Are you sure you are using the pooled connections properly? If
you had told us what the exceptions you were getting earlier (always a
good idea to tell us HOW it's not working), I would have said that you
were leaking connections between requests.

Closed Statement usually means you're trying to read from a result set
that came from a statement that has been closed. Why are you trying to
read from a closed statement? I'm guessing your code doesn't do this:

PreparedStatement ps = conn.prepareStatement(...);
ResultSet rs = ps.executeQuery();

ps.close();
rs.next();

...because that would, of course, be stupid. The only explanation I can
think of is that somehow those connections and/or statements are being
accidentally shared by threads.

Let me ask another stupid question: if this was working before using
Tomcat's pooling, why are you killing yourself to use Oracle's pooled
connections when they don't appear to work properly?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
YG2H7taNbtcp+DtTGIr/vcs=
=knx7
-END PGP SIGNATURE-

-
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: Exception occurs when shutdown my apache-tomcat 4.1

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Senthil,

senthil gugan wrote:
  I am using the apache-tomcat 4.1 in my Linux Suse OS. 
  An exception is occurs every time I shutdown the tomcat server.

 Catalina.stop: java.net.ConnectException: Connection refused
 java.net.ConnectException: Connection refused

I think you are not actually shutting down your server. This isn't a
shutdown exception. This is an exception being thrown when trying to
shutdown.

That sounds like nonsense, right?

Remember that the server is already running. When you run shutdown.sh,
you're starting up another process that tries to communicate with the
running instance of Tomcat to request a shutdown. The shutdown program
is failing. Tomcat is never getting the shutdown message.

Check your server.xml for the server port:

Server port=[shutdown port] shutdown=SHUTDOWN

Make sure that shutdown port has the value you expect it to have. You
might try netstat:

$ netstat -plan | grep java

This ought to show you which ports are being used by which processes. If
you don't see a java process listening on the shutdown port, then
something is wrong.

You can also get this error if Tomcat isn't actually running. I assume
it's running since you want to shut it down.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpMnX9CaO5/Lv0PARAkm6AJwMq1gSZVNeXQjxlM55avuaI8Q93wCbBWdJ
rEcGKaFwHQJb2kPuPvDKidE=
=NIEn
-END PGP SIGNATURE-

-
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: OracleConnectionPoolDataSource

2007-07-23 Thread Propes, Barry L
Like I told him, Chris, I experienced very similar scenarios with my connection 
pooling, and had to alter and/or rewrite the classes, but I did get them 
closing properly. 
Some took some significant tweaking, but I finally got it.

Zdenek, if you could post the original code, maybe we could narrow it down for 
you.

If you'd like to just send me a few files individually, go right ahead. I'll 
try to take a look at it and be of help.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 10:27 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio J. Suárez Salinero wrote:
 Zdeněk Vráblík escribió:
 Hi,

 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.

 Have you got any exception?

 It throwed Closed Statement, Exhausted Resultset and
 NullPointerException, but only when I do stress test. If I browse page
 with navigator it works correctly and throws no exceptions.

This suggests that the connections and statements are not being managed
properly. Are you sure you are using the pooled connections properly? If
you had told us what the exceptions you were getting earlier (always a
good idea to tell us HOW it's not working), I would have said that you
were leaking connections between requests.

Closed Statement usually means you're trying to read from a result set
that came from a statement that has been closed. Why are you trying to
read from a closed statement? I'm guessing your code doesn't do this:

PreparedStatement ps = conn.prepareStatement(...);
ResultSet rs = ps.executeQuery();

ps.close();
rs.next();

...because that would, of course, be stupid. The only explanation I can
think of is that somehow those connections and/or statements are being
accidentally shared by threads.

Let me ask another stupid question: if this was working before using
Tomcat's pooling, why are you killing yourself to use Oracle's pooled
connections when they don't appear to work properly?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
YG2H7taNbtcp+DtTGIr/vcs=
=knx7
-END PGP SIGNATURE-

-
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: OracleConnectionPoolDataSource

2007-07-23 Thread Julio J. Suárez Salinero

Propes, Barry L escribió:
Like I told him, Chris, I experienced very similar scenarios with my connection pooling, and had to alter and/or rewrite the classes, but I did get them closing properly. 
Some took some significant tweaking, but I finally got it.


Zdenek, if you could post the original code, maybe we could narrow it down for 
you.

If you'd like to just send me a few files individually, go right ahead. I'll 
try to take a look at it and be of help.

  
Thank you very much, Barry L. I'm just testing a few changes in the 
code. When I have something I'll say you it.


Note: I'm not Zdenek. I'm Julio.

Regards.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 10:27 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio J. Suárez Salinero wrote:
  

Zdeněk Vráblík escribió:


Hi,

  

4. I use OracleConnectionPoolDataSource because with
javax.sql.DataSource it doesn't close correctly close connections from
pool and server got to hang up.


Have you got any exception?

  

It throwed Closed Statement, Exhausted Resultset and
NullPointerException, but only when I do stress test. If I browse page
with navigator it works correctly and throws no exceptions.



This suggests that the connections and statements are not being managed
properly. Are you sure you are using the pooled connections properly? If
you had told us what the exceptions you were getting earlier (always a
good idea to tell us HOW it's not working), I would have said that you
were leaking connections between requests.

Closed Statement usually means you're trying to read from a result set
that came from a statement that has been closed. Why are you trying to
read from a closed statement? I'm guessing your code doesn't do this:

PreparedStatement ps = conn.prepareStatement(...);
ResultSet rs = ps.executeQuery();

ps.close();
rs.next();

...because that would, of course, be stupid. The only explanation I can
think of is that somehow those connections and/or statements are being
accidentally shared by threads.

Let me ask another stupid question: if this was working before using
Tomcat's pooling, why are you killing yourself to use Oracle's pooled
connections when they don't appear to work properly?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
YG2H7taNbtcp+DtTGIr/vcs=
=knx7
-END PGP SIGNATURE-

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

  



--


---


*Julio Javier Suárez Salinero*

*Departamento de programación*

AVISO LEGAL: Este mensaje contiene información confidencial para ser 
leída exclusivamente por el destinatario. Su contenido no constituye un 
compromiso para el remitente salvo ratificación escrita por ambas 
partes. Queda prohibida la reproducción, publicación, divulgación, total 
o parcial del mensaje así como el uso no autorizados por el emisor. En 
caso de recibir el mensaje por error se ruega su comunicación al 
remitente lo antes posible.


LEGAL WARNING: This message contains confidential information for the 
exclusive use of the recipient. Its contents do not constitute a 
commitment by the sender except where provided for in a signed agreement 
between both parties. Any unauthorised disclosure, use or dissemination, 
either whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify.



-
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: MySql Connector returning ?DataSource

2007-07-23 Thread Wade Chandler
From a JSP page try to make a MYSQL connection using
just pure JDBC calls. It may be something to do with
your JDBC classes and the directory your JAR files are
housed. If I remember correctly I had to put my MYSQL
JAR file in the shared folder so the server could
access them. This versus having them in the
WEB-INF/lib folder. May or may not be your issue, but
make sure you can actually make a JDBC connection with
the drivers first. If not then the DataSource won't
work either.

I have never used
WatchedResourceWEB-INF/web.xml/WatchedResource

before either. Maybe comment out this line and see if
it has any impact.

Wade

--- Prem Padarath [EMAIL PROTECTED] wrote:

 Hi,
 
 I am trying to set up a database resource in Tomcat
 5.5.20 .  I am having a
 problem getting a DataSource object back from a JNDI
 lookup.
 (I am getting a
 org.apache.tomcat.dbcp.dbcp.BasicDataSource object
 returned and throwing an exception - code below)
 
 My problem is similar to the Re: MySql Connector
 thread of messages.
 
 I can see the resource listed in the Tomcat
 Administration Tool under Tomcat
 Server -- Service -- Host -- Context(/dbtest)
 and all the information for the datasource looks
 fine (as from the
 context.xml file below).
 
 My context.xml file (placed in my webapp under
 META-INF) looks as follows:
 
 Context crossContext=true path=/dbtest
 reloadable=true
 Logger
 className=org.apache.catalina.logger.FileLogger
 prefix=localhost-dbtest-log.
 suffix=txt
 timestamp=true/
 
   Resource
 name=jdbc/MYSQLDS
 auth=Container
 type=javax.sql.DataSource
 maxActive=5
 maxIdle=3
 maxWait=1
 username=myuser
 password=mypwd
 driverClassName=com.mysql.jdbc.Driver

 url=jdbc:mysql://localhost:3306/testdb/
  
 WatchedResourceWEB-INF/web.xml/WatchedResource
 /Context
 
 My web.xml file contains the following:
 
 resource-ref
   descriptionDB Connection/description
   res-ref-namejdbc/MYSQLDS/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
   /resource-ref
 
 
 And the snippet/code I am using to acquire a
 datasource is as follows:
 
 DataSource ds = null;
 
 ds =

(DataSource)initContext.lookup(java:/comp/env/jdbc/MYSQLDS);
 
 
 When the app is run, I get back
 
 java.lang.Exception:
 org.apache.tomcat.dbcp.dbcp.BasicDataSource
 dbtest.HelloWorld.execute(HelloWorld.java:53)

 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(
 NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke
 (
 DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:585)
 
 (by the way, I am running this within a Struts2
 Framework)
 
 Can anyone tell me what I am doing incorrectly
 still?
 
 Thx,
 Prem
 


-
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: OracleConnectionPoolDataSource

2007-07-23 Thread Propes, Barry L
ok...is it you having problems or Zdenek?

Sorry for my mistaking you two.

-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 11:46 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


Propes, Barry L escribió:
 Like I told him, Chris, I experienced very similar scenarios with my 
 connection pooling, and had to alter and/or rewrite the classes, but I did 
 get them closing properly. 
 Some took some significant tweaking, but I finally got it.

 Zdenek, if you could post the original code, maybe we could narrow it down 
 for you.

 If you'd like to just send me a few files individually, go right ahead. I'll 
 try to take a look at it and be of help.

   
Thank you very much, Barry L. I'm just testing a few changes in the 
code. When I have something I'll say you it.

Note: I'm not Zdenek. I'm Julio.

Regards.
 -Original Message-
 From: Christopher Schultz [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 23, 2007 10:27 AM
 To: Tomcat Users List
 Subject: Re: OracleConnectionPoolDataSource


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Julio,

 Julio J. Suárez Salinero wrote:
   
 Zdeněk Vráblík escribió:
 
 Hi,

   
 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.
 
 Have you got any exception?

   
 It throwed Closed Statement, Exhausted Resultset and
 NullPointerException, but only when I do stress test. If I browse page
 with navigator it works correctly and throws no exceptions.
 

 This suggests that the connections and statements are not being managed
 properly. Are you sure you are using the pooled connections properly? If
 you had told us what the exceptions you were getting earlier (always a
 good idea to tell us HOW it's not working), I would have said that you
 were leaking connections between requests.

 Closed Statement usually means you're trying to read from a result set
 that came from a statement that has been closed. Why are you trying to
 read from a closed statement? I'm guessing your code doesn't do this:

 PreparedStatement ps = conn.prepareStatement(...);
 ResultSet rs = ps.executeQuery();

 ps.close();
 rs.next();

 ...because that would, of course, be stupid. The only explanation I can
 think of is that somehow those connections and/or statements are being
 accidentally shared by threads.

 Let me ask another stupid question: if this was working before using
 Tomcat's pooling, why are you killing yourself to use Oracle's pooled
 connections when they don't appear to work properly?

 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
 YG2H7taNbtcp+DtTGIr/vcs=
 =knx7
 -END PGP SIGNATURE-

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

   


-- 


---


*Julio Javier Suárez Salinero*

*Departamento de programación*

AVISO LEGAL: Este mensaje contiene información confidencial para ser 
leída exclusivamente por el destinatario. Su contenido no constituye un 
compromiso para el remitente salvo ratificación escrita por ambas 
partes. Queda prohibida la reproducción, publicación, divulgación, total 
o parcial del mensaje así como el uso no autorizados por el emisor. En 
caso de recibir el mensaje por error se ruega su comunicación al 
remitente lo antes posible.

LEGAL WARNING: This message contains confidential information for the 
exclusive use of the recipient. Its contents do not constitute a 
commitment by the sender except where provided for in a signed agreement 
between both parties. Any unauthorised disclosure, use or dissemination, 
either whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify.


-
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: MySql Connector returning ?DataSource

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Prem,

Prem Padarath wrote:
 I am trying to set up a database resource in Tomcat 5.5.20 .  I am having a
 problem getting a DataSource object back from a JNDI lookup.
 (I am getting a org.apache.tomcat.dbcp.dbcp.BasicDataSource object
 returned and throwing an exception - code below)

o.a.t.d.d.BasicDataSource implements javax.sql.DataSource. What's the
problem?

 My context.xml file (placed in my webapp under META-INF) looks as follows:
 
 Context crossContext=true path=/dbtest reloadable=true

Remove the path attribute, please. It is unlikely to be causing
problems, but you should definitely take it out.

  Resource
name=jdbc/MYSQLDS
auth=Container
type=javax.sql.DataSource
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/testdb/

This looks fine.

 My web.xml file contains the following:
 
resource-ref
  descriptionDB Connection/description
  res-ref-namejdbc/MYSQLDS/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref

I have found that resource-ref is superfluous when using a
context-defined DataSource. I'm not sure if that's the way it's supposed
to be, but I have found that this doesn't matter.

 And the snippet/code I am using to acquire a datasource is as follows:
 
 DataSource ds = null;
 
 ds = (DataSource)initContext.lookup(java:/comp/env/jdbc/MYSQLDS);

Looks good to me.

 When the app is run, I get back
 
 java.lang.Exception: org.apache.tomcat.dbcp.dbcp.BasicDataSource
dbtest.HelloWorld.execute(HelloWorld.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(
 NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke (
 DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)

Can you give us the full stack trace? All I see is reflection code in
there. Is there a message? java.lang.Exception is just a little less
useful than getting a java.lang.Throwable.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpQTx9CaO5/Lv0PARAhfCAJ9B3Hkd1lra9+Dd9+4ysqu2w90ZfgCeOlq3
I/uYB+efFUY6lLrnYA38Zf0=
=6foU
-END PGP SIGNATURE-

-
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: Manager Deployer and build.xml

2007-07-23 Thread Filip Hanik - Dev Lists
you probably don't have the Realm or your deployment client setup with 
the correct username/password


Filip

Sangoi, Nehal (Gexpro, consultant) wrote:

Hi
 
I have implemented manager-deployer config in my tomcat 5.5.23 setup.

And using ant for my build.xml to deploy webapps. I am recieveing below
errors while deployment of one of my applications named :custdash .
 
deploy:
 
BUILD FAILED

/opt/apps/custdash/home/build/build.xml:107: java.io.IOException: Server
returned HTTP response code: 403 for URL:
http://10.33.9.71:7181/manager/deploy?path=%2Fcustdashupdate=true
 
Total time: 26 seconds


 
 
For such kind of errors, i found a thread like, 
http://www.oneofthosedays.org.uk/archives/2005/09/18/deploying-java-apps

-to-tomcat-via-ant/
 
Well, I did not find ReloadTask.java file on my server.
 
What could be remedy to this problem?
 
 
 
Thanks

Nehal
 
 

  



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.10.14/912 - Release Date: 7/22/2007 7:02 PM
  



-
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: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath

Hi Chris,


o.a.t.d.d.BasicDataSource implements javax.sql.DataSource. What's the
problem?


The problem is that whatever is returned from the lookup call is causing an
exception.  I tested what is coming back and it is an o.a.t.d.d.B.D.S and it
is putting it to a DataSource.

The stack trace follows:

SEVERE: Could not execute action
java.lang.RuntimeException: helloCould not create resource factory instance
   at dbtest.HelloWorld.execute(HelloWorld.java:46)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(
DefaultActionInvocation.java:408)
   at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(
DefaultActionInvocation.java:262)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:224)
   at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(
DefaultWorkflowInterceptor.java:213)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
(MethodFilterInterceptor.java:86)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:219)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:218)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:216)
   at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(
ValidationInterceptor.java:115)
   at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept
(AnnotationValidationInterceptor.java:48)
   at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
(MethodFilterInterceptor.java:86)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:219)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:218)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:216)
   at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(
ConversionErrorInterceptor.java:123)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:219)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:218)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:216)
   at com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(
ParametersInterceptor.java:161)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:219)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:218)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:216)
   at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(
StaticParametersInterceptor.java:105)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:219)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:218)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:216)
   at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(
CheckboxInterceptor.java:83)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:219)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:218)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:216)
   at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(
FileUploadInterceptor.java:207)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:219)
   at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(
DefaultActionInvocation.java:218)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:216)
   at 

Re: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath

Hi Wade,

Yes, I have been able to connect with a plain java class and I have been
able to connect from within Struts2 directly.  It is when I try to get a
DataSource object from Tomcat's JNDI that it messes.

Prem

On 7/23/07, Wade Chandler [EMAIL PROTECTED] wrote:


From a JSP page try to make a MYSQL connection using
just pure JDBC calls. It may be something to do with
your JDBC classes and the directory your JAR files are
housed. If I remember correctly I had to put my MYSQL
JAR file in the shared folder so the server could
access them. This versus having them in the
WEB-INF/lib folder. May or may not be your issue, but
make sure you can actually make a JDBC connection with
the drivers first. If not then the DataSource won't
work either.

I have never used
WatchedResourceWEB-INF/web.xml/WatchedResource

before either. Maybe comment out this line and see if
it has any impact.

Wade

--- Prem Padarath [EMAIL PROTECTED] wrote:

 Hi,

 I am trying to set up a database resource in Tomcat
 5.5.20 .  I am having a
 problem getting a DataSource object back from a JNDI
 lookup.
 (I am getting a
 org.apache.tomcat.dbcp.dbcp.BasicDataSource object
 returned and throwing an exception - code below)

 My problem is similar to the Re: MySql Connector
 thread of messages.

 I can see the resource listed in the Tomcat
 Administration Tool under Tomcat
 Server -- Service -- Host -- Context(/dbtest)
 and all the information for the datasource looks
 fine (as from the
 context.xml file below).

 My context.xml file (placed in my webapp under
 META-INF) looks as follows:

 Context crossContext=true path=/dbtest
 reloadable=true
 Logger
 className=org.apache.catalina.logger.FileLogger
 prefix=localhost-dbtest-log.
 suffix=txt
 timestamp=true/

   Resource
 name=jdbc/MYSQLDS
 auth=Container
 type=javax.sql.DataSource
 maxActive=5
 maxIdle=3
 maxWait=1
 username=myuser
 password=mypwd
 driverClassName=com.mysql.jdbc.Driver

 url=jdbc:mysql://localhost:3306/testdb/

 WatchedResourceWEB-INF/web.xml/WatchedResource
 /Context

 My web.xml file contains the following:

 resource-ref
   descriptionDB Connection/description
   res-ref-namejdbc/MYSQLDS/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
   /resource-ref


 And the snippet/code I am using to acquire a
 datasource is as follows:

 DataSource ds = null;
 
 ds =

(DataSource)initContext.lookup(java:/comp/env/jdbc/MYSQLDS);
 

 When the app is run, I get back

 java.lang.Exception:
 org.apache.tomcat.dbcp.dbcp.BasicDataSource
 dbtest.HelloWorld.execute(HelloWorld.java:53)

 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(
 NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke
 (
 DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:585)

 (by the way, I am running this within a Struts2
 Framework)

 Can anyone tell me what I am doing incorrectly
 still?

 Thx,
 Prem



-
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: MySql Connector returning ?DataSource

2007-07-23 Thread David Smith
This could easily be caused by the mysql jar file not being in tomcat's 
common/lib directory -- especially if local, non JNDI access is working.


--David

Prem Padarath wrote:

Hi Wade,

Yes, I have been able to connect with a plain java class and I have been
able to connect from within Struts2 directly.  It is when I try to get a
DataSource object from Tomcat's JNDI that it messes.

Prem

On 7/23/07, Wade Chandler [EMAIL PROTECTED] wrote:


From a JSP page try to make a MYSQL connection using
just pure JDBC calls. It may be something to do with
your JDBC classes and the directory your JAR files are
housed. If I remember correctly I had to put my MYSQL
JAR file in the shared folder so the server could
access them. This versus having them in the
WEB-INF/lib folder. May or may not be your issue, but
make sure you can actually make a JDBC connection with
the drivers first. If not then the DataSource won't
work either.

I have never used
WatchedResourceWEB-INF/web.xml/WatchedResource

before either. Maybe comment out this line and see if
it has any impact.

Wade

--- Prem Padarath [EMAIL PROTECTED] wrote:

 Hi,

 I am trying to set up a database resource in Tomcat
 5.5.20 .  I am having a
 problem getting a DataSource object back from a JNDI
 lookup.
 (I am getting a
 org.apache.tomcat.dbcp.dbcp.BasicDataSource object
 returned and throwing an exception - code below)

 My problem is similar to the Re: MySql Connector
 thread of messages.

 I can see the resource listed in the Tomcat
 Administration Tool under Tomcat
 Server -- Service -- Host -- Context(/dbtest)
 and all the information for the datasource looks
 fine (as from the
 context.xml file below).

 My context.xml file (placed in my webapp under
 META-INF) looks as follows:

 Context crossContext=true path=/dbtest
 reloadable=true
 Logger
 className=org.apache.catalina.logger.FileLogger
 prefix=localhost-dbtest-log.
 suffix=txt
 timestamp=true/

   Resource
 name=jdbc/MYSQLDS
 auth=Container
 type=javax.sql.DataSource
 maxActive=5
 maxIdle=3
 maxWait=1
 username=myuser
 password=mypwd
 driverClassName=com.mysql.jdbc.Driver

 url=jdbc:mysql://localhost:3306/testdb/

 WatchedResourceWEB-INF/web.xml/WatchedResource
 /Context

 My web.xml file contains the following:

 resource-ref
   descriptionDB Connection/description
   res-ref-namejdbc/MYSQLDS/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
   /resource-ref


 And the snippet/code I am using to acquire a
 datasource is as follows:

 DataSource ds = null;
 
 ds =

(DataSource)initContext.lookup(java:/comp/env/jdbc/MYSQLDS);
 

 When the app is run, I get back

 java.lang.Exception:
 org.apache.tomcat.dbcp.dbcp.BasicDataSource
 dbtest.HelloWorld.execute(HelloWorld.java:53)

 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(
 NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke
 (
 DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:585)

 (by the way, I am running this within a Struts2
 Framework)

 Can anyone tell me what I am doing incorrectly
 still?

 Thx,
 Prem



-
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: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath

David,

I checked.  The mysql jar file is in common\lib directory!
I think my test app (direct access) would have had to have retrieved the
jdbc classes from the Tomcat lib as I didn't include them in the war file.

Thx,
Prem

On 7/23/07, David Smith [EMAIL PROTECTED] wrote:


This could easily be caused by the mysql jar file not being in tomcat's
common/lib directory -- especially if local, non JNDI access is working.

--David

Prem Padarath wrote:
 Hi Wade,

 Yes, I have been able to connect with a plain java class and I have been
 able to connect from within Struts2 directly.  It is when I try to get a
 DataSource object from Tomcat's JNDI that it messes.

 Prem

 On 7/23/07, Wade Chandler [EMAIL PROTECTED] wrote:

 From a JSP page try to make a MYSQL connection using
 just pure JDBC calls. It may be something to do with
 your JDBC classes and the directory your JAR files are
 housed. If I remember correctly I had to put my MYSQL
 JAR file in the shared folder so the server could
 access them. This versus having them in the
 WEB-INF/lib folder. May or may not be your issue, but
 make sure you can actually make a JDBC connection with
 the drivers first. If not then the DataSource won't
 work either.

 I have never used
 WatchedResourceWEB-INF/web.xml/WatchedResource

 before either. Maybe comment out this line and see if
 it has any impact.

 Wade

 --- Prem Padarath [EMAIL PROTECTED] wrote:

  Hi,
 
  I am trying to set up a database resource in Tomcat
  5.5.20 .  I am having a
  problem getting a DataSource object back from a JNDI
  lookup.
  (I am getting a
  org.apache.tomcat.dbcp.dbcp.BasicDataSource object
  returned and throwing an exception - code below)
 
  My problem is similar to the Re: MySql Connector
  thread of messages.
 
  I can see the resource listed in the Tomcat
  Administration Tool under Tomcat
  Server -- Service -- Host -- Context(/dbtest)
  and all the information for the datasource looks
  fine (as from the
  context.xml file below).
 
  My context.xml file (placed in my webapp under
  META-INF) looks as follows:
 
  Context crossContext=true path=/dbtest
  reloadable=true
  Logger
  className=org.apache.catalina.logger.FileLogger
  prefix=localhost-dbtest-log.
  suffix=txt
  timestamp=true/
 
Resource
  name=jdbc/MYSQLDS
  auth=Container
  type=javax.sql.DataSource
  maxActive=5
  maxIdle=3
  maxWait=1
  username=myuser
  password=mypwd
  driverClassName=com.mysql.jdbc.Driver
 
  url=jdbc:mysql://localhost:3306/testdb/
 
  WatchedResourceWEB-INF/web.xml/WatchedResource
  /Context
 
  My web.xml file contains the following:
 
  resource-ref
descriptionDB Connection/description
res-ref-namejdbc/MYSQLDS/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
 
 
  And the snippet/code I am using to acquire a
  datasource is as follows:
 
  DataSource ds = null;
  
  ds =
 
 (DataSource)initContext.lookup(java:/comp/env/jdbc/MYSQLDS);
  
 
  When the app is run, I get back
 
  java.lang.Exception:
  org.apache.tomcat.dbcp.dbcp.BasicDataSource
  dbtest.HelloWorld.execute(HelloWorld.java:53)
 
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method)
  sun.reflect.NativeMethodAccessorImpl.invoke(
  NativeMethodAccessorImpl.java:39)
  sun.reflect.DelegatingMethodAccessorImpl.invoke
  (
  DelegatingMethodAccessorImpl.java:25)
  java.lang.reflect.Method.invoke(Method.java:585)
 
  (by the way, I am running this within a Struts2
  Framework)
 
  Can anyone tell me what I am doing incorrectly
  still?
 
  Thx,
  Prem
 


 -
 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: MySql Connector returning ?DataSource

2007-07-23 Thread Caldarale, Charles R
 From: Prem Padarath [mailto:[EMAIL PROTECTED] 
 Subject: Re: MySql Connector returning ?DataSource
 
 I checked.  The mysql jar file is in common\lib directory!

Is it also in the webapp's WEB-INF/lib directory?  Having it in two
places at once can cause all sorts of interesting problems.

 - 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]



Re: MySql Connector returning ?DataSource

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

Caldarale, Charles R wrote:
 From: Prem Padarath [mailto:[EMAIL PROTECTED] 
 Subject: Re: MySql Connector returning ?DataSource

 I checked.  The mysql jar file is in common\lib directory!
 
 Is it also in the webapp's WEB-INF/lib directory?  Having it in two
 places at once can cause all sorts of interesting problems.

I'll bet this is the problem. It's odd, though, since the exception is:

Caused by: java.lang.ClassCastException:
org.apache.tomcat.dbcp.dbcp.BasicDataSource
   at org.apache.naming.factory.ResourceFactory.getObjectInstance(
ResourceFactory.java:97)

Here's the code in question:

if (factoryClass != null) {
try {
// line 97 factory = (ObjectFactory)
// line 97 cont'd factoryClass.newInstance();
} catch (Throwable t) {
if (t instanceof NamingException)
throw (NamingException) t;
NamingException ex = new NamingException
(Could not create resource factory
 instance);
ex.initCause(t);
throw ex;
}
}

For some reason, his ObjectFactory isn't an ObjectFactory... it's a
BasicDataSource.

Prem, have you put any Tomcat-related JAR files into your WEB-INF/lib
directory?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpSrM9CaO5/Lv0PARAoPUAJ0Xl9GGATFzREuXwvl/CFaWjkBSrwCgmuR/
OaZxzNwC6nlnpVIfHn7XSZo=
=eEfQ
-END PGP SIGNATURE-

-
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: MySql Connector returning ?DataSource

2007-07-23 Thread Prem Padarath

Chuck,

Checked...it is only in the one place.

Thx,
Prem

On 7/23/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:


 From: Prem Padarath [mailto:[EMAIL PROTECTED]
 Subject: Re: MySql Connector returning ?DataSource

 I checked.  The mysql jar file is in common\lib directory!

Is it also in the webapp's WEB-INF/lib directory?  Having it in two
places at once can cause all sorts of interesting problems.

- 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]




RE: org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request fai

2007-07-23 Thread MC Moisei
Sorry about the formatting. It's hotmail cr*p! So, I run Apache2 that fronts a 
Tomcat in mod_jk and I have this multi-upload screen(ajax+java) that works 
great from my intranet but when testing it from outside is not. I'm sure it's a 
setting thing either on mod_jk, tomcat or apacheI observed the following:1. 
when I initiate an upload, it seems that the whole upload happens as a result 
of the form post instead of being progressively. I test from a place that has a 
proxy and my tomcat instance is fronted by an apache that handles the static 
content (coupled with mod_jk). What's really happening? Shouldn't the upload 
happen progressively via the proxy ? Is the file firstly uploaded to the proxy 
and from there to my site as one chunk ? Why this is not happening from my 
local box. I had other people complaining about this as well so it's not only 
my location. From my intranet works as it should - flawless.2.If I initiate two 
concurrent uploads only the last one prevails and I get always an exception on 
the first one... This also works just fine from my local intranet. I assume 
both are related with each other.2007-07-23 11:53:27,358 [TP-Processor11]: 
ERROR 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253)
 - Servlet.service() 
fororg.apache.commons.fileupload.FileUploadBase$IOFileUploadException:Processing
 of multipart/form-data request failed. Stream ended unexpectedly
atorg.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:359)

atorg.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302)

atorg.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:185)
atorg.apache.struts.util.RequestUtils.populate(RequestUtils.java:405)   
 
atorg.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:818)

atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:194)  
  atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) 
   atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)   
 
atcom.goodmedia.framework.core.servlet.FrameworkActionServlet.doGet(FrameworkActionServlet.java:119)

atcom.goodmedia.framework.core.servlet.FrameworkActionServlet.doPost(FrameworkActionServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
atcom.goodmedia.framework.core.servlet.FrameworkActionServlet.service(FrameworkActionServlet.java:91)

atcom.gsi.core.servlet.GSIActionServlet.service(GSIActionServlet.java:128)  
  
atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.ajaxanywhere.AAFilter.doFilter(AAFilter.java:46)   
atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.goodmedia.trim.TrimFilter.doFilter(TrimFilter.java:72)
atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

atcom.goodmedia.framework.core.servlet.UserManagerUtilsFilter.doFilter(UserManagerUtilsFilter.java:105)

atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)

atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

atorg.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)

atorg.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)

atorg.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197)

atorg.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)

atorg.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:143)

atorg.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)

atorg.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)

atorg.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)

atorg.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)

atorg.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)

atorg.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)   
 
atorg.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120) 
   

Re: WebDav - mapping question?

2007-07-23 Thread Mark Thomas
David Delbecq wrote:
 Tomcat should not refuse webapp/webdav if you have a mapping to
 /webdav/*. It should at least dispatch to servlet mapped on /webdav/*.

Tomcat doesn't reject requests of this type . For any directory
resource without a trailing '/' it will do a 302 redirect and add '/'.
The MS client doesn't seem to be able to handle the redirect. This is
probably the cause of the problem. I tried raising this with MS and
got nowhere.

Because of where Tomcat does this redirect, I can't immediately see a
way around this. I'll have a think over the next few days.

Mark


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



What to put in Linux filesystem for Tomcat?

2007-07-23 Thread lightbulb432

What is the minimum set of folders and files needed for Tomcat to run on
Linux? I ask because if you dedicate a server for Tomcat and nothing else,
you must want to minimize the size of the filesystem, disable/delete all
extra services, and more to increase the performance and decrease memory
utilization of Linux, correct?

I'd like to put something together, but don't know where to begin. Do any of
you run Tomcat on a Linux machine that is dedicated only for Tomcat? If so,
could you please comment on what's necessary and what is extraneous to
Tomcat on Linux?

Potentially how small could you make your OS filesystem size, not including
the size of your WARs and the Tomcat JARs themselves?

I realize this might be leaning towards more of a Linux question than a
Tomcat question, but who knows Tomcat better than Tomcat users! Your help is
greatly appreciated.

Thanks.
-- 
View this message in context: 
http://www.nabble.com/What-to-put-in-Linux-filesystem-for-Tomcat--tf4133218.html#a11755211
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
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: What to put in Linux filesystem for Tomcat?

2007-07-23 Thread Filip Hanik - Dev Lists
Tomcat doesn't need anything but the JVM, but what the JVM needs, that's 
another story :)


Filip

lightbulb432 wrote:

What is the minimum set of folders and files needed for Tomcat to run on
Linux? I ask because if you dedicate a server for Tomcat and nothing else,
you must want to minimize the size of the filesystem, disable/delete all
extra services, and more to increase the performance and decrease memory
utilization of Linux, correct?

I'd like to put something together, but don't know where to begin. Do any of
you run Tomcat on a Linux machine that is dedicated only for Tomcat? If so,
could you please comment on what's necessary and what is extraneous to
Tomcat on Linux?

Potentially how small could you make your OS filesystem size, not including
the size of your WARs and the Tomcat JARs themselves?

I realize this might be leaning towards more of a Linux question than a
Tomcat question, but who knows Tomcat better than Tomcat users! Your help is
greatly appreciated.

Thanks.
  



-
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: What to put in Linux filesystem for Tomcat?

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lightbulb,

lightbulb432 wrote:
 What is the minimum set of folders and files needed for Tomcat to run on
 Linux? I ask because if you dedicate a server for Tomcat and nothing else,
 you must want to minimize the size of the filesystem, disable/delete all
 extra services, and more to increase the performance and decrease memory
 utilization of Linux, correct?

As Filip points out, all Tomcat needs is the JVM, and the JVM needs only
a few libraries that don't come with it (such as the standard C library).

Having extra packages installed (but not enabled) on a Linux system
won't slow down Tomcat or anything like that, but you're right -- it's
best not to install them in the first place.

Java ought to run on a bare-bones Linux installation. I dunno what
distro you are running, but if you install a package-managed version of
your JVM, then it should install all dependencies for you.

Otherwise, just install the binary packages from Sun (or IBM, etc.) and
then try to run your application. If the JVM starts up, you probably
have everything you need. I shouldn't have to say that you should test
everything very carefully before you go to production.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpW/f9CaO5/Lv0PARAjnsAJ9iOll+u7unfknQWSZS3lPfk3s7FACdE5vY
9EM3HzNHKHJ5GW12M2H4mhE=
=HBeH
-END PGP SIGNATURE-

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