Re: servlet url pattern problem!

2007-04-05 Thread jacky

It is amazing! Thanks, i will look into it to find out what is the problem.

On 4/5/07, Rashmi Rubdi [EMAIL PROTECTED] wrote:


If you compile the Servlet class and Re-start Tomcat after defining
the mapping in web.xml it should work.

I tried the following and it works:

-
web.xml
-
   servlet
   servlet-namelogin/servlet-name
   servlet-classtest66.LoginServlet/servlet-class
   /servlet
   servlet-mapping
   servlet-namelogin/servlet-name
   url-pattern/servlet/login/url-pattern
   /servlet-mapping

--
LoginServlet   compiled
--
package test66;

import javax.servlet.*;

public class LoginServlet extends HttpServlet {
   public void doPost(HttpServletRequest request, HttpServletResponse
response){
   doGet(request,response);
   }

   public void doGet(HttpServletRequest request, HttpServletResponse
response){
   System.out.println( Inside Login Servlet);
   }
}



JSP


%@ page contentType=text/html;charset=UTF-8 language=java %
html
headtitle/title/head
body
FORM action=%=request.getContextPath()%/servlet/login method=POST 
 input type=text name=text value=hello /
 input type=submit name=submit value=submit /
/FORM
/body
/html

-Rashmi

On 4/5/07, jacky [EMAIL PROTECTED] wrote:
 It is webapp/servlet/login indeed. In fact, my jsp structure is as
 following:
 in index.jsp:
   jsp:include page=/jsp/top.jsp/

 in top.jsp:
 FORM action=%=request.getContextPath()%/servlet/login method=POST
 onsubmit=return loginCheck(this);
 ..
 /FORM
 //here, the form will be submit



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





--
 Best Regards.
 jacky


Re: servlet url pattern problem!

2007-04-04 Thread jacky

It is webapp/servlet/login indeed. In fact, my jsp structure is as
following:
in index.jsp:
 jsp:include page=/jsp/top.jsp/

in top.jsp:
FORM action=%=request.getContextPath()%/servlet/login method=POST
onsubmit=return loginCheck(this);
..
/FORM
//here, the form will be submit



On 4/3/07, David Delbecq [EMAIL PROTECTED] wrote:


