I changed the context.xml for manager and now manager will not start

2015-06-08 Thread Mark Shifman

Help I feel like such a ninny:

I am using apache-tomcat-8.0.20 java version 1.8.0_25  on a linux box.
my new context.xml is (I changed some datasource parameters) and is living in 
manager

Context antiResourceLocking=false privileged=true 
  Resource name=jdbc/prot_manager auth=Container
type=javax.sql.DataSource 
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:xxx.xxx.xxx.xxx:1521:xxx
username=xxx
password=xxx
maxTotal=2
maxIdle=2
maxWaitMillis=1
testOnCreate=true
testOnBorrow=true
timeBetweenEvictionRunsMillis=1
removeAbandonedTimeout=300
removeAbandonedOnBorrow=true
testWhileIdle=true
closeMethod=close
connectionInitSqls=call dbms_session.set_identifier('manager')/

  Realm className=org.apache.catalina.realm.LockOutRealm
  Realm className=org.apache.catalina.realm.DataSourceRealm
  dataSourceName=jdbc/prot_manager localDataSource=true
  userTable=p_user userNameCol=logon_id userCredCol=password
  userRoleTable=p_user_roles roleNameCol=role_name /
/Realm
  Valve className=org.apache.catalina.valves.RemoteAddrValve 
allow=xxx\.xx\.xx\.xxx|xxx\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1 /
/Context

the old one that worked was
Context antiResourceLocking=false privileged=true 
  Resource name=jdbc/prot_manager auth=Container
type=javax.sql.DataSource 
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:.xxx.xxx.xxx:1521:
username=
password=
maxTotal=2
maxIdle=2
maxWait=1
validationQuery=SELECT 1 from dual
testOnBorrow=true
closeMethod=close
connectionInitSqls=call dbms_session.set_identifier('manager')/

  Realm className=org.apache.catalina.realm.LockOutRealm
  Realm className=org.apache.catalina.realm.DataSourceRealm
  dataSourceName=jdbc/prot_manager localDataSource=true
  userTable=p_user userNameCol=logon_id userCredCol=password
  userRoleTable=p_user_roles roleNameCol=role_name /
/Realm
  Valve className=org.apache.catalina.valves.RemoteAddrValve 
allow=xxx\.xx\.xx\.xx|xx\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1 /
/Context

I even tried the virginal context.xml

Context antiResourceLocking=false privileged=true 
  !--
Remove the comment markers from around the Valve below to limit access to
the manager application to clients connecting from localhost
  --
  !--
  Valve className=org.apache.catalina.valves.RemoteAddrValve
 allow=127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1 /
  --
/Context

each time restarting tomcat with no luck in starting the manager.

I don't see anything in my logs but maybe there is some log somewhere I haven't 
found like in /var/logs.

any help would be appreciated.

--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
mark.shif...@yale.edu


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



tomcat 8.0.20 can't make manager run HTTP Status 404 - /manager/status etc

2015-02-26 Thread Mark Shifman

This is truly embarrassing since I have the manager running fine  on tomcat 7.

http://localhost:8080/manager/status
returns
127.0.0.1 - - [26/Feb/2015:10:47:11 -0500] GET /manager/status HTTP/1.1 404 
1022

http://localhost:8080/manager/html
returns
127.0.0.1 - - [26/Feb/2015:11:00:40 -0500] GET /manager/html HTTP/1.1 404 1018

I am starting tomcat 8.0.20 with jsvc and running tomcat as mas

catalina.out shows

Feb 26, 2015 10:37:23 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory 
/home/apache-tomcat-8.0.20/webapps/manager has finished in 326 ms

so it looks like the manager is started.

tomcat-users.xml is shown below:
?xml version='1.0' encoding='utf-8'?
!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the License); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an AS IS BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--
tomcat-users xmlns=http://tomcat.apache.org/xml;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://tomcat.apache.org/xml tomcat-users.xsd
  version=1.0
!--
  NOTE:  By default, no user is included in the manager-gui role required
  to operate the /manager/html web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
--
  role rolename=manager-gui/
  role rolename=manager-script/
  user username=mas password=masxxx roles=manager-gui,manager-script/
/tomcat-users


The file permissions are show below:
 ls -lrt /home/apache-tomcat-8.0.20/conf
-rw--- 1 mas mas   1893 Feb 26 09:49 tomcat-users.xml

There is obviously something egregious I have done or missed but I can't find 
it.

any help appreciated.

mas


--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
mark.shif...@yale.edu


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 8.0.20 can't make manager run HTTP Status 404 - /manager/status etc

2015-02-26 Thread Mark Shifman



On 02/26/2015 11:26 AM, Mark Shifman wrote:

This is truly embarrassing since I have the manager running fine  on tomcat 7.

https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A8080_manager_statusd=AwIC-gc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=t8sx2oxLU2xFh_hEfhXwWU4fIqfFYmqPF9q4PmUBS_Qs=oRaGhibZvAOGCqQay4tltXaYNS7R8Coq6rBIG-D3CEke=
 returns
127.0.0.1 - - [26/Feb/2015:10:47:11 -0500] GET /manager/status HTTP/1.1 404 
1022

https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A8080_manager_htmld=AwIC-gc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=t8sx2oxLU2xFh_hEfhXwWU4fIqfFYmqPF9q4PmUBS_Qs=zZwSEgq3pjJ2377O8SahLwmRSvTTnayriks9TAXl9Qge=
 returns
127.0.0.1 - - [26/Feb/2015:11:00:40 -0500] GET /manager/html HTTP/1.1 404 1018

I am starting tomcat 8.0.20 with jsvc and running tomcat as mas

catalina.out shows

Feb 26, 2015 10:37:23 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory 
/home/apache-tomcat-8.0.20/webapps/manager has finished in 326 ms

so it looks like the manager is started.

tomcat-users.xml is shown below:
?xml version='1.0' encoding='utf-8'?
!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the License); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

https://urldefense.proofpoint.com/v2/url?u=http-3A__www.apache.org_licenses_LICENSE-2D2.0d=AwIC-gc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=t8sx2oxLU2xFh_hEfhXwWU4fIqfFYmqPF9q4PmUBS_Qs=JvGEREmyRh9iXqaeKQyCHUrcjD1O_2toZhlSNaDW5W0e=
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an AS IS BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--
tomcat-users 
xmlns=https://urldefense.proofpoint.com/v2/url?u=http-3A__tomcat.apache.org_xmld=AwIC-gc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=t8sx2oxLU2xFh_hEfhXwWU4fIqfFYmqPF9q4PmUBS_Qs=RZuTCXhEBaQzBY9YA5BW3-AQ2-yfRVkpPVxCPhW5m8ge=
 
xmlns:xsi=https://urldefense.proofpoint.com/v2/url?u=http-3A__www.w3.org_2001_XMLSchema-2Dinstanced=AwIC-gc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=t8sx2oxLU2xFh_hEfhXwWU4fIqfFYmqPF9q4PmUBS_Qs=1g4xwwiqhgqK92eD5QBc-w_9EO2Z_Owc9toWZogUkTce=
 
xsi:schemaLocation=https://urldefense.proofpoint.com/v2/url?u=http-3A__tomcat.apache.org_xmld=AwIC-gc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=t8sx2oxLU2xFh_hEfhXwWU4fIqfFYmqPF9q4PmUBS_Qs=RZuTCXhEBaQzBY9YA5BW3-AQ2-yfRVkpPVxCPhW5m8ge=
 tomcat-users.xsd
  version=1.0
!--
  NOTE:  By default, no user is included in the manager-gui role required
  to operate the /manager/html web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
--
  role rolename=manager-gui/
  role rolename=manager-script/
  user username=mas password=masxxx roles=manager-gui,manager-script/
/tomcat-users


The file permissions are show below:
 ls -lrt /home/apache-tomcat-8.0.20/conf
-rw--- 1 mas mas   1893 Feb 26 09:49 tomcat-users.xml

There is obviously something egregious I have done or missed but I can't find 
it.

any help appreciated.

mas



server.xml contains:
  GlobalNamingResources
!-- Editable user database that can also be used by
 UserDatabaseRealm to authenticate users
--
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /
  /GlobalNamingResources

and
  Realm className=org.apache.catalina.realm.LockOutRealm
!-- This Realm uses the UserDatabase configured in the global JNDI
 resources under the key UserDatabase.  Any edits
 that are performed against this UserDatabase are immediately
 available for use by the Realm.  --
Realm className=org.apache.catalina.realm.UserDatabaseRealm
   resourceName=UserDatabase/
  /Realm

--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
mark.shif...@yale.edu


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 8.0.20 can't make manager run HTTP Status 404 - /manager/status etc

2015-02-26 Thread Mark Shifman



On 02/26/2015 12:52 PM, Konstantin Kolinko wrote:

2015-02-26 19:26 GMT+03:00 Mark Shifman mark.shif...@yale.edu:

This is truly embarrassing since I have the manager running fine  on tomcat
7.

https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A8080_manager_statusd=AwIBaQc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=qAAyZ6f2PpvD8ZHfq17E7vm0di_oOBZ5L417zIFArJos=CKor4EvRLf9Xl_PoOL58dKcTnpRepmn-UxWIo91RQJMe=
returns
127.0.0.1 - - [26/Feb/2015:10:47:11 -0500] GET /manager/status HTTP/1.1
404 1022

https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A8080_manager_htmld=AwIBaQc=-dg2m7zWuuDZ0MUcV7Sdqwr=oZj4zInar3jeBECJ7OuBEMWJwBrzGeex-klf3JCRGssm=qAAyZ6f2PpvD8ZHfq17E7vm0di_oOBZ5L417zIFArJos=ODlwW-mr7a0mrNGd3WNAoZw6kQbhUEwZF7jBixbqgoAe=
returns
127.0.0.1 - - [26/Feb/2015:11:00:40 -0500] GET /manager/html HTTP/1.1 404
1018

I am starting tomcat 8.0.20 with jsvc and running tomcat as mas

catalina.out shows

Feb 26, 2015 10:37:23 AM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deployment of web application directory
/home/apache-tomcat-8.0.20/webapps/manager has finished in 326 ms

so it looks like the manager is started.

No. The above message just displays timing (some people were
interested in how long the deployment takes). The same text is used
regardless of success or failure.

404 usually means that the web application is not running. In that
situation the request is served by the ROOT webapp, not by manager
webapp. (It is visible if either the ROOT webapp or the manager webapp
has its own configuration of AccessLogValve).

Do you have the files in /home/apache-tomcat-8.0.20/webapps/manager ?

Thanks for the suggestion.  I modified the context.xml then changed it back to 
the original leaving
a context.xml~ file hanging around. This must have been the problem.

Your suggestion made me replace that manager with  a clean virginal copy of 
manager.jar from the tar ball.

Afterwards, everything worked like a charm.

Thanks to all.
mas



Any chance that you are starting with Java Security Manager being
enabled? In this case you should see error messages in the logs.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
mark.shif...@yale.edu


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Connection pooling issue on Tomcat

2014-03-28 Thread Mark Shifman


On 03/28/2014 11:58 AM, Propes, Barry L wrote:

Hi folks,

I'm using Tomcat 6.0.29 for an app I've had in place for years. I run the Java 
app I have on a Windows 2003 server for my production region, but have local 
builds on both my desktop and laptop, both of which are Windows XP Pro. Yes, I 
do realize that the Tomcat version is old, but we'll be retiring the app in a 
few months so there's no need (at this time) to upgrade it.

I use connection pooling, specifically Tomcat's DBCP class.

This app has worked for years, but is suddenly encountering a strange 
connection error and issue to the PROD region only of Oracle 11.
This just started in the last week. I'll include the contents of my context XML 
file and the errors that it's generating.

Even stranger, my development build to the Oracle UAT region works just fine! 
These content.xml files are virtually the same, except one references the 
Oracle PROD region, and the other references the Oracle UAT region. The 
Resource name attributes vary really only slightly, one called myoracle, the 
other called myoracledev.

Context
   Resource
 auth=Container
 description=changectrlapp
 name=jdbc/myoracle
 type=javax.sql.DataSource
 driverClassName=oracle.jdbc.driver.OracleDriver
 username=username
 password=password