En l'instant précis du 03/04/07 11:47, jacky s'exprimait en ces termes:
 in web.xml:
 servlet-mapping
 servlet-namelogin/servlet-name
 url-pattern/servlet/login/url-pattern
 /servlet-mapping
 in jsp:
 FORM action=%=request.getContextPath()%/servlet/login
 method=POST 
 There is an error when the jsp is submit (URL:
 http://localhost:8080/test/servlet/login):

 type Status report
 message /test/servlet/
 description The requested resource (/test/servlet/) is not available.
You tried to post to webapp/servlet, not webapp/servlet/login
according to your error message. Check you didn't forget a /login
somewhere in your jsp.

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





--
 Best Regards.
 jacky


servlet url pattern problem!

2007-04-03 Thread jacky

in web.xml:
servlet-mapping
   servlet-namelogin/servlet-name
   url-pattern/servlet/login/url-pattern
/servlet-mapping
in jsp:
FORM action=%=request.getContextPath()%/servlet/login method=POST 
There is an error when the jsp is submit (URL:
http://localhost:8080/test/servlet/login):

type Status report
message /test/servlet/
description The requested resource (/test/servlet/) is not available.

If i remove servlet/,the url http://localhost:8080/test/login can be
accessed correctly.
in web.xml:
servlet-mapping
   servlet-namelogin/servlet-name
   url-pattern/login/url-pattern
/servlet-mapping
in jsp:
FORM action=%=request.getContextPath()%/login method=POST 

Your help is appreciated!
--
 Best Regards.
 jacky


Re: Re: context error

2006-02-16 Thread jacky
  I added the   reloadable=true crossContext=true, but the same errors 
occur.

 Best Regards.
   jacky  
   
- Original Message - 
From: Warren Pace [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, February 17, 2006 5:35 AM
Subject: Re: Re: context error


 
  
  From: jacky [EMAIL PROTECTED]
  Date: 2006/02/15 Wed PM 09:00:29 EST
  To: Tomcat Users List users@tomcat.apache.org
  Subject: Re: Re: context error
  
  hi,
 RedHat7.3,  J2sdk1.4.2_10
  server.xml is the default server.xml:
 
  !-- Tomcat Root Context --
  !--
Context path= docBase=ROOT debug=0/
  --
  !--Context path=/myworkflow docBase=myworkflow /-- //here, 
  myworkflow is my web app.
 Been a while since I used 4.1 - this is from memory.
 try
 Context path=/myworkflow docBase=myworkflow
   reloadable=true crossContext=true
 /Context
/Host
  
  /Engine
  
/Service
  
!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 
  4.0
 as its servlet container. Please read the README.txt file coming with
 the WebApp Module distribution on how to build it.
 (Or check out the jakarta-tomcat-connectors/webapp CVS repository)
  
 To configure the Apache side, you must ensure that you have the
 ServerName and Port directives defined in httpd.conf.  Then,
 lines like these to the bottom of your httpd.conf file:
  
   LoadModule webapp_module libexec/mod_webapp.so
   WebAppConnection warpConnection warp localhost:8008
   WebAppDeploy examples warpConnection /examples/
  
 The next time you restart Apache (after restarting Tomcat, if needed)
 the connection will be established, and all applications you make
 visible via WebAppDeploy directives can be accessed through Apache.
--
  
!-- Define an Apache-Connector Service --
Service name=Tomcat-Apache
  
  Connector className=org.apache.catalina.connector.warp.WarpConnector
   port=8008 minProcessors=5 maxProcessors=75
   enableLookups=true
   acceptCount=10 debug=0/
  
  !-- Replace localhost with what your Apache ServerName is set to 
  --
  Engine className=org.apache.catalina.connector.warp.WarpEngine
   name=Apache debug=0 appBase=webapps
  
!-- Global logger unless overridden at lower levels --
Logger className=org.apache.catalina.logger.FileLogger
prefix=apache_log. suffix=.txt
timestamp=true/
  
!-- Because this Realm is here, an instance will be shared globally 
  --
Realm className=org.apache.catalina.realm.MemoryRealm /
  
  /Engine
  
/Service
  
  /Server
  
  
   Best Regards.
 jacky  
 
  - Original Message - 
  From: Warren Pace [EMAIL PROTECTED]
  To: Tomcat Users List users@tomcat.apache.org
  Sent: Wednesday, February 15, 2006 6:42 PM
  Subject: Re: Re: context error
  
  
   

From: jacky [EMAIL PROTECTED]
Date: 2006/02/14 Tue PM 08:32:56 EST
To: Tomcat Users List users@tomcat.apache.org, 
[EMAIL PROTECTED]
Subject: Re: context error

hi, Mike,
   Do you mean put all directories together? 
No, we need to separate them. So, any other suggestions about this 
problem?

 Best Regards.
   jacky  

   Could you send us your server.xml with and without the added context?  I 
   see you're using 4.1.  What OS and what JVM are you using?
   
   
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: Re: context error

2006-02-16 Thread jacky
I added the Context path= docBase=ROOT debug=0/, it still doesn't work

 Best Regards.
   jacky  
   
- Original Message - 
From: Caldarale, Charles R [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, February 17, 2006 10:13 AM
Subject: RE: Re: context error


 From: jacky [EMAIL PROTECTED]
 Subject: Re: Re: context error
 
 server.xml is the default server.xml:
 
 !-- Tomcat Root Context --
 !--
   Context path= docBase=ROOT debug=0/
 --

Part of the problem may be that you have no default Context.  There
should be one (and only one) Context tag with path=.  If you want
your app to be the default, you can just set its path to .

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: context error

2006-02-15 Thread jacky
 application
 document roots in places other than the virtual host's appBase
 directory.  --

!-- Tomcat Root Context --
!--
  Context path= docBase=ROOT debug=0/
--
!--Context path=/myworkflow docBase=myworkflow /-- //here, 
myworkflow is my web app.
  /Host

/Engine

  /Service

  !-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
   as its servlet container. Please read the README.txt file coming with
   the WebApp Module distribution on how to build it.
   (Or check out the jakarta-tomcat-connectors/webapp CVS repository)

   To configure the Apache side, you must ensure that you have the
   ServerName and Port directives defined in httpd.conf.  Then,
   lines like these to the bottom of your httpd.conf file:

 LoadModule webapp_module libexec/mod_webapp.so
 WebAppConnection warpConnection warp localhost:8008
 WebAppDeploy examples warpConnection /examples/

   The next time you restart Apache (after restarting Tomcat, if needed)
   the connection will be established, and all applications you make
   visible via WebAppDeploy directives can be accessed through Apache.
  --

  !-- Define an Apache-Connector Service --
  Service name=Tomcat-Apache

Connector className=org.apache.catalina.connector.warp.WarpConnector
 port=8008 minProcessors=5 maxProcessors=75
 enableLookups=true
 acceptCount=10 debug=0/

!-- Replace localhost with what your Apache ServerName is set to --
Engine className=org.apache.catalina.connector.warp.WarpEngine
 name=Apache debug=0 appBase=webapps

  !-- Global logger unless overridden at lower levels --
  Logger className=org.apache.catalina.logger.FileLogger
  prefix=apache_log. suffix=.txt
  timestamp=true/

  !-- Because this Realm is here, an instance will be shared globally --
  Realm className=org.apache.catalina.realm.MemoryRealm /

/Engine

  /Service

/Server


 Best Regards.
   jacky  
   
- Original Message - 
From: Warren Pace [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, February 15, 2006 6:42 PM
Subject: Re: Re: context error


 
  
  From: jacky [EMAIL PROTECTED]
  Date: 2006/02/14 Tue PM 08:32:56 EST
  To: Tomcat Users List users@tomcat.apache.org, 
  [EMAIL PROTECTED]
  Subject: Re: context error
  
  hi, Mike,
 Do you mean put all directories together? 
  No, we need to separate them. So, any other suggestions about this problem?
  
   Best Regards.
 jacky  
  
 Could you send us your server.xml with and without the added context?  I see 
 you're using 4.1.  What OS and what JVM are you using?
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: Re: context error

2006-02-15 Thread jacky
BTW, if i remove the Context path=/myworkflow docBase=myworkflow / from 
the server.ml,
then tomcat can start. but  i can't login the manager tool
which is http://localhost:8080/manager/html with admin/admin, and still can't 
access myworkflow by http://localhost:8080/myworkflow/

 Best Regards.
   jacky  
   
- Original Message - 
From: jacky [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, February 16, 2006 10:00 AM
Subject: Re: Re: context error


 hi,
RedHat7.3,  J2sdk1.4.2_10
 server.xml is the default server.xml:
 
 !-- Alternate Example-less Configuration File --
 !-- Note that component elements are nested corresponding to their
  parent-child relationships with each other --
 
 !-- A Server is a singleton element that represents the entire JVM,
  which may contain one or more Service instances.  The Server
  listens for a shutdown command on the indicated port.
 
  Note:  A Server is not itself a Container, so you may not
  define subcomponents such as Valves or Loggers at this level.
  --
 
 Server port=8005 shutdown=SHUTDOWN debug=0
 
 
   !-- Uncomment this entry to enable JMX MBeans support --
 !--
   Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
 debug=0 port=-1 login=admin password=admin/
 --
 
 
   !-- A Service is a collection of one or more Connectors that share
a single Container (and therefore the web applications visible
within that Container).  Normally, that Container is an Engine,
but this is not required.
 
Note:  A Service is not itself a Container, so you may not
define subcomponents such as Valves or Loggers at this level.
--
 
   !-- Define the Tomcat Stand-Alone Service --
   Service name=Tomcat-Standalone
 
 !-- A Connector represents an endpoint by which requests are received
  and responses are returned.  Each Connector passes requests on to the
  associated Container (normally an Engine) for processing.
 
  By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
  You can also enable an SSL HTTP/1.1 Connector on port 8443 by
  following the instructions below and uncommenting the second 
 Connector
  entry.  SSL support requires the following steps (see the SSL Config
  HOWTO in the Tomcat 4.0 documentation bundle for more detailed
  instructions):
  * Download and install JSSE 1.0.2 or later, and put the JAR files
into $JAVA_HOME/jre/lib/ext.
  * Execute:
  %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA 
 (Windows)
  $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
with a password value of changeit for both the certificate and
the keystore itself.
 
  By default, DNS lookups are enabled when a web application calls
  request.getRemoteHost().  This can have an adverse impact on
  performance, so you can disable it by setting the
  enableLookups attribute to false.  When DNS lookups are disabled,
  request.getRemoteHost() will return the String version of the
  IP address of the remote client.
 --
 
 !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
 Connector className=org.apache.coyote.tomcat4.CoyoteConnector
port=8080 minProcessors=5 maxProcessors=75
enableLookups=true redirectPort=8443
acceptCount=100 debug=0 connectionTimeout=2
useURIValidationHack=false disableUploadTimeout=true /
 !-- Note : To disable connection timeouts, set connectionTimeout value 
  to 0 --
 
 !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --
 !--
 Connector className=org.apache.coyote.tomcat4.CoyoteConnector
port=8443 minProcessors=5 maxProcessors=75
enableLookups=true
acceptCount=100 debug=0 scheme=https secure=true
useURIValidationHack=false disableUploadTimeout=true
   Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory
clientAuth=false protocol=TLS /
 /Connector
 --
 
 !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
 !--
 Connector className=org.apache.coyote.tomcat4.CoyoteConnector
port=8009 minProcessors=5 maxProcessors=75
enableLookups=true redirectPort=8443
acceptCount=10 debug=0 connectionTimeout=0
useURIValidationHack=false

 protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/
 --
 
 !-- Define an AJP 1.3 Connector on port 8009 --
 !--
 Connector className=org.apache.ajp.tomcat4.Ajp13Connector
port=8009 minProcessors=5 maxProcessors=75
acceptCount=10 debug=0/
 --
 
 !-- Define a Proxied HTTP/1.1 Connector

Re: context error

2006-02-14 Thread jacky
hi, Mike,
   Do you mean put all directories together? 
No, we need to separate them. So, any other suggestions about this problem?

 Best Regards.
   jacky  
   
- Original Message - 
From: Mike Sabroff [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, February 14, 2006 10:56 PM
Subject: Re: context error


 Then do that
 
 jacky wrote:
 
  hi,
  When i add a Context in the server.xml, an error occurs:
 
  Apache Tomcat/4.1.31
  Catalina.start: LifecycleException: Context startup failed due to
  previous errors
  LifecycleException: Context startup failed due to previous errors
  at
  org.apache.catalina.core.StandardContext.start(StandardContext.java:3578)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
  at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
  at
  org.apache.catalina.core.StandardService.start(StandardService.java:450)
  at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
  at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
  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:156)
  Stopping service Tomcat-Standalone
  Catalina.stop: LifecycleException: Coyote connector has not been started
  LifecycleException: Coyote connector has not been started
  at
  org.apache.coyote.tomcat4.CoyoteConnector.stop(CoyoteConnector.java:1296)
  at org.apache.catalina.core.StandardService.stop(StandardService.java:499)
  at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2178)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:494)
  at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
  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:156)
 
  If i remove the added context, tomcat will start.
  In fact, i rearrange the directories, i don't know if this will impact
  on the Context. If i put all directories under $CATALINA_HOME, tomcat
  will work well with the Context.
 
  $CATALINA_HOME/bin/
  shared/
  server/
 
  $CATALINA_BASE/bin/
  conf/
  webapps/
  logs/
  work/
 
  Context is as following:
  Context path=/test docBase=test reloadable=true /
 
  Best Regards.
  jacky
 
 
 -- 
 Mike Sabroff
 Web Services
 Developer
 [EMAIL PROTECTED]
 920-568-8379
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

jdbc context

2006-02-13 Thread jacky
hi,
   I have deploy a workflow webapp in Tomcat4.1.31. First time, i add the 
following code in server.xml:

Context path=/myworkflow docBase=myworkflow reloadable=true 
  Resource name=jdbc/DefaultDS type=javax.sql.DataSource/
  ResourceParams name=jdbc/DefaultDS
  parameter
 namemaxActive/name
!-- Maximum number of DB connections in pool.Set to 0 for no limit. --
 value100/value
/parameter
parameter
 namemaxIdle/name
!-- Maximum number of idle DB connections to retain in pool.Set to 0 for 
no limit. --
 value30/value
/parameter
parameter
 namemaxWait/name
!-- Maximum time to wait for a DB connection to become available in ms.An 
exception is thrown if this timeout is exceeded.Set to -1 to wait indefinitely. 
--
 value15000/value
/parameter
parameter
 nameremoveAbandoned/name
!-- Abandoned DB connections are removed and recycled --
 valuetrue/value
/parameter
parameter
 nameremoveAbandonedTimeout/name
!-- Use the removeAbandonedTimeout parameter to set the number of seconds 
a DB connection has been idle before it is considered abandoned.  --
 value60/value
/parameter
parameter
 namelogAbandoned/name
!-- Log a stack trace of the code which abandoned --
 valuefalse/value
/parameter
parameter
 namefactory/name
!--DBCP Basic Datasource Factory --
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
parameternameusername/namevaluesa/value/parameter
parameternamepassword/namevalue/value/parameter
parameternamedriverClassName/name
  
valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value/parameter
parameternameurl/name
  
valuejdbc:microsoft:sqlserver://localhost:1433;databaseName=myworkflow/value/parameter
  /ResourceParams
/Context

It works well. But now, we need to migrate myworkflow into another 
tomcat4.1.31, in which the server.xml can't be modified.
So what shall i do to deploy the jdbc context? Thanks for your help!

 Best Regards.
   jacky  
   

RE: jdbc context

2006-02-13 Thread chen jacky

hi,
 Do you mean add the following code in the web.xml?
resource-ref
 descriptionDB Connection/description
 res-ref-namejdbc/TestDB/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
 /resource-ref

But this still need to add the jdbc config in the server.xml,right?
Can you give me some suggestions?


From: Duan, Nick [EMAIL PROTECTED]
Reply-To: Tomcat Users List users@tomcat.apache.org
To: Tomcat Users List users@tomcat.apache.org
Subject: RE: jdbc context
Date: Mon, 13 Feb 2006 10:11:34 -0500

You should be able to add the context info in your web.xml file.  In
other words, instead of making the JDBC resource available to all web
apps, you make it only to particular applications.  If this JDBC
connection is only used by the workflow web app, defining it in web.xml
is actually preferred.

ND

-Original Message-
From: jacky [mailto:[EMAIL PROTECTED]
Sent: Monday, February 13, 2006 5:07 AM
To: users@tomcat.apache.org
Subject: jdbc context

hi,
   I have deploy a workflow webapp in Tomcat4.1.31. First time, i add
the following code in server.xml:

Context path=/myworkflow docBase=myworkflow reloadable=true 
  Resource name=jdbc/DefaultDS type=javax.sql.DataSource/
  ResourceParams name=jdbc/DefaultDS
  parameter
 namemaxActive/name
!-- Maximum number of DB connections in pool.Set to 0 for no limit.
--
 value100/value
/parameter
parameter
 namemaxIdle/name
!-- Maximum number of idle DB connections to retain in pool.Set to
0 for no limit. --
 value30/value
/parameter
parameter
 namemaxWait/name
!-- Maximum time to wait for a DB connection to become available in
ms.An exception is thrown if this timeout is exceeded.Set to -1 to wait
indefinitely. --
 value15000/value
/parameter
parameter
 nameremoveAbandoned/name
!-- Abandoned DB connections are removed and recycled --
 valuetrue/value
/parameter
parameter
 nameremoveAbandonedTimeout/name
!-- Use the removeAbandonedTimeout parameter to set the number of
seconds a DB connection has been idle before it is considered abandoned.
--
 value60/value
/parameter
parameter
 namelogAbandoned/name
!-- Log a stack trace of the code which abandoned --
 valuefalse/value
/parameter
parameter
 namefactory/name
!--DBCP Basic Datasource Factory --
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter

parameternameusername/namevaluesa/value/parameter
parameternamepassword/namevalue/value/parameter
parameternamedriverClassName/name

valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value/parameter
parameternameurl/name

valuejdbc:microsoft:sqlserver://localhost:1433;databaseName=myworkflow
/value/parameter
  /ResourceParams
/Context

It works well. But now, we need to migrate myworkflow into another
tomcat4.1.31, in which the server.xml can't be modified.
So what shall i do to deploy the jdbc context? Thanks for your help!

 Best Regards.
   jacky


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





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



Re: jdbc context

2006-02-13 Thread jacky
ok, thanks a lot!

 Best Regards.
   jacky  
   
- Original Message - 
From: Duan, Nick [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, February 14, 2006 12:21 AM
Subject: RE: jdbc context


Well, I guess it was my mistake.  In Tomcat 5.5 you will be able to
define the context information within each web app, by creating a
context.xml in your war file, and the corresponding resource-ref in
web.xml.  Apparently this is not available in tomcat 4.1

I guess there are two options you may consider:  One is to upgrade your
tomcat to 5.5.  The other is to change the web app not to use JNDI, but
to use the data source factory directly in your code.

Hope this helps.

ND

-Original Message-
From: chen jacky [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 13, 2006 10:49 AM
To: users@tomcat.apache.org
Subject: RE: jdbc context

hi,
  Do you mean add the following code in the web.xml?
resource-ref
  descriptionDB Connection/description
  res-ref-namejdbc/TestDB/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref

But this still need to add the jdbc config in the server.xml,right?
Can you give me some suggestions?

From: Duan, Nick [EMAIL PROTECTED]
Reply-To: Tomcat Users List users@tomcat.apache.org
To: Tomcat Users List users@tomcat.apache.org
Subject: RE: jdbc context
Date: Mon, 13 Feb 2006 10:11:34 -0500

You should be able to add the context info in your web.xml file.  In
other words, instead of making the JDBC resource available to all web
apps, you make it only to particular applications.  If this JDBC
connection is only used by the workflow web app, defining it in web.xml
is actually preferred.

ND

-Original Message-
From: jacky [mailto:[EMAIL PROTECTED]
Sent: Monday, February 13, 2006 5:07 AM
To: users@tomcat.apache.org
Subject: jdbc context

hi,
I have deploy a workflow webapp in Tomcat4.1.31. First time, i add
the following code in server.xml:

Context path=/myworkflow docBase=myworkflow reloadable=true 
   Resource name=jdbc/DefaultDS
type=javax.sql.DataSource/
   ResourceParams name=jdbc/DefaultDS
   parameter
  namemaxActive/name
 !-- Maximum number of DB connections in pool.Set to 0 for no
limit.
--
  value100/value
 /parameter
 parameter
  namemaxIdle/name
 !-- Maximum number of idle DB connections to retain in pool.Set
to
0 for no limit. --
  value30/value
 /parameter
 parameter
  namemaxWait/name
 !-- Maximum time to wait for a DB connection to become available
in
ms.An exception is thrown if this timeout is exceeded.Set to -1 to wait
indefinitely. --
  value15000/value
 /parameter
 parameter
  nameremoveAbandoned/name
 !-- Abandoned DB connections are removed and recycled --
  valuetrue/value
 /parameter
 parameter
  nameremoveAbandonedTimeout/name
 !-- Use the removeAbandonedTimeout parameter to set the number of
seconds a DB connection has been idle before it is considered
abandoned.
--
  value60/value
 /parameter
 parameter
  namelogAbandoned/name
 !-- Log a stack trace of the code which abandoned --
  valuefalse/value
 /parameter
 parameter
  namefactory/name
 !--DBCP Basic Datasource Factory --
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter

parameternameusername/namevaluesa/value/parameter

parameternamepassword/namevalue/value/parameter
 parameternamedriverClassName/name

valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value/parameter
 parameternameurl/name

valuejdbc:microsoft:sqlserver://localhost:1433;databaseName=myworkflo
w
/value/parameter
   /ResourceParams
/Context

It works well. But now, we need to migrate myworkflow into another
tomcat4.1.31, in which the server.xml can't be modified.
So what shall i do to deploy the jdbc context? Thanks for your help!

  Best Regards.
jacky


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




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


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



context error

2006-02-13 Thread jacky
hi,
   When i add a Context in the server.xml, an error occurs:

Apache Tomcat/4.1.31
Catalina.start: LifecycleException:  Context startup failed due to previous 
errors
LifecycleException:  Context startup failed due to previous errors
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3578)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:450)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
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:156)
Stopping service Tomcat-Standalone
Catalina.stop: LifecycleException:  Coyote connector has not been started
LifecycleException:  Coyote connector has not been started
at 
org.apache.coyote.tomcat4.CoyoteConnector.stop(CoyoteConnector.java:1296)
at 
org.apache.catalina.core.StandardService.stop(StandardService.java:499)
at 
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2178)
at org.apache.catalina.startup.Catalina.start(Catalina.java:494)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
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:156)

If i remove the added context, tomcat will start.
In fact, i rearrange the directories, i don't know if this will impact on the 
Context. If i put all directories under $CATALINA_HOME, tomcat will work well 
with the Context.

 $CATALINA_HOME/bin/
   shared/
   server/

$CATALINA_BASE/bin/
   conf/
   webapps/
   logs/
   work/

Context is as following:   
Context path=/test docBase=test reloadable=true /
   
 Best Regards.
   jacky  
   

wrong System encoding

2006-01-18 Thread jacky
hi,
RedHat7.3(System encoding is iso8859-15), tomcat 4.1.30
When i use System.getProperty(file.encoding) in a jsp, it print utf-8. 
I think the utf-8 must be the encode of tomcat,but how can i get the system 
encode: iso8859-15?  In fact, i need the right encode to write/read file.
BTW, i wander why the encode of tomcat container changes to utf-8. Is the 
reason because i used reponse.setContentType(text/html; charset=utf-8)?
Any suggestion is helpful!

 Best Regards.
   jacky  
   

Re: wrong System encoding

2006-01-18 Thread chen jacky

hi,
 Yes, i have run a java application at commant prompt, it prints 
ISO-8859-15.




From: Anto Paul [EMAIL PROTECTED]
Reply-To: Tomcat Users List users@tomcat.apache.org
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: wrong System encoding
Date: Wed, 18 Jan 2006 16:32:14 +0530

On 1/18/06, jacky [EMAIL PROTECTED] wrote:
 hi,
 RedHat7.3(System encoding is iso8859-15), tomcat 4.1.30
 When i use System.getProperty(file.encoding) in a jsp, it print 
utf-8. I think the utf-8 must be the encode of tomcat,but how can i get 
the system encode: iso8859-15?  In fact, i need the right encode to 
write/read file.
 BTW, i wander why the encode of tomcat container changes to 
utf-8. Is the reason because i used reponse.setContentType(text/html; 
charset=utf-8)?

 Any suggestion is helpful!


I dont know the solution but just to know did you tried running a java
application at the command prompt to test the value of
System.getProperty(file.encoding) ?


--
rgds
Anto Paul

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





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