url=jdbc:oracle:thin:@servername.dom.net:1648:SVCNAME
 maxIdle=30
 maxWait=1
 maxActive=20
 testOnBorrow=true
 timeBetweenEvictionRunsMillis=-1
 minEvictableIdleTimeMillis=28800
 poolPreparedStatements=true
 removeAbandoned=true
 removeAbandonedTimeout=300
 logAbandoned=false/

The errors I am getting are:

javax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: 
Cannot create PoolableConnectionFactory (ORA-01033: ORACLE initialization or 
shutdown in progress



org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create 
PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in 
progress


java.sql.SQLRecoverableException: ORA-01033: ORACLE initialization or shutdown 
in progress

For   what its  worth,   I recently got this error which looks like it is an 
ORACLE issue rather than connection pool issue.
When I talked to our db administrator, they were doing some sort of maintenance 
on oracle at exactly the same time
I got the error.

mas




This may not be much to go on.

But like I said, with attributes only slightly different, the connection to UAT 
works. By the way, I am connecting successfully to the Oracle PROD DB through 
other avenues: TOAD,SQL Plus, MS Access, etc.



So the DB itself is working.


Both my DEV/UAT and PROD regions use the same DBCP classes. Could something 
have gotten corrupted for one and not the other?

Any feedback is welcomed. Let me know, please, if I neglected to add anything 
pertinent to this.




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
mark.shif...@yale.edu


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat jdbc

2012-10-19 Thread Mark Shifman

On 10/18/2012 02:51 PM, S Ahmed wrote:

Hi,

When using the jdbc connection pool library, would it be possible to
somehow record the # of connections that are being used, when the # of
connections in the pool are being saturated etc., or is that something that
would have to be modified in the library itself?

You can see the connections by doing an appropriate select on your database.  
For oracle select v$session like

select username, program, machine, client_identifier, osuser,logon_time,  sid, 
serial#
from v$session where osuser != 'oracle' order by program, machine, 
client_identifier, logon_time

There is also a simple way to see the connections in mysql but I can't remember 
it


i.e. assuming I have can keep track of these counters, is there a way to
monitor these events in the library or would the jdbc library itself need
to be modified to expose these events?



--
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Downloading an entire website from a specific URL?

2011-12-28 Thread Mark Shifman

wget

On 12/28/2011 2:19 AM, Craig Burlock wrote:

  Hello smart-people,

This isn't strictly a Tomcat question, however I thought you were the
people to ask:

*Can anyone recommend a utility for downloading an entire website
(including links and child pages) from a specific URL?*

I need to get a copy of a specific section of a wiki. I'm using Windows XP,
so a Windows
or DOS based utility would be awesome.

I have found a few utilities using Google, however I was wanting to know
what the Tomcat community
thought...

Any suggestions?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Moving init params from web.xml to context.xml

2011-08-23 Thread Mark Shifman
org
For additional commands, e-mail: users-h...@tomcat.apache.org


    

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

  



problem upgrading to Apache Commons Lang 3.0 and Tomcat.7 (

2011-07-20 Thread Mark Shifman
This morning I upgraded my webapp to Apache Commons Lang 3.0. When I redeployed
the webapp I got

Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.commons.lang.UnhandledException
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
...

My question is where is the best place to put old Lang 2.5 jar? Is there a 
problem putting it
in $TOMCAT_HOME/lib? or should I just put it in the WEB-INF/lib for the 
application?

Thanks in advance.

mas



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Data source is closed before contextDestroyed is executed. tomcat 7.0.11

2011-03-28 Thread Mark Shifman
I just started playing with tomcat 7.0.11 and I noticed this error on the logs 
which
occurs when I shutdown tomcat.

Mar 28, 2011 10:47:57 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Mar 28, 2011 10:47:57 AM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class 
org.ycmi.listeners.contextListener
java.lang.RuntimeException: java.sql.SQLException: Data source is closed
at org.ycmi.prot.ypresults.db.dbUtils.update(dbUtils.java:495)
at 
org.ycmi.listeners.contextListener.contextDestroyed(contextListener.java:58)
...

In my ServletContextListener contextDestroyed method I do a database update to 
clean up a table.

This looks like the DataSource is being closed before contextDestroyed is run 
so I can't do the clean up. This wasn't
a problem is tomcat 6.

Is there someplace else I should do this cleanup?  When is the DataSource 
closed? Shouldn't/couldn't the DataSource
be closed after contextDestroyed has run.



-- 
 Mark Shifman

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Cannot set JAVA_HOME for jsvc/Tomcat 7.0.11... i've tried EVERYTHING

2011-03-24 Thread Mark Shifman
add -home directory as an argument to jsvc.

if you type /bin/jsvc --help at a command line there are a bunch of other 
parameters
you may find helpful.

also if you look in /jsvc-src/native there are a couple of Tomcat?.sh files
(pretty old but you will get the idea) that you can modify to start and stop 
tomcat via jsvc.
mas



On 03/24/2011 01:43 PM, Kevin wrote:
 Hi, I'm pulling my hair trying to install Tomcat 7.0.11 on my machine.
 
  
 
 Here's my info at a glance:
 
  
 
 OS: Ubuntu 10.10
 
 Tomcat version: 7.0.11
 
 Tomcat main folder path: /usr/local/apache-tomcat-7.0.11/
 
 JDK version (via the java -version command) : 1.6.0.24
 
 JDK location: /usr/lib/jvm/java-6-sun
 
  
 
 I'm running in to a problem trying to run Tomcat as a daemon via jsvc.
 Before I installed Tomcat I set $JAVA_HOME in:
 
  
 
 /etc/environment
 
  
 
 to:
 
  
 
 /usr/lib/jvm/java-6-sun  (logged out then back in, then used $echo
 $JAVA_HOME to verify it was set)
 
  
 
 Then I installed Tomcat, un-tar'd the commons-daemon-native.tar.gz, and
 ./configure 'd it. It complained about JAVA_HOME not being set, so I had
 to ./configure it again with:
 
  
 
 --with-java=/usr/lib/jvm/java-6-sun
 
  
 
 Then used make.  Copied it to:
 
  
 
 usr/local/apache-tomcat-7.0.11/bin
 
  
 
 .and try to execute:
 
  
 
 /bin/jsvc -cp ./bin/bootstrap.jar:./bin/tomcat-juli.jar \
 
 -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
 
 org.apache.catalina.startup.Bootstrap
 
  
 
 which gives me the dreaded Cannot locate Java Home error.  It tried
 setting it in ~/.bashrc with the line:
 
  
 
 export JAVA_HOME=/usr/lib/jvm/java-6-sun 
 
  
 
 and logged out and back in. Still to no dice.
 
  
 
 I honestly don't know what to do and am at a loss right now. I think it
 might have to do with the jdk, but I installed it straight from the package
 manager. 
 
 I'm pretty sure only the JDK comes with javac, and using javac -version
 produces 1.6.0_24. So. I'm pretty sure I have both the JRE and JDK
 
  
 
 Can someone, anyone, try to help me? I honestly don't know what to do
 anymore.
 
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: IPv6 Issue with Tomcat

2011-02-11 Thread Mark Shifman
I was burned in a similar fashion. Phil Steitz (on the commons user list)
pointed me to.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6483406

One recommended fix/workaround is that suggested by Chuck in a previous post.
mas



On 02/11/2011 10:39 AM, Martin Dubuc wrote:
 I am using Tomcat 6.0.29 and JDK 6 Update 23.
 
 Martin
 
 On Fri, Feb 11, 2011 at 10:30 AM, Caldarale, Charles R 
 chuck.caldar...@unisys.com wrote:
 
 From: Martin Dubuc [mailto:martind1...@gmail.com]
 Subject: IPv6 Issue with Tomcat

 I am wondering if there is configuration within Tomcat
 to force the driver not to use IPv6.

 Not within Tomcat, but possibly for the JVM you're using.  Try setting
 -Djava.net.preferIPv4Stack=true as a JVM system property parameter.

 Of course, not telling us your actual Tomcat version, the JVM level you're
 using, and the platform you're on makes providing advice somewhat of a shot
 in the dark.

  - 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: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Placing JARs in ..../tomcat/shared/lib causes leaks when stopping apps?

2010-11-17 Thread Mark Shifman
On 11/17/2010 02:43 AM, Mikolaj Rydzewski wrote:
 
 On Tue, 16 Nov 2010 22:55:10 -0500, Brian bbprefix-m...@yahoo.com wrote:
 
 I have two identical apps running at the same time. I mean, they use exactly
 the same WAR, but each one runs in a different web domain.
 [...]
 
 You should rather change your application to be aware of domain it runs in.
 Done that, there would be only one webapp deployed - no matter how many 
 domains you need to handle.
 
Perhaps you could give Brian a hint on how to do this.  Would using aliases 
within the host do the trick?

mas



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat log files

2010-11-09 Thread Mark Shifman
you need to look at
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
and do what it says for log4j

On 11/09/2010 01:48 PM, Timothy Lam wrote:
 I'm trying to clean up Tomcat logging to use log4j.  I've read the Tomcat 
 logging guide that comes with my version of Tomcat 6.0.28.  I'm really 
 confused with all the different log files that are being generated in the 
 default Tomcat before log4j configuration.  Why are there so many different 
 log files: admin, manager, localhost, manager, host-manager, catalina log 
 files and then System.out and System.err get appended to catalina.out?  
 What's the purpose of each of these log files?  When I configure log4j in 
 tomcat I will have this single tomcat.log file but will that contain 
 everything in the default log files that I previously listed in addition to 
 catalina.out?  Or will I need to use both tomcat.log and catalina.out to get 
 a full picture of all of my logging?  I tried to delete the 
 logging.properties file in my Tomcat 6.0.28 and I get a 
 NoClassDefFoundException in doing so.  So there doesn't seem to be any way of 
 really removing java.util.logging
 from Tomcat in v6.0.28.
 
 
 
   
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

mas

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



jsvc takes a really long time to start tomcat

2010-10-08 Thread Mark Shifman
jsvc used to stop and start my tomcat server very quickly (15-30 seconds).

Recently, I noticed it stops right away but takes about 3 minutes to start.
(I of course don't know what I changed.)
I have tried: 1.recompiling jsvc, 2.using the newest native 
commons-daemon-1.0.3-bin-linux-x86_64.tar.gz
and commons daemon commons-daemon-1.0.3-bin.tar.gz
with no improvement.

I must be missing something very basic.
Any help would be appreciated.
mas

System details:
tomcat 6.0.18
java version 1.6.0_20
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
CentOS release 5.2 (Final)
Linux  2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 11:57:43 EST 2008 x86_64 x86_64 
x86_64 GNU/Linux

the start up script:

# Source function library.
. /etc/init.d/functions

# Adapt the following lines to your configuration
JAVA_HOME=/usr/java/jdk1.6.0_20
CATALINA_HOME=/home/apache-tomcat-6.0.18
DAEMON_HOME=/home/apache-tomcat-6.0.18/bin
TOMCAT_USER=tomcat

CATALINA_OPTS= -Djava.awt.headless=true -Xmx1g -Xms1g -Xincgc 
-XX:MaxPermSize=256m 
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar

start(){
$DAEMON_HOME/jsvc \
-user $TOMCAT_USER \
-home $JAVA_HOME \
-Dcatalina.home=$CATALINA_HOME \
-Djava.io.tmpdir=$CATALINA_HOME/temp \
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile '1' \
$CATALINA_OPTS \
-cp $CLASSPATH \
org.apache.catalina.startup.Bootstrap
echo starting:  $CATALINA_HOME
echo tomcat user:  $TOMCAT_USER

}

stop(){
$DAEMON_HOME/jsvc \
-stop \
-pidfile  /var/run/jsvc.pid \
org.apache.catalina.startup.Bootstrap

echo stopping tomcat:  $CATALINA_HOME
echo tomcat user:  $TOMCAT_USER

}


case $1 in
  start)
#
# Start Tomcat
#
start
;;

  status)
status jsvc
;;

  stop)
#
# Stop Tomcat
#
stop
;;

  restart)
stop
start
;;

  *)
echo Usage tomcat6.0.18  start/stop/restart/status
exit 1;;
esac

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WARNING: Parameters : Invalid Chunk xxxx ignored

2010-08-11 Thread Mark Shifman
google is your friend!

http://marc.info/?l=tomcat-userm=118662577608193

Probably means somebody made a query-string that tomcat doesn't like.
mas

On 08/11/2010 08:28 AM, Richard da Silva wrote:
 Hi all,
 
 I am running an IDM application on Tomcat (I'm using version 6).
 
 Everything is working fine; no problems (technically, anyway).
 
 But, for some reason, I keep getting the following error report in my Tomcat 
 Server window :
 WARNING : Parameters : Invalid Chunk attribute name ignored
 
 
 Usually, I get up to a dozen such messages (for each attribute being fetched 
 into my application). I have no idea what this means.
 
 As I said, the application is behaving as it should. So, I don't understand 
 what this error message is referring to.
 
 Any tips, please?
 
 Thanks
 
 
 Richard da Silva
 
 
 

-- 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: FW: Mascot Server update now available

2010-08-04 Thread Mark Shifman
I just installed the new patch for Mascot.
and mascot is running.
mas

On 08/02/2010 06:57 PM, Kathryn Stone wrote:
 Hi guys-
 
  
 
 Can you do the update on the Linux?  Thanks
 
  
 
 Kathy
 
  
 
 MS  Proteomics Resource
 
 W.M. Keck Biotechnology Resource Laboratory
 
 Rm G001
 
 300 George Street
 
 New Haven CT 06511
 
  
 
 kathryn.st...@yale.edu
 
  
 
 *From:* Matrix Science Technical Support [mailto:supp...@matrixscience.com]
 *Sent:* Monday, August 02, 2010 6:50 PM
 *To:* Kathy Stone
 *Subject:* Mascot Server update now available
 
  
 
 Dear Kathy Stone,
 
 An update for Mascot 2.3 for Linux is now available for download.
 
 Separate downloads are available for the 64 bit and 32 bit versions:
 - 64 bit:
 http://www.matrixscience.com/patch/mascot_2_3_01_patch_x86_64-linux.tar.bz2
 - 32 bit:
 http://www.matrixscience.com/patch/mascot_2_3_01_patch_i86_rh80.tar.bz2
 
 You will be required to enter a user name and password to download the
 update:
 User name: yu_ks
 Password: 84r2hr93
 
 This patch should only be used on a Mascot 2.3 installation. It will not
 update files from 2.2.x and earlier versions.
 
 To install the software:
 
 * check that there are no searches running on the server
 * stop the ms-monitor.exe daemon
 * copy the patch to /usr/local/mascot (or to wherever Mascot is
   installed)
 * bunzip2 mascot_2_3_01_patch_x86_64-linux.tar.bz2
 * tar xvf mascot_2_3_01_patch_x86_64-linux.tar
 * If Apache is configured to run under apache rather than nobody
   (the latter being the values in the tar archive), then the
   permissions will now be wrong.  To fix this:
 find . -user nobody | xargs chown apache:apache
 * start the ms-monitor.exe daemon
 
 (For the 32 bit release, substitute the 32 bit filename in the above
 commands)
 
 A list of the changes made can be found at
 http://www.matrixscience.com/mascot_support.html#2.3.
 
 Please don't hesitate to contact me if you have any questions.
 
 Best regards,
 
 Richard Jacob
 -- 
 Richard Jacob
 Country Manager, North America
 Matrix Science Inc.
 225 Franklin St., 26th fl.,
 Boston, MA 02110, USA
 Tel: (800) 716 6702
 Fax: (800) 716 6704
 richa...@matrixscience.com
 http://www.matrixscience.com
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: FW: Mascot Server update now available Disregard this message

2010-08-04 Thread Mark Shifman
Mea culpa, Mea Culpa
mas

On 08/04/2010 03:26 PM, Mark Shifman wrote:
 I just installed the new patch for Mascot.
 and mascot is running.
...

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JAXBContext leaks memory

2010-05-17 Thread Mark Shifman
  |  
   |1
--

If in undeploy and redeploy the struts blank app and do a duplicate classes 
query I get this:

Class Name  | Count | Defined 
Classes | No. of Instances

org.apache.catalina.loader.JdbcLeakPrevention   | 2 |   
  |
|- org.apache.catalina.loader.WebappClassLoader @ 0x948b5c38|   |   
  260 |  186
|- org.apache.catalina.loader.WebappClassLoader @ 0x94958320|   |   
  260 |  186
'- Total: 2 entries |   |   
  |
org.apache.commons.beanutils.BeanAccessLanguageException| 2 |   
  |
org.apache.commons.beanutils.BeanUtils  | 2 |   
  |
org.apache.commons.beanutils.BeanUtilsBean  | 2 |   
  |
org.apache.commons.beanutils.BeanUtilsBean$1| 2 |   
  |
org.apache.commons.beanutils.ContextClassLoaderLocal| 2 |   
  |
org.apache.commons.beanutils.ConversionException| 2 |   
  |
org.apache.commons.beanutils.ConvertUtils   | 2 |   
  |
org.apache.commons.beanutils.ConvertUtilsBean   | 2 |   
  |
org.apache.commons.beanutils.Converter  | 2 |   
  |
org.apache.commons.beanutils.DynaBean   | 2 |   
  |
org.apache.commons.beanutils.DynaClass  | 2 |   
  |
org.apache.commons.beanutils.DynaProperty   | 2 |   
  |
org.apache.commons.beanutils.MappedPropertyDescriptor   | 2 |   
  |
Total: 14 of 260 entries|   520 |   
  |


The struts 1.3.10 blank webapp is found here 
http://www.alliedquotes.com/mirrors/apache/struts/examples/struts-1.3.10-apps.zip
It is just a shell without much of anything except a welcome page.

I am now worried that I have done something wrong with jsvc (which is why I 
included my startup script). I added
-Djava.util.logging.config.file=$CATALINA_HOME/conf/logging.properties and
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager to the script 
after snooping in catalina.sh.
This made juli logging work but didn't get rid of the leak.


Any ideas would be appreciated.
mas

On 05/15/2010 04:58 AM, Pid wrote:
 On 14/05/2010 19:21, Mark Shifman wrote:
 After playing around I don't think the leak is from JAXBContext.  My web app 
 is running under struts 1.3.10. I tested
 the blank web apps that comes with struts 1.3.10 and it showed a memory leak 
 on undeploying and redeploying. (so did the
 blank web app for the current struts 2). Using Eclipse MAT the retained 
 WebappClassLoader showed a bunch of commons.beanutils
 classes but I am not sure how to follow it any farther.

 So either there is something funky with commons.beanutils 1.8.0 (also tried 
 the newer version)(ie something tricky with reflection or commons-logging)
 or I have some how done something really stupid with my tomcat/jvm 
 configuration that goofs up garbage collection.
 
 Interesting.  I had more of a nose around in JAXBContext and the
 peripheral objects and found some things I'm slightly curious about but
 nothing that looks leaky.  I'm using JAXB myself and haven't seen much
 of a side-effect.
 
 I'd be happy to have a look at Struts if you'd like to detail some of
 what you've found.  Maybe we'll find something that can be contributed
 to the Tomcat JreMemoryLeakPrevention.
 
 
 p
 
 
 mas

 On 05/03/2010 12:15 PM, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.

 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in number
 after running my unmarshal action, followed by undeploy and redeploy.  Find 
 Leaks in the manager also finds leaks.

 The JAXBContext instance is created with a singleton that is an enum (using 
 Josh Block's pattern):

 public enum JAXBContextMascot {
 INSTANCE(com.matrixscience.xmlns.schema.mascot_search_results_2 );
 private JAXBContext ctx;
 JAXBContextMascot(String contextPath) {
 try {
 ctx =JAXBContext.newInstance(clazz);
 } catch (JAXBException e) {
 throw new RuntimeException(e);
 }
 }
 public Unmarshaller createUnmarshaller(){
 try {
 return ctx.createUnmarshaller();
 } catch (JAXBException e

Re: JAXBContext leaks memory

2010-05-14 Thread Mark Shifman
After playing around I don't think the leak is from JAXBContext.  My web app is 
running under struts 1.3.10. I tested
the blank web apps that comes with struts 1.3.10 and it showed a memory leak on 
undeploying and redeploying. (so did the
blank web app for the current struts 2). Using Eclipse MAT the retained 
WebappClassLoader showed a bunch of commons.beanutils
classes but I am not sure how to follow it any farther.

So either there is something funky with commons.beanutils 1.8.0 (also tried the 
newer version)(ie something tricky with reflection or commons-logging)
or I have some how done something really stupid with my tomcat/jvm 
configuration that goofs up garbage collection.

mas

On 05/03/2010 12:15 PM, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.
 
 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in number
 after running my unmarshal action, followed by undeploy and redeploy.  Find 
 Leaks in the manager also finds leaks.
 
 The JAXBContext instance is created with a singleton that is an enum (using 
 Josh Block's pattern):
 
 public enum JAXBContextMascot {
   INSTANCE(com.matrixscience.xmlns.schema.mascot_search_results_2 );
   private JAXBContext ctx;
   JAXBContextMascot(String contextPath) {
   try {
   ctx =JAXBContext.newInstance(clazz);
   } catch (JAXBException e) {
   throw new RuntimeException(e);
   }
   }
   public Unmarshaller createUnmarshaller(){
   try {
   return ctx.createUnmarshaller();
   } catch (JAXBException e) {
   throw new RuntimeException(e);
   }
   }
 }
 
 Am I doing something wrong which is causing the memory leak?
 JAXBContext.newInstance() can take a ClassLoader argument.  Is there some 
 ClassLoader I should be using that will get around this?
 
 Any help would be appreciated.
 mas
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JAXBContext leaks memory

2010-05-04 Thread Mark Shifman

On 05/03/2010 02:53 PM, Pid wrote:
 On 03/05/2010 18:30, Mark Shifman wrote:

 On 05/03/2010 12:48 PM, Pid wrote:
 On 03/05/2010 17:15, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.

 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in 
 number
 after running my unmarshal action, followed by undeploy and redeploy.  
 Find Leaks in the manager also finds leaks.
 
 Do you see log messages referring to potential leaks in the catalina.out
 log (assuming you're on a unix variant)?

 If so, can you post them please?

There are no messages in catalia.out concerning leaks (I am using Linux 
2.6.18-92.1.22.el5)
I also got rid of timeBetweenEvictionRunsMillis in datasource since it causes a 
leaky TimerThread).

 
 What does the manager 'find leaks' command report exactly?
...
leak (use a profiler to confirm):
/yp_results


My webapp is named yp_results.
 
 After a few undeploy/redeploy cycles does the number of
 WebappClassLoader's also increase?

 Yes it increases 1 for each undeploy/redeploy cycle.
 
 snip... 
 
 Maybe.

 JAXBContext.newInstance() can take a ClassLoader argument.  Is there some 
 ClassLoader I should be using that will get around this?
 
 OK, so I've looked at JAXBContext (and JAXBContextImpl) and it doesn't
 (after quick read through) look like it's storing the classloader
 argument anywhere during the newInstance call, which is the usual source
 of leaks.
 
 Where is the jar with the above code, in a webapp?
 The code above in in the war for the web app in a class in 
 WEB-INF/classes/org/blablabla

 It is called via a class that looks like this:

 public class JAXBMascot {
  protected static Log log = LogFactory.getLog(JAXBMascot.class);
  private XMLEventReader reader;
  private Unmarshaller u = 
 JAXBContextMascot.INSTANCE.createUnmarshaller();
 
 You're setting the XMLEventReader, Unmarshaller  InputStream as
 instance field values, rather than completing the parsing in the
 getInstance() method?
I have really big xmls to unmarshall so I am using streaming them in and 
unmarshalling the elements I want
and then insert into my database. I need the reader to see where I am and then 
the umarshaller

I didn't show the all the methods of JAXBMascot but here is workhorse:
public T T getNextElement(String theElement, String elementAfter, 
Class Tclazz) {
String elname = ;
T h = null;
try {
while(reader.hasNext()){
  if(reader.peek().isStartElement()){
 elname = 
reader.peek().asStartElement().getName().getLocalPart();
 if(elname.equals(theElement)){
   h= u.unmarshal(reader, clazz).getValue();
   return h;
 }
  } else if(reader.peek().isEndElement()){
elname = 
reader.peek().asEndElement().getName().getLocalPart();
if(elname.equals(elementAfter)){
return h;
}
}

  reader.nextEvent();
}
} catch (XMLStreamException e) {
throw new RuntimeException(e);
} catch (JAXBException e) {
throw new RuntimeException(e);
}
return h;
}

It also has a close method to clean up after I have gotten all the elements.
public void close(){
try {
reader.close();
} catch (XMLStreamException e) {
//quietly
}
IOUtils.closeQuietly(jxb_in);
u=null;
}
I don't think I am leaving any stuff hanging around but memory leaks are very 
sneaky.
mas
 
 This looks a bit odd to me, but I don't know what the rest of the
 instance does...
 
 
 p
 
  private InputStream jxb_in;

  public static JAXBMascot getInstance(InputStream in) {
  JAXBMascot m = new JAXBMascot();
  try {
  m.setJxb_in(in);
  
 m.setReader(XMLInputFactory.newInstance().createXMLEventReader(in));
  } catch (Exception e) {
  log.fatal(error getting JAXBMascot instance);
  IOUtils.closeQuietly(in);
  throw new RuntimeException(e);
  }

  return m;
  }
 
 }

 This is also in the webapp in WEB-INF/classes/org/blablabla
 
 
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

Re: JAXBContext leaks memory

2010-05-04 Thread Mark Shifman
Thanks.
I'll try Jconsole.
mas

On 05/04/2010 12:28 PM, Pid wrote:
 On 04/05/2010 14:10, Mark Shifman wrote:

 On 05/03/2010 02:53 PM, Pid wrote:
 On 03/05/2010 18:30, Mark Shifman wrote:

 On 05/03/2010 12:48 PM, Pid wrote:
 On 03/05/2010 17:15, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.

 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in 
 number
 after running my unmarshal action, followed by undeploy and redeploy.  
 Find Leaks in the manager also finds leaks.

 Do you see log messages referring to potential leaks in the catalina.out
 log (assuming you're on a unix variant)?

 If so, can you post them please?

 There are no messages in catalia.out concerning leaks (I am using Linux  
 2.6.18-92.1.22.el5)
 I also got rid of timeBetweenEvictionRunsMillis in datasource since it 
 causes a leaky TimerThread).


 What does the manager 'find leaks' command report exactly?
 ...
 leak (use a profiler to confirm):
 /yp_results
 
 There are some useful commands in the JDK which may help track down
 exactly which class is causing the problem.
 
  jmap -histo pid
 
 (and other jmap subcommands)
 
 If you take a snapshot periodically, esp after reload cycles you may be
 able to see which classes are increasing in number.
 
 
 If you can get a VisualVM working, or connect a JConsole to the remote
 VM you may be able to poke around and see which classes aren't being
 garbage collected.
 
 
 My webapp is named yp_results.

 After a few undeploy/redeploy cycles does the number of
 WebappClassLoader's also increase?

 Yes it increases 1 for each undeploy/redeploy cycle.

 snip... 

 Maybe.

 JAXBContext.newInstance() can take a ClassLoader argument.  Is there 
 some ClassLoader I should be using that will get around this?

 OK, so I've looked at JAXBContext (and JAXBContextImpl) and it doesn't
 (after quick read through) look like it's storing the classloader
 argument anywhere during the newInstance call, which is the usual source
 of leaks.
 
 
 Where is the jar with the above code, in a webapp?
 The code above in in the war for the web app in a class in 
 WEB-INF/classes/org/blablabla

 It is called via a class that looks like this:

 public class JAXBMascot {
protected static Log log = LogFactory.getLog(JAXBMascot.class);
private XMLEventReader reader;
private Unmarshaller u = 
 JAXBContextMascot.INSTANCE.createUnmarshaller();

 You're setting the XMLEventReader, Unmarshaller  InputStream as
 instance field values, rather than completing the parsing in the
 getInstance() method?
 I have really big xmls to unmarshall so I am using streaming them in and 
 unmarshalling the elements I want
 and then insert into my database. I need the reader to see where I am and 
 then the umarshaller
 
 I'll have a look at the code below a bit later, am pushed for time right
 now.
 
 
 p
 
 
 
 I didn't show the all the methods of JAXBMascot but here is workhorse:
  public T T getNextElement(String theElement, String elementAfter, 
 Class Tclazz) {
  String elname = ;
  T h = null;
  try {
  while(reader.hasNext()){
if(reader.peek().isStartElement()){
   elname = 
 reader.peek().asStartElement().getName().getLocalPart();
   if(elname.equals(theElement)){
 h= u.unmarshal(reader, clazz).getValue();
 return h;
   }
} else if(reader.peek().isEndElement()){
  elname = 
 reader.peek().asEndElement().getName().getLocalPart();
  if(elname.equals(elementAfter)){
  return h;
  }
  }

reader.nextEvent();
  }
  } catch (XMLStreamException e) {
  throw new RuntimeException(e);
  } catch (JAXBException e) {
  throw new RuntimeException(e);
  }
  return h;
 }

 It also has a close method to clean up after I have gotten all the elements.
  public void close(){
  try {
  reader.close();
  } catch (XMLStreamException e) {
  //quietly
  }
  IOUtils.closeQuietly(jxb_in);
  u=null;
  }
 I don't think I am leaving any stuff hanging around but memory leaks are 
 very sneaky.
 mas

 This looks a bit odd to me, but I don't know what the rest of the
 instance does...


 p

private InputStream jxb_in;

public static JAXBMascot getInstance(InputStream in) {
JAXBMascot m = new JAXBMascot();
try

JAXBContext leaks memory

2010-05-03 Thread Mark Shifman
I have a web app running under tomcat-6.0.26 with 
JreMemoryLeakPreventionListener, java jdk1.6.0_18.

Using jmap -histo pid, I can watch 
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in number
after running my unmarshal action, followed by undeploy and redeploy.  Find 
Leaks in the manager also finds leaks.

The JAXBContext instance is created with a singleton that is an enum (using 
Josh Block's pattern):

public enum JAXBContextMascot {
INSTANCE(com.matrixscience.xmlns.schema.mascot_search_results_2 );
private JAXBContext ctx;
JAXBContextMascot(String contextPath) {
try {
ctx =JAXBContext.newInstance(clazz);
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}
public Unmarshaller createUnmarshaller(){
try {
return ctx.createUnmarshaller();
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}
}

Am I doing something wrong which is causing the memory leak?
JAXBContext.newInstance() can take a ClassLoader argument.  Is there some 
ClassLoader I should be using that will get around this?

Any help would be appreciated.
mas


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JAXBContext leaks memory

2010-05-03 Thread Mark Shifman

On 05/03/2010 12:48 PM, Pid wrote:
 On 03/05/2010 17:15, Mark Shifman wrote:
 I have a web app running under tomcat-6.0.26 with 
 JreMemoryLeakPreventionListener, java jdk1.6.0_18.

 Using jmap -histo pid, I can watch 
 com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in number
 after running my unmarshal action, followed by undeploy and redeploy.  Find 
 Leaks in the manager also finds leaks.
 
 After a few undeploy/redeploy cycles does the number of
 WebappClassLoader's also increase?

Yes it increases 1 for each undeploy/redeploy cycle.
 
 The JAXBContext instance is created with a singleton that is an enum (using 
 Josh Block's pattern):

 public enum JAXBContextMascot {
  INSTANCE(com.matrixscience.xmlns.schema.mascot_search_results_2 );
  private JAXBContext ctx;
  JAXBContextMascot(String contextPath) {
  try {
  ctx =JAXBContext.newInstance(clazz);
 
 Where does the 'clazz' variable come from?

My bad I edited the email argg.  should of course be contextPath.
 
  } catch (JAXBException e) {
  throw new RuntimeException(e);
  }
  }
  public Unmarshaller createUnmarshaller(){
  try {
  return ctx.createUnmarshaller();
  } catch (JAXBException e) {
  throw new RuntimeException(e);
  }
  }
 }

 Am I doing something wrong which is causing the memory leak?
 
 Maybe.
 
 JAXBContext.newInstance() can take a ClassLoader argument.  Is there some 
 ClassLoader I should be using that will get around this?
 
 Where is the jar with the above code, in a webapp?
The code above in in the war for the web app in a class in 
WEB-INF/classes/org/blablabla

It is called via a class that looks like this:

public class JAXBMascot {
protected static Log log = LogFactory.getLog(JAXBMascot.class);
private XMLEventReader reader;
private Unmarshaller u = 
JAXBContextMascot.INSTANCE.createUnmarshaller();
private InputStream jxb_in;

public static JAXBMascot getInstance(InputStream in) {
JAXBMascot m = new JAXBMascot();
try {
m.setJxb_in(in);

m.setReader(XMLInputFactory.newInstance().createXMLEventReader(in));
} catch (Exception e) {
log.fatal(error getting JAXBMascot instance);
IOUtils.closeQuietly(in);
throw new RuntimeException(e);
}

return m;
}

}

This is also in the webapp in WEB-INF/classes/org/blablabla
thanks
mas
 
 
 p
 
 Any help would be appreciated.
 mas


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 
 



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JAXBContext leaks memory

2010-05-03 Thread Mark Shifman


On 05/03/2010 02:18 PM, Caldarale, Charles R wrote:
 From: Mark Shifman [mailto:mark.shif...@yale.edu]
 Subject: Re: JAXBContext leaks memory

 This is also in the webapp in WEB-INF/classes/org/blablabla
 
 When you say also, does that mean the class is in more than one place?  
 (That would be a Bad Thing.)

no it lives in one place only.
 
  - 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: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Re-direct webpage from HTTP to HTTPS

2010-04-15 Thread Mark Shifman
You need to add a security constraint to web.xml with transport-guarantee 
CONFIDENTIAL

http://confluence.sakaiproject.org/display/DOC/Sakai+Admin+Guide+-+Advanced+Tomcat++%28and+Apache%29+Configuration
google is your friend.

Stephen . wrote:
 
 Hi all,
 
 I have recently bought and installed an SSL Certificate on my Apache Tomcat 
 Server.
 
 I modified the server.xml file, so that my webpage now uses only HTTPS  
 (meaning, a secure site)
 
 However, I would like to modify it such that : if someone types in only HTTP, 
  he will nevertheless be directed to the proper place : HTTPS://mysite.com
 
 I know that this is a simple thing to do;  I'm just not sure of the exact 
 syntax
 
 Any help, please?
 
 Thanks
 
 
 
 _
 Hotmail: Trusted email with powerful SPAM protection.
 https://signup.live.com/signup.aspx?id=60969

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Connection pool stats

2010-03-15 Thread Mark Shifman
You can cast your datasource object to be a BasicDataSource
then the javadoc gives you all kinds of things you can get.
like getNumActive(), getNumIdle() etc
(for dbcp 1.3)
http://commons.apache.org/dbcp/api-1.3/index.html



Dhiren Bhatia wrote:
 I've configured my DB connection pool as follows:
 
 context.xml
 
 Resource name=jdbc/myserver auth=Container type=javax.sql.DataSource
 
 maxActive=100 maxIdle=30 maxWait=1 username=xxx
 
 password=xxx driverClassName=com.mysql.jdbc.Driver
 
 url=jdbc:mysql://a.b.c:3306/Test removeAbandoned=true
 
 removeAbandonedTimeout=60 logAbandoned=true /
 
 
 web.xml
 
 
 resource-ref
 
 descriptionDB Connection/description
 
 res-ref-namejdbc/myserver/res-ref-name
 
 res-typejavax.sql.DataSource/res-type
 
 res-authContainer/res-auth
 
 /resource-ref
 
 
 In my code, I use a javax.sql.DataSource object to get connections and call
 connection.close() to return connections.
 
 
 How do I get stats on the connection pool? I would like to check how many
 connections are active/idle at any point in time.
 
 
 Thanks,
 
 Dhiren
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Commons DBCP in Tomcat 6.x

2010-03-09 Thread Mark Shifman
http://marc.info/?l=tomcat-userm=126772163323329w=2
This article claims you can set a startup option... but I haven't tried it.
mas

Dhiren Bhatia wrote:
 Hi,
 
 I'm trying to use the commons DBCP package with Tomcat 6.x. I know that the
 tomcat_dbcp.jar has the commons files renamed, however I would prefer to use
 the commons jar files so I can use the class
 org.apache.commons.dbcp.BasicDataSource in my code.
 
 To do this, I deleted the tomcat_dbcp.jar file from CATALINA_HOME/lib and
 replaced it with the commons jar file. I assumed that the class loader would
 pick it up like it did in the earlier version of tomcat but that doesn't
 seem to happen. I still get an ClassCastException since tomcat tries to cast
 the org.apache.commons.dbcp.BasicDataSource to
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.
 
 Is there any way I can force Tomcat 6.x to load my commons dbcp jar instead
 of the tomcat_dbcp.jar which comes with the distro?
 
 Thanks!
 Dhiren
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: DB connection error -Tomcat 6 config

2010-03-02 Thread Mark Shifman

Propes, Barry L wrote:

I wonder now...should I perhaps be using this jar?   ojdbc6.jar  ?

Has anyone upgraded their Oracle drivers that's using TC 6 and JDK 1.6?

If anyone has used these environments together and needed to make the change, 
please apprise.
  
I am using ojdbc6.jar with tomcat 6 (two different versions) and it 
works just fine.  I am using dbcp that comes with tomcat 6 without any 
problems.


There were some things that weren't implemented correctly/well in 
ojdbc14, which work with ojdbc6, some calls for getting metadata from 
prepared
statements or result sets (can't remember the exact details).  ojdbc6 
seems to work just fine.


mas

Thanks,

Barry 


-Original Message-
From: Propes, Barry L [GCG-NAOT] 
Sent: Tuesday, March 02, 2010 9:50 AM

To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Really? Well, when I was implementing connection pooling in 4.1.31, I 
specifically remember having to use  ojdbc14_g.jar instead of ojdbc14.jar to 
successfully get the conn pooling to work.

I'll swap out the ojdbc14_g.jar  for the ojdbc14.jar and just use the latter 
and see if that works.

Thanks, Karthik.

-Original Message-
From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com]
Sent: Monday, March 01, 2010 10:59 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

Hi

Please double check the ojdbc14.jar size, Some times I find the jar files 
corrupt due to various reasons.

Also check only 1 copy of this 'jar' exists in /TOMCAT6.0.2.0/lib directory 
and make sure the same does not exist within the web application.

ojdbc14_g.jar is used for advance debug purpose, although it works try with 
normal ojdbc14.jar




With regards
karthik

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Sent: Tuesday, March 02, 2010 4:44 AM
To: 'Tomcat Users List'
Subject: RE: DB connection error -Tomcat 6 config

Sorry, no.

webapps/chngctrl/META-INF/context.xml.

Thanks, Chuck.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Monday, March 01, 2010 4:29 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config

  

From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Subject: RE: DB connection error -Tomcat 6 config

If I try to reference the resource reference in the 
webapps/META-INF/context.xml file,



Is that the real location?  If so, it's not valid.  The webapps directory is the default directory 
under which each webapp is normally deployed; there must be a webapp name between 
webapps and META-INF (e.g., ROOT).  Any other construct is incorrect.

 - 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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

  



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



jaxb unmarshal breaks after webapp redeploy

2010-02-10 Thread Mark Shifman
I have a webapp that unmarshalls xmls prior to storing in my database.

I have recently noted that after a redeploy, the unmarshalling of a dateTime 
element is null while
the rest of the elements in my object seem to be unmarshalled fine.  If I 
restart tomcat things
seem to work again.

I created the classes for unmarshalling using the typical xjc stuff.

The webapp is running via struts 1.3.10 with tomcat 6.0.18, java version 
1.6.0_07. It is running
on linux 2.6.18-92.1.22.el5 via CentOS release 5.3 (Final).

I found one item on google where similar behavior occurred but there was no 
resolution.

Is this a known problem with jaxb unmarshalling that doesn't happen with newer 
versions of java?(I think
jaxb2 is the one in java 1.6)

Is there something obvious I didn't close that could be leaking?

Is there some sneaky threading issue I am missing? (my unmarshaller is local to 
a method as described
https://jaxb.dev.java.net/guide/Performance_and_thread_safety.html)



Any help would be appreciated.
mas

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: jaxb unmarshal breaks after webapp redeploy

2010-02-10 Thread Mark Shifman


Mark Thomas wrote:
 On 10/02/2010 16:05, Mark Shifman wrote:
 I have a webapp that unmarshalls xmls prior to storing in my database.

 I have recently noted that after a redeploy, the unmarshalling of a dateTime 
 element is null while
 the rest of the elements in my object seem to be unmarshalled fine.  If I 
 restart tomcat things
 seem to work again.

 I created the classes for unmarshalling using the typical xjc stuff.

 The webapp is running via struts 1.3.10 with tomcat 6.0.18, java version 
 1.6.0_07. It is running
 on linux 2.6.18-92.1.22.el5 via CentOS release 5.3 (Final).

 I found one item on google where similar behavior occurred but there was no 
 resolution.

 Is this a known problem with jaxb unmarshalling that doesn't happen with 
 newer versions of java?(I think
 jaxb2 is the one in java 1.6)

 Is there something obvious I didn't close that could be leaking?
 
 Possibly, but it certainly won't be obvious.
 
 Try updating to 6.0.24 and the latest JDK. There were some XML related
 leaks in the JDK that 6.0.24 provides work-arounds for.

I just tried with jdk1.6.0_18 (newest from sun) and tomcat 6.0.24 and it didn't 
help.
I am now sure what I should try now. arg

mas

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: jaxb unmarshal breaks after webapp redeploy

2010-02-10 Thread Mark Shifman
I forgot to check catalina.out with the new tomcat. It showed:

Feb 10, 2010 1:54:28 PM org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads
SEVERE: A web application appears to have started a thread named [Timer-0] but 
has failed to stop it. This is very likely to create a memory leak.

and when I use jstack it looks like it is really there:

Timer-0 daemon prio=10 tid=0x8b16b400 nid=0x43b1 in Object.wait() [0x8b2e]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0xac502370 (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:509)
- locked 0xac502370 (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:462)
Mark Shifman wrote:
 
 Mark Thomas wrote:
 On 10/02/2010 16:05, Mark Shifman wrote:
 I have a webapp that unmarshalls xmls prior to storing in my database.

 I have recently noted that after a redeploy, the unmarshalling of a 
 dateTime element is null while
 the rest of the elements in my object seem to be unmarshalled fine.  If I 
 restart tomcat things
 seem to work again.

 I created the classes for unmarshalling using the typical xjc stuff.

 The webapp is running via struts 1.3.10 with tomcat 6.0.18, java version 
 1.6.0_07. It is running
 on linux 2.6.18-92.1.22.el5 via CentOS release 5.3 (Final).

 I found one item on google where similar behavior occurred but there was no 
 resolution.

 Is this a known problem with jaxb unmarshalling that doesn't happen with 
 newer versions of java?(I think
 jaxb2 is the one in java 1.6)

 Is there something obvious I didn't close that could be leaking?
 Possibly, but it certainly won't be obvious.

 Try updating to 6.0.24 and the latest JDK. There were some XML related
 leaks in the JDK that 6.0.24 provides work-arounds for.
 
 I just tried with jdk1.6.0_18 (newest from sun) and tomcat 6.0.24 and it 
 didn't help.
 I am now sure what I should try now. arg
 
 mas
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Graphing packages

2009-10-01 Thread Mark Shifman
http://www.jfree.org/jfreechart/
is pretty good.

David kerber wrote:
 I'm looking for a graphing (not graphics) package suitable for use in my
 Tomcat 5.5.x webapp, for generating on-the-fly data plots.  Open-source
 preferable but not mandatory, though it has to be low cost.
 
 Any recommendations?
 
 TIA!
 D
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: debugging model classes tied to Tomcat datasources

2009-09-27 Thread Mark Shifman

Hi:
This is what I do for testing. I made a class for creating a jndi 
directory and I create this in my main, then I can get a datasource from 
the jndi directory just like I do it when running tomcat.


jndi.properties
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs=org.apache.naming
java.naming.provider.url=java 



public static void create_JNDI(){
   //jndi.properties must be on the classpath to make the 
initial context
   //you can either add the environment manually vida infra 
or have a jndi.properties file

/*  Hashtable env = new Hashtable();
   
env.put(Context.INITIAL_CONTEXT_FACTORY,org.apache.naming.java.javaURLContextFactory);

   env.put(Context.URL_PKG_PREFIXES,org.apache.naming);
   env.put(Context.PROVIDER_URL,java);
   Context initial = new InitialContext(env);*/
   try {
   Context initial = new InitialContext();
   Context javaCompEnv = initial.
   createSubcontext(new 
CompositeName().add(java:)).

   createSubcontext(comp).
   createSubcontext(env);
   Context jdbc = javaCompEnv.createSubcontext(jdbc);

   DataSource dataSource = setupDataSource();
   jdbc.bind(mydatasourcet, dataSource);
   } catch (NamingException e) {
   throw new RuntimeException(e);
   }

   }

private static DataSource setupDataSource() {
// BasicDataSource is from DBCP commons or it is repackaged by tomcat as 
//org.apache.tomcat.dbcp.dbcp.BasicDataSource
   BasicDataSource ds = new BasicDataSource(); //this is from DBCP 
commons

   ds.setDriverClassName(yourdrivergoeshere);
   ds.setUsername(user);
   ds.setPassword(pwxxx);
   ds.setUrl(yourjdbcurlgoeshere);
   ds.setMaxActive(4);
   ds.setMaxIdle(4);
   return ds;
   }
mas

Eric P wrote:

Hi,

(Tomcat newb alert)

I've got a simple database servlet application that has a few model 
classes on the back end.


I have the model classes pretty well genericized so that they could 
(almost) be utilized outside of Tomcat by another app, but they do 
utilize the Tomcat data sources I've set up (via an InitialContext 
data source lookup).  So this makes it impossible (?) to execute the 
model classes outside of Tomcat.


Does anyone have any suggestions about how they would approach this 
problem so that they could debug and/or utilize these model classes 
that rely on database access?


Thanks for reading.  I'm open to any/all ideas.
Eric P.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: debugging model classes tied to Tomcat datasources

2009-09-27 Thread Mark Shifman

Martin Gainty wrote:

Mark

have you been able to implement JNDI (standalone) in TC?
  

No, I never tried.


i see craig's comment on implementing JNDI in org.apache.catalina.Container.java
 * libResources/b - JNDI directory context enabling access to static
 * resources, enabling custom linkages to existing server components when
 * Catalina is embedded in a larger server.
 * /ul
i *thought* Catalina would need to be 'embedded' into A J2EE AppServer (such as 
Glassfish)
to implement JNDI functionality?

thanks,
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




  

Date: Sun, 27 Sep 2009 12:38:11 -0400
From: mark.shif...@yale.edu
Subject: Re: debugging model classes tied to Tomcat datasources
To: users@tomcat.apache.org

Hi:
This is what I do for testing. I made a class for creating a jndi 
directory and I create this in my main, then I can get a datasource from 
the jndi directory just like I do it when running tomcat.


jndi.properties
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs=org.apache.naming
java.naming.provider.url=java 



 public static void create_JNDI(){
//jndi.properties must be on the classpath to make the 
initial context
//you can either add the environment manually vida infra 
or have a jndi.properties file

/*  Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,org.apache.naming.java.javaURLContextFactory);

env.put(Context.URL_PKG_PREFIXES,org.apache.naming);
env.put(Context.PROVIDER_URL,java);
Context initial = new InitialContext(env);*/
try {
Context initial = new InitialContext();
Context javaCompEnv = initial.
createSubcontext(new 
CompositeName().add(java:)).

createSubcontext(comp).
createSubcontext(env);
Context jdbc = javaCompEnv.createSubcontext(jdbc);

DataSource dataSource = setupDataSource();
jdbc.bind(mydatasourcet, dataSource);
} catch (NamingException e) {
throw new RuntimeException(e);
}

}

private static DataSource setupDataSource() {
// BasicDataSource is from DBCP commons or it is repackaged by tomcat as 
//org.apache.tomcat.dbcp.dbcp.BasicDataSource
BasicDataSource ds = new BasicDataSource(); //this is from DBCP 
commons

ds.setDriverClassName(yourdrivergoeshere);
ds.setUsername(user);
ds.setPassword(pwxxx);
ds.setUrl(yourjdbcurlgoeshere);
ds.setMaxActive(4);
ds.setMaxIdle(4);
return ds;
}
mas

Eric P wrote:


Hi,

(Tomcat newb alert)

I've got a simple database servlet application that has a few model 
classes on the back end.


I have the model classes pretty well genericized so that they could 
(almost) be utilized outside of Tomcat by another app, but they do 
utilize the Tomcat data sources I've set up (via an InitialContext 
data source lookup).  So this makes it impossible (?) to execute the 
model classes outside of Tomcat.


Does anyone have any suggestions about how they would approach this 
problem so that they could debug and/or utilize these model classes 
that rely on database access?


Thanks for reading.  I'm open to any/all ideas.
Eric P.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


 		 	   		  
_

Hotmail® 

Re: Can't access Tomcat from outside the LAN

2009-09-15 Thread Mark Shifman
You may have to fool with your firewall (or talk to you lan administrator).
I have a line for starting iptables that looks like this:

-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT

I suspect Ubuntu has some classy utility for modifying the firewal to allow 
8080 or what
ever port Tomcat is using to get in.
mas

Tom Eklöf wrote:
 I managed to set up Tomcat 6.0.20 on my Ubuntu Jaunty box, but I can't
 seem to access the server from outside my LAN. Port forwarding is
 working OK (tested with port scanner and by starting SSH on the port),
 and I can also access Tomcat from all computers on my LAN.
 
 I've tried poking around the documentation, but nothing seems to
 suggest that Tomcat would default to not accepting outside
 connections. I hope I'm not making a fool out of myself here, but I
 really could use some pointers (_not_ of the int* variety :P ) here.
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem closing datasource when used as JNDI resource

2009-08-25 Thread Mark Shifman
Since you don't seem to be able to google yourself, here is the link.
http://www.mail-archive.com/users@tomcat.apache.org/msg65149.html

Mohammed Bin Mahmood wrote:
 Hi Chris,
 
 You mentioned about the published filter that can close datasource. I wonder
 if you have any idea about that.
 Is it provided by tomcat or some other
 
 Thanks,
 Mohammed.
 -Original Message-
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Sent: Monday, August 24, 2009 7:48 PM
 To: Tomcat Users List
 Subject: Re: Problem closing datasource when used as JNDI resource
 
 Mohammed,
 
 On 8/24/2009 12:49 AM, Mohammed Bin Mahmood wrote:
 Hi Chris,
 
 3. There is a published filter that can close the DataSource for you.
 Do you have any idea about the filter that can close the Datasource?
 
 What?
 
 -chris

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: catalina.sh and java_opts question

2009-08-17 Thread Mark Shifman
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 

 
 With Windows Live, you can organize, edit, and share your photos.
 Click here. http://www.windowslive.com/Desktop/PhotoGallery
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Right way to close database connection pool

2009-08-05 Thread Mark Shifman
I do it in a contextListener.
something like this:
public void contextDestroyed(ServletContextEvent event) {
Context initContext = new InitialContext();
Context envContext = (Context) 
initContext.lookup(java:/comp/env);
((BasicDataSource) 
envContext.lookup(jdbc/myDS)).close();
}

Kirill Ilyukhin wrote:
 I use database connection pool which is described in webapp's
 META-INF/context.html:
 Context
   Resource
 auth=Container
 scope=Unshareable
 name=jdbc/myDS
 type=javax.sql.DataSource
 driverClassName=org.postgresql.Driver
 url=jdbc:postgresql://server/db
 ...
 /
 /Context
 
 and in WEB-INF/web.xml:
 resource-ref
   res-ref-namejdbc/myDS/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
 /resource-ref
 
 Then I do the following in my code:
   InitialContext ctx = new InitialContext();
   DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/myDS);
   ...
   Connection conn;
   try {
 conn = ds.getConnection();
 ...
   } finally {
 conn.close();
   }
 
 
 The problem is that after I stop the webapp the connections to databae
 server are staying alive. And when I start the webapp again I see new
 connections are created.
 As far as I understood from Tomcat bugs discussion this is the expected
 behaviour. If so, am I supposed to close the DataSource in my code?
 Surely I can do this in contextDestroyed(...) method of my
 ServletContextListener, but
 1. DataSource has no exposed close() method and the only way to close it
 is calling close() through reflection. Looks like dirty hack...
 2. The connection pool has been created somewhere inside Tomcat. I don't
 think it's correct to close it from my code.
 
 What is the right way to close such a database connection pool? Is there
 a way to make Tomcat close the pool when the context is being destroyed?
 
 
 Thanks in advance,
 Kirill.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat6 CentOS runlevel startup issue

2009-07-22 Thread Mark Shifman
You need to add lines like this to the init script.
http://www.linuxjournal.com/article/4445
# chkconfig: 345 80 20
# description: Tomcat 6.0
so it knows to start on reboot.

You also may want to use jsvc to start and stop tomcat instead of
 [startup|shutdown].sh
http://tomcat.apache.org/tomcat-6.0-doc/setup.html
this allows you to run tomcat as another user.
Example scripts are included in TOMCAT_HOME/bin/jsvc.tar.gz
mas
Peter Lokus wrote:
 Hi list,
 
 I'm running an fresh tomcat 6.0.20 from tomcat.apache.org under /opt/tomcat.
 Currently, I'm firing up tomcat with the supplied [startup|shutdown].sh
 scripts manually.
 
 Now, tomcat shall start automatically. For this purpose I created a
 small script under /etc/init.d/tomcat5:
 
 #!/bin/bash
 #
 # tomcat5  This shell script takes care of starting and stopping #Tomcat
 #
 
 function start() {
 echo -n Starting ${TOMCAT_PROG}: 
 /opt/tomcat/bin/startup.sh
 return $?
 }
 
 function stop() {
 echo -n Stopping $TOMCAT_PROG: 
 /opt/tomcat/bin/shutdown.sh
 }
 
 # See how we were called.
 case $1 in
 start)
 start
 ;;
 stop)
 stop
 ;;
 restart)
 stop
 sleep 2
 start
 ;;
 *)
 echo Usage: $TOMCAT_PROG {start|stop|restart}
 exit 1
 esac
 
 Symlink'd it to
 [r...@int01 init.d]# ln -s /etc/init.d/tomcat5 /etc/rc3.d/S99tomcat5
 [r...@int01 init.d]# ln -s /etc/init.d/tomcat5 /etc/rc3.d/K99tomcat5
 [r...@int01 init.d]# ln -s /etc/init.d/tomcat5 /etc/rc6.d/K99tomcat5
 
 My script runs with service tomcat5 [start|stop] perfectly.
 However, after a reboot tomcat is not reachable through HTTP.
 
 
 Here is the machine state after a reboot:
 
 [r...@int01 ~]# lsof -i:8080
 COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME
 java2139 root   34u  IPv6   6215   TCP *:webcache (LISTEN)
 
 (I should considering not to run tomcat under root)
 
 [r...@int01 ~]# ps waux | grep 2139
 root  2139  1.0  4.5 222744 46860 ?Sl   10:11   0:05
 /usr/bin/java
 -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 -Dappserver.home=/opt/tomcat -Dappserver.base=/opt/tomcat
 -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath
 :/opt/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat
 -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp
 org.apache.catalina.startup.Bootstrap start
 
 [r...@int01 ~]# service tomcat5 stop
 Stopping : Using CATALINA_BASE:   /opt/tomcat
 Using CATALINA_HOME:   /opt/tomcat
 Using CATALINA_TMPDIR: /opt/tomcat/temp
 Using JRE_HOME:   /usr
 Jul 22, 2009 10:20:14 AM org.apache.catalina.startup.Catalina stopServer
 SEVERE: Catalina.stop:
 java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
 at
 java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
 at java.net.Socket.connect(Socket.java:519)
 at java.net.Socket.connect(Socket.java:469)
 at java.net.Socket.init(Socket.java:366)
 at java.net.Socket.init(Socket.java:180)
 at
 org.apache.catalina.startup.Catalina.stopServer(Catalina.java:422)
 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:597)
 at
 org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:337)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
 
 [r...@int01 ~]# java -version
 java version 1.6.0_06
 Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
 Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)
 
 
 After a kill -9 pid and a service tomcat5 start tomcat is running
 as usual.
 
 
 Something went wrong. Do I need some additional environment variables
 for tomcat in my script? Or is it something else?
 
 Thanks in advance.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'

2009-07-14 Thread Mark Shifman
I wonder if somehow the factory classes are confused.
My tomcat6/lib contains tomcat-dbcp.jar and I don't have commons-dbcp-1.1.jar 
in my webapp at all.
I also don't have a factory attribute in my resource definition since the right 
one is picked up by default.
(I think this changed in tomcat6)

my 2 cents
mas

Neil Youngman wrote:
 Rainer Frey (Inxmail GmbH) wrote:
 On Tuesday 14 July 2009 10:42:19 Neil Youngman wrote:
 I'm having trouble getting Oracle access from Axis2 to work under
 Tomcat 6. I've spent a lot of time Googling and prodding and poking
 the application and I haven't found a solution that works for me.

 Oddly the configuration I'm using seems to work for another
 application.

 Let's start with the configuration in axis2/META-INF/context.xml,
 which is:

 ?xml version='1.0' encoding='utf-8'?

 Context
 Resource name=jdbc/AppDatabase
   auth=Container
   type=javax.sql.DataSource
   factory=org.apache.commons.dbcp.BasicDataSourceFactory
 You are explicitly specifying the original DBCP factory 
 class org.apache.commons.dbcp.BasicDataSourceFactory here. Is this for 
 specific reason, and is the jar file available (I believe it needs to be in 
 tomcat's lib dir, though I'm not sure if the resource is application 
 specific)? What happens if you leave out the factory attribute?
 
 That was copied from a working application that I mentioned previously. 
 Commons-dbcp-1.1.jar is in the /home/tomcat6/wsam/webapps/axis2/WEB-INF/lib 
 directory. 
 
 If I remove the factory attribute it fails in exactly the same way.
 
 Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
 JDBC driver of class '' for connect URL 'null' at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc
 e.java:1150) at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourceja
 va:880) at
 Obviously the packaged and renamed tomcat DBCP factory is used. Maybe a 
 tomcat 
 fallback if the specified factory is not found? Also might there be a 
 fallback for the JDBC driver if the driver is not found?
 
 That seems likely.
 
 The app I currently have works under tomcat5 and I haven't written any apps 
 from scratch under tomcat6. Maybe if I try to create a minimal app from 
 scratch, I'll get a little more insight into what is actually needed. 
 
 Neil Youngman
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: canonical hostnames for tomcat server

2009-06-12 Thread Mark Shifman
host name aliases may help
http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Host%20Name%20Aliases

d tbsky wrote:
 Hi:
 i have a tomcat server, which can be access by many ways, like
 
http://portal.example.com
http://portal
http://192.168.1.1
 
i want to user to use only http://portal.example.com;. other ways
 will be redirect to the canonical hostname.
 
i found i can do this with  apache + mod_rewrite + tomcat  or
 tomcat + urlrewritefilter.
 
i wonder if there are simpler solutions. can tomcat do this by
 itself via configuration?
 
 thanks for help!!
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Logging configuration in Tomcat

2009-01-13 Thread Mark Shifman
Jay wrote:
 Hello
  
 As we are not providing any log4j configuration for individual web app, I 
 guess, Tomcat is directing all the log4j log messages in the code to 
 system.out which in turn is being written to catalina.out
  
 Agree that it may not be a good idea to direct log messages from all web apps 
 to a same log file. But, our requirement is that there should be a single 
 file.
 Considering all these, is there a way to achieve rolling for catalina.out, 
 based on size ?
on linux you can use logrotate
http://threebit.net/mail-archive/tomcat-users/msg00444.html

  
 Thanks
 
 --- On Mon, 1/12/09, Caldarale, Charles R chuck.caldar...@unisys.com wrote:
 
 From: Caldarale, Charles R chuck.caldar...@unisys.com
 Subject: RE: Logging configuration in Tomcat
 To: Tomcat Users List users@tomcat.apache.org
 Date: Monday, January 12, 2009, 6:41 PM
 
 From: Jay [mailto:difficult...@yahoo.com]
 Subject: RE: Logging configuration in Tomcat

 There are many web apps. Log4j logger is used in all web apps
  there are no system.out  or system.err
 
 Then where is your catalina.out usage coming from?  Tomcat does not itself put
 anything in catalina.out; data in there appears only because the Tomcat 
 startup
 script redirects System.out and System.err to that file.
 
 If I configure log4j at each web app level using
 log4j.properties, am abile to achive log file rotation but,
 this requires one log file per web application.
 
 Which really, really is what you need.  Lumping them all together will create
 serious grief, as other posters have already pointed out.
 
 What I am interested is one log file for all web apps
 
 A bad idea.  You could just merge the log files after they've been
 generated.
 
  - 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: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
   


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Problem with Beta candidate for Tomcat connection pool

2008-11-14 Thread Mark Shifman
I installed the new Tomcat connection pool and it worked ok yesterday. First 
thing this morning it
threw this exception below. (I snipped out a bunch of stuff but can send the 
whole thing if it would
help)
My resource definition from context.xml is

Resource name=jdbc/prot auth=Container
type=javax.sql.DataSource 
driverClassName=oracle.jdbc.OracleDriver
factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
url=jdbc:oracle:thin:@xxx.xxx.med.yale.edu:1521:xxx
username=xxx
password=xxx
initialSize=3
maxActive=10
maxIdle=10
maxWait=1
removeAbandoned=false
removeAbandonedTimeout=180
logAbandoned=false
timeBetweenEvictionRunsMillis=1
validationQuery=SELECT 1 from dual
testOnBorrow=true/

Have I done something stupid that lets stale connections hang around? I old 
dbcp pool worked fine.

Thanks in advance.
Mark Shifman

java.lang.reflect.UndeclaredThrowableException
at $Proxy0.getConnection(Unknown Source)
at 
org.apache.commons.dbutils.QueryRunner.prepareConnection(QueryRunner.java:189)
...
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor206.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
...
Caused by: java.sql.SQLException: java.lang.NegativeArraySizeException
at oracle.net.ano.CryptoDataPacket.decryptAndChecksum(CryptoDataPacket)
at oracle.net.ano.CryptoDataPacket.receive(CryptoDataPacket)
at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
at oracle.net.ns.NetInputStream.read(Unknown Source)
at oracle.net.ns.NetInputStream.read(Unknown Source)
at oracle.net.ns.NetInputStream.read(Unknown Source)
at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:931)
at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
at oracle.jdbc.ttc7.Oclose.receive(Oclose.java:101)
at oracle.jdbc.ttc7.TTC7Protocol.close(TTC7Protocol.java:684)
at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:700)
at 
oracle.jdbc.driver.OraclePreparedStatement.privateClose(OraclePreparedStatement.java:489)
at 
oracle.jdbc.driver.OraclePreparedStatement.close(OraclePreparedStatement.java:396)
at 
oracle.jdbc.driver.OracleCallableStatement.close(OracleCallableStatement.java:982)
at 
oracle.jdbc.driver.OracleConnection.close_statements(OracleConnection.java:2369)
at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1448)
at 
org.apache.tomcat.jdbc.pool.PooledConnection.disconnect(PooledConnection.java:103)
at 
org.apache.tomcat.jdbc.pool.PooledConnection.reconnect(PooledConnection.java:93)
at 
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:473)
at 
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:380)


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 [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: redeploy/delete issue with tomcat6

2008-08-27 Thread Mark Shifman
Read the faq.
I want to redeploy web applications, how do I prevent resources from getting 
locked?
http://wiki.apache.org/tomcat/FAQ/Windows#Q5

Aaron Axelsen wrote:
 I've been tasked with setting up a tomcat enviorment for course work. 
 The instructor is working with jruby.  The problem is that on war file
 redeploy, it fails because tomcat has a lock on 2 of the bundled lib
 files - jruby-complete-1.1.3.jar and jruby-rack-0.9.1.jar
 
 Is there anyway to force the release of those files on a redeploy of the
 war without stoping tomcat to release the hold?  Any thoughts or ideas
 would be appreciated!  Thanks!
 


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 [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]



[OT] fail2ban and tomcat access logs

2008-08-18 Thread Mark Shifman
I was wondering if anyone has any experience using fail2ban 
http://www.fail2ban.org/
with tomcat access logs generated by access log valve.  Specifically I would 
like to jail all
attempts at accessing the manager, or perhaps php or cgi on my server.  The 
problem I have is that
the logs have dates as part of the name, which is nice since I don't need to 
fool with logrotate,
but I am not sure of the best way to set the logpath ?

Is this a reasonable tool to use or should I just use a remote access valve on 
the manager?

mas

 [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: Java application getting tomcat's home directory.

2008-04-15 Thread Mark Shifman

You could try
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResource(java.lang.String) 


or
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResourceAsStream(java.lang.String)
mas

Ar5eNiC wrote:

Hello,

I am currently on a team developing a web interface that allows the user to
click drop downs to change content in an html page. We are calling our java
methods using a JSP page. One of our java methods needs to access a file
that is in our projects folder under webapps. We cannot use relative paths
because they change depending on where tomcat is started from. We also would
perfer to not use the CATALINA_HOME environment variable, even though it
would be the best solution. Is there any other way we'd be able to get
tomcat's home directory from a java program?

Thanks in advance.
  




-
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: Java application getting tomcat's home directory.

2008-04-15 Thread Mark Shifman

Actually you asked for the home directory so you could use
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getContextPath()
Mark Shifman wrote:

You could try
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResource(java.lang.String) 


or
http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/ServletContext.html#getResourceAsStream(java.lang.String) 


mas

Ar5eNiC wrote:

Hello,

I am currently on a team developing a web interface that allows the 
user to
click drop downs to change content in an html page. We are calling 
our java

methods using a JSP page. One of our java methods needs to access a file
that is in our projects folder under webapps. We cannot use relative 
paths
because they change depending on where tomcat is started from. We 
also would

perfer to not use the CATALINA_HOME environment variable, even though it
would be the best solution. Is there any other way we'd be able to get
tomcat's home directory from a java program?

Thanks in advance.
  




-
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: RESIDENTIAL MEMORY 100%

2008-03-31 Thread Mark Shifman

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




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[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: Null datasource trying to connect to JNDI connection.

2007-12-06 Thread Mark Shifman
What would you do if you wanted to add a different version of DBCP, ie 
Commons DBCP 1.3-SNAPSHOT?
Would you put the jar in $CATALINA_HOME/lib and then use the factory 
attribrute?

mas

Caldarale, Charles R wrote:
From: Craig Dunn [mailto:[EMAIL PROTECTED] 
Subject: Null datasource trying to connect to JNDI connection.


In my server.xml: 



The usual comment: don't put Context elements in server.xml; doc
reference:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

  
factory=org.apache.commons.dbcp.BasicDataSourceFactory 



Did you see a factory attribute in any of the Tomcat doc for JDBC
DataSources?
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.h
tml

  
Context initCtx = new InitialContext(); 
Context envCtx = (Context) initCtx.lookup(java:comp/env); 
DataSource ds = (DataSource)envCtx.lookup(jdbc/myDB); 



Did you follow the above Tomcat doc and put a resource-ref in your
WEB-INF/web.xml file?

  

Also, I have put the following jar's into $CATALINA_HOME/lib on the
advice of other threads; 
commons-pool-1.3.jar 
commons-dbcp-1.2.2.jar 



Read the Tomcat doc first, then use other threads for clarification,
if needed.  You won't see any mention of adding the above jars to
Tomcat's lib directory, since Tomcat already has its own versions.

  
jtds-1.2.jar 



That one you need.

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

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[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: JDBC connection issue

2007-08-16 Thread Mark Shifman
I just upgraded from 5.5 to 6.0 without any problems.  My webapp was 
deployed as a war file
with the config.xml in the META-INF (the exact config for 5.5). The 
deployment does the

correct thing with the config.xml.

Make sure your jdbc library is in the CATALINA_HOME/lib dir.

I also was playing around with using realms for the manager and found I 
had to

put the manager's config.xml in the META-INF dir for things to work. I tried
moving the config.xml to conf/Catalina/localhost and ... ... the manager 
was undeployed.


mas





Hehl, Thomas wrote:

I am testing our webapp under tomcat 6 after being under tomcat 5.5.

 


I have moved the following file from 5.5. into 6. I have placed it in the
conf directory:

 


Context path=/mo docBase=mo debug=0 reloadable=true
crossContext=true

 


Resource name=jdbc/mo auth=Container type=javax.sql.DataSource
maxActive=20 

 

maxIdle=-1 maxWait=1000 

 

username=informix  password=xxx 

 

driverClassName=com.informix.jdbc.IfxDriver 


url=jdbc:informix-sqli://vaninfmx1:7101/jur_feds:INFORMIXSERVER=gs_jms9/

 


/Context

 


This works under 5.5, but under 6.0, I get Cannot create JDBC driver of
class '' for connect URL 'null'

 


And

 


Could not obtain connection metadata.

 


I've googled, and most seem to feel that these errors are caused by an issue
in the context definition.

 


I've looked through the docs and find nothing that got changed between 5.5
and 6.0 so I'm puzzled and trying here. Anyone?

 


Thanks.

 


Thom Hehl
Sr. eJuror Architect

* Office (859) 277-8800 x 144

* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  
ACS, Inc.


Government Solutions

1733 Harrodsburg Road
Lexington, KY 40504-3617

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message and notify
sender via e-mail at [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  or by telephone at 859-277-8800 ext. 144.
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: Tomcat jsvc: shutting down

2007-05-17 Thread Mark Shifman

 $TOMCAT_HOME/bin/jsvc-src/native/Tomcat5.sh
has a function below

stop)
   #
   # Stop Tomcat
   #
   $DAEMON_HOME/src/native/unix/jsvc \
   -stop \
   -pidfile $PID_FILE \
   org.apache.catalina.startup.Bootstrap
   exit $?
   ;;

 *)
Markus Schönhaber wrote:

reym wrote:

  

I have successfully installed Tomcat5.5 on port 80 using jsvc, on a CENTOS4
platform. Once snag, i can only stop it by issuing a SIGTERM to the process,
ie kill -9 tomcat-process-id. Is there a much more elegant way of shutting
down tomcat, while still using jsvc???



jsvc -stop ...

Regards
  mks

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

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[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]



Defining loggers best approach?

2006-09-29 Thread Mark Shifman
I recently was looking at Niall's source code for LazyDynaBean and saw 
that he defines his logger this way:


*   private* *transient* Log logger = LogFactory.getLog(LazyDynaBean.*class*);
...

  *private* Log logger() {
   *if* (logger == *null*) {
   logger = LogFactory.getLog(LazyDynaBean.*class*);
   }
   *return* logger;
   }


I have been using this as the standard :
private static Log logger = LogFactory.getLog(MyClass.class);

Is there some advantage to defining the logger as private transient?
Does this somehow allow avoid memory leaks where the classloader cannot 
be garbage collected?


--
Mark Shifman 
[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: JDBC Realm error

2006-07-13 Thread Mark Shifman

The oracle driver library that seems to work is ojdbc14.jar
http://download.oracle.com/otn/utilities_drivers/jdbc/9205/ojdbc14.jar
I just set up a JDBCRealm the other day using it following the realm howto
http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html
and it worked like a charm.

You can also easily create a datasource for your webapp and use it to get
connections. 
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

mas
Propes, Barry L wrote:

precisely it is, as you  typed below.

I'd actually like to toss the JDBC-ODBC bridge software, as I've heard some 
unstable things about it, maybe this included, but am a little uncertain as to 
how to truly go about getting the Oracle driver I need. I don't claim to be an 
expert on Oracle, but I downloaded two zip files - ora9018 and ORA92065.zip. I 
unzipped these, but neither seems to place a new driver on my machine, nor does 
it include an exe file that would ostensibly install such.

I've also downloaded three different OTN zipped files, huge in nature, which I 
think would install the connectivity client and other components, which I 
already have on my machine.

Is there a way to just cherry pick to the actual driver? And get it on the 
box in question? The process doesn't seem to be real intuitive!

Any feedback is appreciated, though!

-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 13, 2006 3:19 PM
To: Tomcat Users List
Subject: Re: JDBC Realm error


Is your Realm configured as follows:

 Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
 driverName=sun.jdbc.odbc.JdbcOdbcDriver
 connectionURL=jdbc:odbc:DSNName
 connectionName=user_name
 connectionPassword=password
 userTable=chg_users
 userNameCol=user_name
 userCredCol=user_pass
 userRoleTable=chg_users_roles
 roleNameCol=role_name /

You're orignal Realm won't work because you're mixing the Oracle schema 
and the JDBC-ODBC bridge connection schema.  If you use the JDBC-ODBC 
bridge, you have to use a connection string for that driver.  You could 
(and this is MUCH better in my opinion) toss the JDBC-ODBC bridge 
software and just use a true Oracle JDBC driver with a standard Oracle 
connection string.


--David

Propes, Barry L wrote:

  

well, Tomcat didn't like that at all!

It tries to come up (the console) and then quickly disappears!

-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 13, 2006 3:00 PM
To: Tomcat Users List
Subject: Re: JDBC Realm error


Why don't you try using the same dbURL you use in the java code -- 
jdbc:odbc:DSNName.  Also add in the attributes connectionName for the 
auth username to the database and connectionPassword for the auth 
password to same.


--David

Propes, Barry L wrote:

 



I'm not sure if this is the method of which to go about posting my problem or 
issue, but here goes.

I've tried configuring my JDBC realm in Tomcat 4.0.1  the last 2 days with no 
success. Sure, I can mess up the app or get the protection to engage and kick 
to a login page, but my Oracle configuration doesn't work.

For starters, I use the following driver and can connect regularly to do 
inserts, selects and updates just fine.

Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
 String dbURL = jdbc:odbc:DSNName;
 String usernm = user_name;
 String pwd = password;
 Connection connection = DriverManager.getConnection(dbURL, usernm, pwd);


Here are some errors I get when I do the following:
Configure the Realm like so:
-
  Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
  driverName=sun.jdbc.odbc.JdbcOdbcDriver
connectionURL=jdbc:odbc:DSNName:@169.xxx.xx.xxx:1521:SID?user=user_name;password=password
   userTable=chg_users userNameCol=user_name userCredCol=user_pass
userRoleTable=chg_users_roles roleNameCol=role_name /
-

Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
Catalina.start: LifecycleException:  Exception opening database connection:  jav
a.sql.SQLException: invalid arguments in call
LifecycleException:  Exception opening database connection:  java.sql.SQLExcepti
on: invalid arguments in call
  at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)

  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307
)
  at org.apache.catalina.core.StandardService.start(StandardService.java:3
88)
--
Then, if I try configuring like the following:
--
Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
  driverName=sun.jdbc.odbc.JdbcOdbcDriver
 connectionURL=jdbc:odbc:DSNName:@169.xxx.xx.xxx:1521:SID.WORLD(or just 
SID w/o WORLD)
 connectionName=user_name
 connectionPassword=password
 

Re: jsvc creates LOTS of processes

2006-04-25 Thread Mark Shifman

Hi:
I think my problem is a problem with seeing threads.
The kernel I am using is 2.4.21-37.ELsmp
When I launch jsvc with debug things look reasonable and netstat -a also 
looks ok.


I run tomcat as a daemon via jsvc in order to take advantage of the 
system startup stuff for free.
It automatically starts on reboot, I can use /sbin/service tomcat to 
start and stop at will.

So tomcat is run like the other services on my machine, ie sshd, httpd, etc.

Thanks for your help.
mas

Martin Gainty wrote:

Good Morning Mark
This was raised by Wade Chandler with previous versions of jsvc using 
commons-daemon-1.0
JDK 1.5
RH 7.3 with Kernel 2.4.2
http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/200501.mbox/[EMAIL
 PROTECTED]
Did you verify you are actually binding?
(perhaps thru turning on debug option in jsvc.exe and doing a netstat -a before 
AND after)
Just for my own understanding What do gain by running thru jsvc.exe vs ?
Thanks,
Martin --
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: Mark Shifman [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, April 24, 2006 12:55 PM
Subject: jsvc creates LOTS of processes


  

I noticed that jsvc creates about 68 processes on one of my servers.

I start it using an init.d script under redhat 9.
I don't think I have done anything egregious.
...snip
CATALINA_OPTS= -Djava.awt.headless=true -Xmx750m -Xms750m
...snip
start(){
$DAEMON_HOME/jsvc \
   -user $TOMCAT_USER \
   -home $JAVA_HOME \
   -Dcatalina.home=$CATALINA_HOME \
   -Djava.io.tmpdir=$CATALINA_HOME/temp \
   -outfile $CATALINA_HOME/logs/catalina.out \
   -errfile '1' \
   $CATALINA_OPTS \
   -cp $CLASSPATH \
   org.apache.catalina.startup.Bootstrap
   echo starting tomcat:  $CATALINA_HOME
   echo tomcat user:  $TOMCAT_USER
   #
   # To get a verbose JVM
   #-verbose \
   # To get a debug of jsvc.
   #-debug \
}

I was getting a 143 error on exiting Tomcat with an old version of jsvc.
I got the version packaged with 5.5.16 and compiled it just in case this 
was fixed.


My 143 error is gone, but there still are lots of processes generated 
when I start Tomcat as a daemon.


I have another server where only 1 jsvc.exe process is started when I 
start Tomcat.


What am I doing wrong on the server with 68 processes.

mas


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







--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



jsvc creates LOTS of processes

2006-04-24 Thread Mark Shifman

I noticed that jsvc creates about 68 processes on one of my servers.

I start it using an init.d script under redhat 9.
I don't think I have done anything egregious.
...snip
CATALINA_OPTS= -Djava.awt.headless=true -Xmx750m -Xms750m
...snip
start(){
$DAEMON_HOME/jsvc \
   -user $TOMCAT_USER \
   -home $JAVA_HOME \
   -Dcatalina.home=$CATALINA_HOME \
   -Djava.io.tmpdir=$CATALINA_HOME/temp \
   -outfile $CATALINA_HOME/logs/catalina.out \
   -errfile '1' \
   $CATALINA_OPTS \
   -cp $CLASSPATH \
   org.apache.catalina.startup.Bootstrap
   echo starting tomcat:  $CATALINA_HOME
   echo tomcat user:  $TOMCAT_USER
   #
   # To get a verbose JVM
   #-verbose \
   # To get a debug of jsvc.
   #-debug \
}

I was getting a 143 error on exiting Tomcat with an old version of jsvc.
I got the version packaged with 5.5.16 and compiled it just in case this 
was fixed.


My 143 error is gone, but there still are lots of processes generated 
when I start Tomcat as a daemon.


I have another server where only 1 jsvc.exe process is started when I 
start Tomcat.


What am I doing wrong on the server with 68 processes.

mas


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



Re: how to use datasource in a non-tomcat project?

2006-02-02 Thread Mark Shifman

You can use jakarta commons dbcp http://jakarta.apache.org/commons/dbcp/.
There is a basic datasource and examples on how to create it.
mas

Rick Col wrote:


Hi, guys:

I am stuck here with this problem. I created a Java
project on
Eclipse, the reason is I have to use my own framework
that won't
fit into a Tomcat project. But we are using Tomcat to
run our application. Now I have to create datasource
for Hibernate to use. If this is a tomcat project, I
can set up DB2 datasource in Tomcat's server.xml. But
it seems I cannot access this datasource set up in
server.xml and web.xml using Hibernate code or JDBC
code. I am wondering if there is a workaround for
this?

regards,

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-
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: Tomcat is dying unpredictably

2005-10-27 Thread Mark Shifman
 noticed it handing a JVM that does a lot of socket access from the
command line.  The VM just stops dead without reporting anything.  That was
on the last released build of RHL9 (2.4.20)

 


-Original Message-
From: Mark Shifman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday 26 October 2005 17:40

To: Tomcat Users List
Subject: Tomcat is dying unpredictably


Recently tomcat has started dying in an unpredictable manner. 
I am running

java version 1.4.2
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

jakarta-tomcat-5.0.19 on a Linux box with kernel 
2.4.21-37.ELsmp #1 SMP 
Wed Sep 7 13:28:55 EDT 2005

(recently upgraded) and struts  1.2.6.

the output from catalina.out is shown.
any help would be appreciated



Another exception has been detected while we were handling last error.
Dumping information about last error:
ERROR REPORT FILE = (N/A)
An unexpected exception has been detected in native code 
outside the VM.

PC= 0x0029cded
Unexpected Signal : 11 occurred at PC=0x29CDED
SIGNAL= 11
Function=FUNCTION NAME = (null)+0x29CDED
(N/A)
Library=/lib/tls/libc.so.6
OFFSET= 0x29CDED

LIBRARY NAME  = NOTE: We are unable to locate the function name 
symbol for the error

/lib/tls/libc.so.6
 just occurred. Please refer to release documentation 
for possible
Please check ERROR REPORT FILE for further information, if 
there is any.

Good bye.
 reason and solutions.


Current Java thread:
   at java.net.Inet4AddressImpl.getHostByAddr(Native Method)
   at java.net.InetAddress$1.getHostByAddr(InetAddress.java:774)
   at 
java.net.InetAddress.getHostFromNameService(InetAddress.java:464)

   at java.net.InetAddress.getHostName(InetAddress.java:407)
   at java.net.InetAddress.getHostName(InetAddress.java:379)
   at 
org.apache.coyote.http11.Http11Processor.parseHost(Http11Proce

ssor.java:1308)
   at 
org.apache.coyote.http11.Http11Processor.prepareRequest(Http11

Processor.java:1276)
   at 
org.apache.coyote.http11.Http11Processor.process(Http11Process

or.java:817)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle

r.processConnection(Http11Protocol.java:732)
   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi

nt.java:619)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(

ThreadPool.java:688)
   at java.lang.Thread.run(Thread.java:534)

Dynamic libraries:
Can not get information for pid = 5855

Heap at VM Abort:
Heap
def new generation   total 3520K, used 2449K [0x08e6, 
0x0923, 
0x0934)

 eden space 3136K,  75% used [0x08e6, 0x090ae558, 0x0917)
 from space 384K,  22% used [0x091d, 0x091e60b8, 0x0923)
 to   space 384K,   0% used [0x0917, 0x0917, 0x091d)
tenured generation   total 46504K, used 38229K [0x0934, 
0x0c0aa000, 
0x0ce6)
  the space 46504K,  82% used [0x0934, 0x0b895408, 0x0b895600, 
0x0c0aa000)
compacting perm gen  total 20224K, used 19970K [0x0ce6, 
0x0e22, 
0x10e6)
  the space 20224K,  98% used [0x0ce6, 0x0e1e0808, 0x0e1e0a00, 
0x0e22)


Local Time = Fri Oct 21 22:05:03 2005
Elapsed Time = 33731
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
#
# An error report file has been saved as /tmp/hs_err_pid5855.log.
# Please refer to the file for further information.
#
jsvc.exec error: Service did not exit cleanly






--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[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]


 




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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