Configure Tomcat Manager-GUI to use SPNEGO authentication

2015-06-02 Thread Jingru Barr



 Tomcat version: 7.0.62Platform (OS) - Centos 6.6
Steps I perform1) follow the document 
(http://tomcat.apache.org/tomcat-7.0-doc/windows-auth-howto.html) to configure 
Kerbero.      - I use kinit to verify the keytab and service account and it 
shows.        kinit -V -k -t server.keytab 
HTTP/serviceaccountname.mycompany@mycompany.com         Authenticated to 
Kerberos v52) configure server.xml to use Active Directory for JNDI      add 
the following to server.xml between Engine and Realm        Realm   
className=org.apache.catalina.realm.JNDIRealm    
connectionURL=ldap://ADServerName:3268;   authentication=simple   
referrals=follow   connectionName=serviceaccountn...@mycompany.com   
connectionPassword=ServiceAccountpassword    
userSearch=(amp;(objectCategory=person)(sAMAccountName={0}))   
userBase=dc=mycompany,dc=com    userSubtree=true   
roleSearch=(member={0})    roleName=cn    roleSubtree=true   
roleBase=dc=mycompany,dc=com /
3) modify web.xml to change authentication       login-config 
auth-methodSPNEGO/auth-method  realm-nameManager GUI/realm-name  
/login-config
 !-- Security roles referenced by this web application -- security-role   
role-nameIIAG_HER_Everyone/role-name   (this is the AD group name)  
/security-role
The result is still not able to authenticate.  Based on the log, I don't see 
the tomcat try to authenticate using the Kerberos.  Pleae advice further



 

   

Re: Tomcat DBCP 8.0.18 issue

2015-06-02 Thread Konstantin Kolinko
2015-06-01 16:22 GMT+03:00 Tweak Ronaldo twea...@gmail.com:
 Hello guys, we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
 faced the following issue:
 after database restart (Postgres), our application wasn't been able to
 restore connectivity to DB, all connections were closed and every time,
 after failed attempt to execute some SQL statement, returned back to pool.
 Pool is configured with all tests (on borrow, on return, on connect, while
 idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.

the same?
Tomcat 7 uses DBCP 1 and Tomcat 8 uses DBCP 2, where some attributes
have different names.

As mentioned in migration guide:
http://tomcat.apache.org/migration-8.html#Database_Connection_Pooling

Best regards,
Konstantin Kolinko

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



Re: jar files - where - please explain

2015-06-02 Thread Ray Holme
Humble apologies, I have not seen changes to the lib structures for any of the 
tomcat releases I have used and that spans back 5 years or more     (well OK, 
at one point symbolic links worked, now they don't unless I change the xml 
file).
Thanks for the answer. I would have moved the jaybird thing only so WAR files 
included it, but it sounds like a bad idea if clobbers connection pools - 
thought there was ONE pool per application.
Agreed to leave all else as is, the hard link solution solves the problem of 
multiple copies nicely. Just cannot do that in Microsoft land, but that is OK 
as all Microsoft versions I support only have one application running.
Many thanks - I understand better why things are as they are.
:=] 


 On Tuesday, June 2, 2015 10:10 AM, Mark Thomas ma...@apache.org wrote:
   

 On 02/06/2015 14:52, David kerber wrote:
 On 6/2/2015 9:11 AM, Ray Holme wrote:
 Currently using apache-tomcat-7.0.35. Not sure that matters as no
 behavior has changed in prior releases.

That kind of response when asked for further information - especially
when the information is as basic as which Tomcat version is being used
(you failed to give any indication of the Tomcat version you are using
and we see questions from folks using Tomcat 3 all the way up to the
unreleased Tomcat 9) - is very frustrating for those of us trying to
help and does nothing to encourage us to continue to help.

 It does matter, because the directory layouts have changed in the
 various major versions.

It also matters since later versions of Tomcat are more relaxed about
where they will load JDBC drivers from.


      On Tuesday, June 2, 2015 8:56 AM, Mark Thomas ma...@apache.org
 wrote:


  On 02/06/2015 12:42, Ray Holme wrote:
 I have been using tomcat for a while and have several applications.
 Some jar files are specific to an application and make sense to be in
 .../webapps/APPLICATION/WEB-INF/lib and some are used in multiple
 applications so they need to appear in each applications lib. One
 shared jar file is my own common code, but then there are many things
 that are pulled from the net (e.g. mail.jar). In addition I put one
 jar file in the top tomcate ../lib directory as it is used by
 everything for DB access (jaybird...jar in my case.
 Since I use Linux, ALL of these extra jar files are maintained
 somewhere else (same linux file system required) and I hard link them
 to the above named places so I don't need multiple copies and one
 update serves all (with a web restart, natch).
 So, here are my questions: 1) Is there any reason why the SQL library
 (jaybird above) needs to be in the .../lib (top tomcat directory) or
 could it be in the WEB-INF/lib directory too?

Yes. It needs to be in $CATALINA_BASE/lib so it is visible to the
connection pool implementation.

Putting another copy in WEB-INF/lib is theoretically safe (it should be
a NO-OP) but can often trigger class loading issues (if the app refers
to any of the classes in the JAR directly).

See the Tomcat 8 migration guide for how this changes in 8.0.x.

 If the latter is OK,
 then it becomes part of the WAR file when I distribute and thus saves
 an extra step when this jar updates. Also, by putting it (logically)
 there in the application lib(s), it evokes more security if I
 understand the purpose of doing this (see next question).
 2) Could I also put my own common jar file in the top tomcat .../lib
 directory? I am confident that it does NOT have insecure code so
 logic says it could be there, but having it in the WAR file might be
 a better option anyway as I do add things to it. In other words, if I
 were confident in the source for say mail.jar and knew it was secure,
 it too could be in the top directory (with the caveat that it no
 longer is in the WAR file).

Yes you can put your own JARs in $CATALINA_BASE/lib but beware of issues
with singletons, caches etc. The downside is that it makes it impossible
to use different versions of your JAR with different web applications
(unless you put the classes in different packages) which typically
forces you to upgrade all your applications at the same time.

 Question 1 would be useful as it makes distributions more easy and
 totally effective if all can be in the WAR file. Question 2 is just
 for me to understand better how tomcat works - I don't think I want
 to move the application jars to the tomcat lib.
 Many thanks for improving my understanding.

Personally, I'd would:
- aim to keep my web applications dependencies to a minimum
- package all the dependencies in WEB-INF/lib

Mark


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



  

jar files - where - please explain

2015-06-02 Thread Ray Holme
I have been using tomcat for a while and have several applications. Some jar 
files are specific to an application and make sense to be in 
.../webapps/APPLICATION/WEB-INF/lib and some are used in multiple applications 
so they need to appear in each applications lib. One shared jar file is my own 
common code, but then there are many things that are pulled from the net (e.g. 
mail.jar). In addition I put one jar file in the top tomcate ../lib directory 
as it is used by everything for DB access (jaybird...jar in my case.
Since I use Linux, ALL of these extra jar files are maintained somewhere else 
(same linux file system required) and I hard link them to the above named 
places so I don't need multiple copies and one update serves all (with a web 
restart, natch).
So, here are my questions: 1) Is there any reason why the SQL library (jaybird 
above) needs to be in the .../lib (top tomcat directory) or could it be in the 
WEB-INF/lib directory too? If the latter is OK, then it becomes part of the WAR 
file when I distribute and thus saves an extra step when this jar updates. 
Also, by putting it (logically) there in the application lib(s), it evokes more 
security if I understand the purpose of doing this (see next question).
2) Could I also put my own common jar file in the top tomcat .../lib directory? 
I am confident that it does NOT have insecure code so logic says it could be 
there, but having it in the WAR file might be a better option anyway as I do 
add things to it. In other words, if I were confident in the source for say 
mail.jar and knew it was secure, it too could be in the top directory (with the 
caveat that it no longer is in the WAR file).
Question 1 would be useful as it makes distributions more easy and totally 
effective if all can be in the WAR file. Question 2 is just for me to 
understand better how tomcat works - I don't think I want to move the 
application jars to the tomcat lib.
Many thanks for improving my understanding.


Re: WebSocket: Special character escaping

2015-06-02 Thread Ganesh Bms
Thanks Mark. Sample web socket chat helped to identify the problem. In
fact, problem was there in one of third-party lib I used and also, in log4j
config. The log4j was configured with non-utf encoding scheme. That's why
raw web socket messages were getting printed wrongly in log file. I solved
the issue by putting UTF-8 escaping to special characters.

Regards,
Ganesh

On Wed, May 13, 2015 at 4:27 PM, Mark Thomas ma...@apache.org wrote:

 On 13/05/2015 11:44, Ganesh Bms wrote:
  Sorry .. correction to line:
 
  The text that my client sends is Test701á. Server received is
 SIP701?.
 
  Actual: The text that my client sends is Test701á. Server received is
  Test701?.

 Lots of places this could go wrong. You need to make sure that
 everything is using UTF-8 everywhere.

 I'd check these first:
 - The client is sending the text encoding using UTF-8
 - Your server application is displaying the received String using UTF-8

 You can see if Tomcat handles this correctly by using the WebSocket chat
 example and sending special characters.

 Mark

 
  On Wed, May 13, 2015 at 3:33 PM, Ganesh Bms gbmsat...@gmail.com wrote:
 
  Hi,
 
  I have written a web socket server using web socket API(JSR-356) and
 which
  runs on tomcat version 7.0.56.
  My test client sends some text which has some special characters over
 web
  socket connection to my server. the problem is that server is not
 getting
  the client's text as it is. the special character got modified to ?.
 
  The text that my client sends is Test701á. Server received is
 SIP701?.
  At server, I have just attached Text message handler to web socket
 session.
 
  This works fine with tomcat version 7.0.55.
 
  Please let me know if i am missing something here.
 
  Thank you,
  ganesh
 
 


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




Re: jar files - where - please explain

2015-06-02 Thread Mark Thomas
On 02/06/2015 14:52, David kerber wrote:
 On 6/2/2015 9:11 AM, Ray Holme wrote:
 Currently using apache-tomcat-7.0.35. Not sure that matters as no
 behavior has changed in prior releases.

That kind of response when asked for further information - especially
when the information is as basic as which Tomcat version is being used
(you failed to give any indication of the Tomcat version you are using
and we see questions from folks using Tomcat 3 all the way up to the
unreleased Tomcat 9) - is very frustrating for those of us trying to
help and does nothing to encourage us to continue to help.

 It does matter, because the directory layouts have changed in the
 various major versions.

It also matters since later versions of Tomcat are more relaxed about
where they will load JDBC drivers from.


   On Tuesday, June 2, 2015 8:56 AM, Mark Thomas ma...@apache.org
 wrote:


   On 02/06/2015 12:42, Ray Holme wrote:
 I have been using tomcat for a while and have several applications.
 Some jar files are specific to an application and make sense to be in
 .../webapps/APPLICATION/WEB-INF/lib and some are used in multiple
 applications so they need to appear in each applications lib. One
 shared jar file is my own common code, but then there are many things
 that are pulled from the net (e.g. mail.jar). In addition I put one
 jar file in the top tomcate ../lib directory as it is used by
 everything for DB access (jaybird...jar in my case.
 Since I use Linux, ALL of these extra jar files are maintained
 somewhere else (same linux file system required) and I hard link them
 to the above named places so I don't need multiple copies and one
 update serves all (with a web restart, natch).
 So, here are my questions: 1) Is there any reason why the SQL library
 (jaybird above) needs to be in the .../lib (top tomcat directory) or
 could it be in the WEB-INF/lib directory too?

Yes. It needs to be in $CATALINA_BASE/lib so it is visible to the
connection pool implementation.

Putting another copy in WEB-INF/lib is theoretically safe (it should be
a NO-OP) but can often trigger class loading issues (if the app refers
to any of the classes in the JAR directly).

See the Tomcat 8 migration guide for how this changes in 8.0.x.

 If the latter is OK,
 then it becomes part of the WAR file when I distribute and thus saves
 an extra step when this jar updates. Also, by putting it (logically)
 there in the application lib(s), it evokes more security if I
 understand the purpose of doing this (see next question).
 2) Could I also put my own common jar file in the top tomcat .../lib
 directory? I am confident that it does NOT have insecure code so
 logic says it could be there, but having it in the WAR file might be
 a better option anyway as I do add things to it. In other words, if I
 were confident in the source for say mail.jar and knew it was secure,
 it too could be in the top directory (with the caveat that it no
 longer is in the WAR file).

Yes you can put your own JARs in $CATALINA_BASE/lib but beware of issues
with singletons, caches etc. The downside is that it makes it impossible
to use different versions of your JAR with different web applications
(unless you put the classes in different packages) which typically
forces you to upgrade all your applications at the same time.

 Question 1 would be useful as it makes distributions more easy and
 totally effective if all can be in the WAR file. Question 2 is just
 for me to understand better how tomcat works - I don't think I want
 to move the application jars to the tomcat lib.
 Many thanks for improving my understanding.

Personally, I'd would:
- aim to keep my web applications dependencies to a minimum
- package all the dependencies in WEB-INF/lib

Mark


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



Re: Tomcat DBCP 8.0.18 issue

2015-06-02 Thread Mark Thomas
On 01/06/2015 14:22, Tweak Ronaldo wrote:
 Hello guys,

Assuming you don't want to limit your question to men only, you would be
better to use of of the following greetings:
Hello,
Hello all,
Hello folks,

etc.

 we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
 faced the following issue:
 after database restart (Postgres), our application wasn't been able to
 restore connectivity to DB, all connections were closed and every time,
 after failed attempt to execute some SQL statement, returned back to pool.
 Pool is configured with all tests (on borrow, on return, on connect, while
 idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.
 While using 7.0.37 DBCP is able to restore from DB restart, because
 PoolableConnection class performs explicit check if underlying SQL
 connection is closed:
 
  public synchronized void close() throws SQLException {
 if (_closed) {
 // already closed
 return;
 }
 
 boolean isUnderlyingConectionClosed;
 try {
 isUnderlyingConectionClosed = _conn.isClosed();
 } catch (SQLException e) {
 try {
 _pool.invalidateObject(this); // XXX should be guarded to
 happen at most once
 } catch(IllegalStateException ise) {
 // pool is closed, so close the connection
 passivate();
 getInnermostDelegate().close();
 } catch (Exception ie) {
 // DO NOTHING the original exception will be rethrown
 }
 throw (SQLException) new SQLException(Cannot close connection
 (isClosed check failed)).initCause(e);
 }
...
 
 My question is: why this check was removed and how can one get the same
 behaviour (of 7.0.37) using 8.0.18 (not using on borrow, on return, while
 idle validations, which are SQL queries)? I see that there is a property in
 pool configuration which allows user to provide custom Validator, though I
 don't want to go this way because DBCP configuration is performed by 3rd
 party library and we don't have direct access to it.

The check to which you refer was not removed. It is still present in the
code base and - as far as I can tell from a quick look at svn - never
been removed.

DBCP has no support for a custom validator. You appear to have confused
something else with Tomcat's port of Commons DBCP (the Tomcat JDBC pool
perhaps?).

Mark


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



7.0.54 Memory Errors

2015-06-02 Thread Lunsford, David

I am noticing in my tomcat logs Atlassian Crowd throws errors relating to 
memory. Does anyone have any ideas of what's causing?


SEVERE: The web application [/crowd] created a Threadlocal with a key of type 
[net.sf.ehcache.util.concurrent.Striped64.ThreadHasCode] {calue 
[net.sf.ehcache.util.concurrent.Striped64$ThreadHashCode@23ff18ae]) and a value 
of type (net.sf.ehcache.util.concurrent.Striped64.Hashcode] but failed to 
remove it when the web application was stopped. Threads are going to be renewed 
over time and try to avoid a probable memory leak

This communication, along with its attachments, is considered confidential and 
proprietary to Vistronix.  It is intended only for the use of the person(s) 
named above.  Note that unauthorized disclosure or distribution of information 
not generally known to the public is strictly prohibited.  If you are not the 
intended recipient, please notify the sender immediately.


Re: jar files - where - please explain

2015-06-02 Thread Ray Holme
Currently using apache-tomcat-7.0.35. Not sure that matters as no behavior has 
changed in prior releases.
 


 On Tuesday, June 2, 2015 8:56 AM, Mark Thomas ma...@apache.org wrote:
   

 On 02/06/2015 12:42, Ray Holme wrote:
 I have been using tomcat for a while and have several applications. Some jar 
 files are specific to an application and make sense to be in 
 .../webapps/APPLICATION/WEB-INF/lib and some are used in multiple 
 applications so they need to appear in each applications lib. One shared jar 
 file is my own common code, but then there are many things that are pulled 
 from the net (e.g. mail.jar). In addition I put one jar file in the top 
 tomcate ../lib directory as it is used by everything for DB access 
 (jaybird...jar in my case.
 Since I use Linux, ALL of these extra jar files are maintained somewhere else 
 (same linux file system required) and I hard link them to the above named 
 places so I don't need multiple copies and one update serves all (with a web 
 restart, natch).
 So, here are my questions: 1) Is there any reason why the SQL library 
 (jaybird above) needs to be in the .../lib (top tomcat directory) or could it 
 be in the WEB-INF/lib directory too? If the latter is OK, then it becomes 
 part of the WAR file when I distribute and thus saves an extra step when this 
 jar updates. Also, by putting it (logically) there in the application lib(s), 
 it evokes more security if I understand the purpose of doing this (see next 
 question).
 2) Could I also put my own common jar file in the top tomcat .../lib 
 directory? I am confident that it does NOT have insecure code so logic says 
 it could be there, but having it in the WAR file might be a better option 
 anyway as I do add things to it. In other words, if I were confident in the 
 source for say mail.jar and knew it was secure, it too could be in the top 
 directory (with the caveat that it no longer is in the WAR file).
 Question 1 would be useful as it makes distributions more easy and totally 
 effective if all can be in the WAR file. Question 2 is just for me to 
 understand better how tomcat works - I don't think I want to move the 
 application jars to the tomcat lib.
 Many thanks for improving my understanding.
 

Tomcat version?

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



   

Re: jar files - where - please explain

2015-06-02 Thread Mark Thomas
On 02/06/2015 12:42, Ray Holme wrote:
 I have been using tomcat for a while and have several applications. Some jar 
 files are specific to an application and make sense to be in 
 .../webapps/APPLICATION/WEB-INF/lib and some are used in multiple 
 applications so they need to appear in each applications lib. One shared jar 
 file is my own common code, but then there are many things that are pulled 
 from the net (e.g. mail.jar). In addition I put one jar file in the top 
 tomcate ../lib directory as it is used by everything for DB access 
 (jaybird...jar in my case.
 Since I use Linux, ALL of these extra jar files are maintained somewhere else 
 (same linux file system required) and I hard link them to the above named 
 places so I don't need multiple copies and one update serves all (with a web 
 restart, natch).
 So, here are my questions: 1) Is there any reason why the SQL library 
 (jaybird above) needs to be in the .../lib (top tomcat directory) or could it 
 be in the WEB-INF/lib directory too? If the latter is OK, then it becomes 
 part of the WAR file when I distribute and thus saves an extra step when this 
 jar updates. Also, by putting it (logically) there in the application lib(s), 
 it evokes more security if I understand the purpose of doing this (see next 
 question).
 2) Could I also put my own common jar file in the top tomcat .../lib 
 directory? I am confident that it does NOT have insecure code so logic says 
 it could be there, but having it in the WAR file might be a better option 
 anyway as I do add things to it. In other words, if I were confident in the 
 source for say mail.jar and knew it was secure, it too could be in the top 
 directory (with the caveat that it no longer is in the WAR file).
 Question 1 would be useful as it makes distributions more easy and totally 
 effective if all can be in the WAR file. Question 2 is just for me to 
 understand better how tomcat works - I don't think I want to move the 
 application jars to the tomcat lib.
 Many thanks for improving my understanding.
 

Tomcat version?

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



Re: jar files - where - please explain

2015-06-02 Thread David kerber

On 6/2/2015 9:11 AM, Ray Holme wrote:

Currently using apache-tomcat-7.0.35. Not sure that matters as no behavior has 
changed in prior releases.


It does matter, because the directory layouts have changed in the 
various major versions.







  On Tuesday, June 2, 2015 8:56 AM, Mark Thomas ma...@apache.org wrote:


  On 02/06/2015 12:42, Ray Holme wrote:

I have been using tomcat for a while and have several applications. Some jar 
files are specific to an application and make sense to be in 
.../webapps/APPLICATION/WEB-INF/lib and some are used in multiple applications 
so they need to appear in each applications lib. One shared jar file is my own 
common code, but then there are many things that are pulled from the net (e.g. 
mail.jar). In addition I put one jar file in the top tomcate ../lib directory 
as it is used by everything for DB access (jaybird...jar in my case.
Since I use Linux, ALL of these extra jar files are maintained somewhere else 
(same linux file system required) and I hard link them to the above named 
places so I don't need multiple copies and one update serves all (with a web 
restart, natch).
So, here are my questions: 1) Is there any reason why the SQL library (jaybird 
above) needs to be in the .../lib (top tomcat directory) or could it be in the 
WEB-INF/lib directory too? If the latter is OK, then it becomes part of the WAR 
file when I distribute and thus saves an extra step when this jar updates. 
Also, by putting it (logically) there in the application lib(s), it evokes more 
security if I understand the purpose of doing this (see next question).
2) Could I also put my own common jar file in the top tomcat .../lib directory? 
I am confident that it does NOT have insecure code so logic says it could be 
there, but having it in the WAR file might be a better option anyway as I do 
add things to it. In other words, if I were confident in the source for say 
mail.jar and knew it was secure, it too could be in the top directory (with the 
caveat that it no longer is in the WAR file).
Question 1 would be useful as it makes distributions more easy and totally 
effective if all can be in the WAR file. Question 2 is just for me to 
understand better how tomcat works - I don't think I want to move the 
application jars to the tomcat lib.
Many thanks for improving my understanding.



Tomcat version?

-
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: 7.0.54 Memory Errors

2015-06-02 Thread Caldarale, Charles R
 From: Lunsford, David [mailto:david.lunsf...@vistronix.com] 
 Subject: 7.0.54 Memory Errors

 I am noticing in my tomcat logs Atlassian Crowd throws errors relating to 
 memory. Does 
 anyone have any ideas of what's causing?

 SEVERE: The web application [/crowd] created a Threadlocal with a key of type
 [net.sf.ehcache.util.concurrent.Striped64.ThreadHasCode]
 {calue [net.sf.ehcache.util.concurrent.Striped64$ThreadHashCode@23ff18ae]) 
 and a 
 value of type (net.sf.ehcache.util.concurrent.Striped64.Hashcode] but failed 
 to 
 remove it when the web application was stopped. Threads are going to be 
 renewed 
 over time and try to avoid a probable memory leak

Read the wiki:
http://wiki.apache.org/tomcat/MemoryLeakProtection

The application logic should normally remove instances of ThreadLocal 
immediately after a request has been processed since Tomcat threads are part of 
a pool.

 - 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



Re: MariaDB Connector Issues

2015-06-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Nicholas,

On 6/1/15 4:24 PM, Cuneo, Nicholas wrote:
 We’ve been running for a while now using embedded Jetty but due to
 some upcoming infrastructure changes we’re migrating to Tomcat 7.

Migrate to Tomcat 8 instead. It's going to have much longer support
and has some nice new features.

 I’m having an issue getting my servlet to recognize the mariadb 
 connector
 
 *No suitable driver found for jdbc:mariadb://*
 
 * *
 
 This has been running in the past with Jetty, so I haven’t made any
 code changes.  I’ve dropped the mariadb-java-client-1.1.8.jar in
 the tomcathome/lib directory as in my experience in the past this
 was all I needed to do.  However since I’m still getting this
 exception I’m not sure how to debug further.  I’ve tried running
 tomcat with the debug option
 
 *bin/catalina.bat debug *
 
 but I’m not really sure how to  use it properly other than running
 my servlet and viewing the classpath.
 
 Any assistance on the matter would be helpful.
 
 [Update]
 
 Apparently with Tomcat7/8 and Java 7+ (we are using java8) you
 must explicitly add the driver in the code:
 
 Class.forName(org.mariadb.jdbc.Driver).newInstance();
 
 I feel like this is a bug with Tomcat7/8 since after Java 6 this
 was no longer required (and indeed worked in Tomcat5 and 6).
 Anyway, if anyone else runs into that problem they can resolve it.

You should not have to call Class.forName yourself; the connection
pool should be doing this for you.

What does your Resource element look like, and where are you
configuring your DataSource?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVbdVfAAoJEBzwKT+lPKRYM24QAMpNQUav9QKDl9KqkYdKp/0i
jYnSs/6PPmDZJxb1M6yY89LiJ32HQ/HA9e8lyM26wPfIWALjwECDye9keT/lhQjr
qm8PC/Zh8OHAQvNgT3IITOejmAf1cGC3N/KZcLVVSCx2POAq576QGzSLaeXCwlvr
5dLbarttld9YswHDzejGx3GHLN+dywDUfGshFRRgVbStUhrVZCoGSFGkmM4SmXHN
+s3S9i56RLYQMXGY8rQRzt5criyphknrBYRqrjehDiy47gdE5D1v9ZnqTt+HceuK
JP+3PjC9L+JS4tJdf/bvvnoH735eYUt9jCuilohBy/LCwKkVSSQGkhUdTUEqSvgO
vTDss9oYi8D3GOwpKo7HXP4ISAahAGRLhLuEouDyiUf4Ttxun97OXT9IEOUgUQ6x
fInMIVBEFss5SZZs+q2rpfXlFBjyRcYYJBGU9Li+EPU9XuN5YZha73hG8nI64MYA
CDGqNDiwNh2bLAV55M4s7rjtn3WJtME9gIrd8TC8HgPOmT1y1a+ZooOHf3d/DLXM
4zEEASA9smmKiC5UtjInd49r2nOxle04JhTb7hJFqu+GMPIC8ao7vNz/AYRFzKZe
wkidXengZY9iEyZItwCYNLfhr0+Nj0dTgf6NX11G1nzfmgrlGjMiPscfhsSfHKu0
VOPRsa0NP/MNdM6YnqHQ
=FlzG
-END PGP SIGNATURE-

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



Re: [OT] 7.0.54 Memory Errors

2015-06-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

David,

On 6/2/15 10:36 AM, Lunsford, David wrote:
 I am noticing in my tomcat logs Atlassian Crowd throws errors 
 relating to memory. Does anyone have any ideas of what's causing?
 
 
 SEVERE: The web application [/crowd] created a Threadlocal with a
 key of type
 [net.sf.ehcache.util.concurrent.Striped64.ThreadHasCode] {calue 
 [net.sf.ehcache.util.concurrent.Striped64$ThreadHashCode@23ff18ae])

 
and a value of type
 (net.sf.ehcache.util.concurrent.Striped64.Hashcode] but failed to 
 remove it when the web application was stopped. Threads are going
 to be renewed over time and try to avoid a probable memory leak

Are there *any* Atlassian products that aren't slow as dogs and leaky
as sieves? Every anecdote I hear is negative.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVbdfoAAoJEBzwKT+lPKRYKO8QAMhLWg7Qu5xO2w/d53EjAsWU
W74ruHbXo61r6BWl5SsIcx6Cu+DPWg16MostG2z9f5OjL2Wm8C810efY658uiy/o
QrXMmIvLIPAzu4128pwZoHrAawBZcq6/hQUDTbR32aMAf4FG8sCT3TY2ltNvGYIm
5jzo0BSUzY8ZEUKu/gwifQ292YDcsey5+rrxTmcW23kpPw2ReDh4BApmw24dgJ4V
1FxMFZu1zACwfZNxnjUJBkpYLAql7tCt0parbBxY1ukPMoEeUmUk0FeZtZAd6f0T
l2FN+KiTdk3JIWVlGOkfzsNUKHpQEgzTmli1XDdaAxZofkEXhF8P8Z4+5tr1BlFw
4Qjjf37L5Qkt4CDiPZJlPj3jIQ2erBQiIeNTrO4SpTlW4GoOmHCXVD80BDzCCL2F
LI0YzbdASg1cXR7Lc2DVxiUlRJQ12lrPrLg1pW153gDSo9uoHgKqcUk6qprRIYUj
8jELI0qcI4EGu0jq8ZcFgBwggCHGE1UZs7zBnPZLenWZwV2+Ktt5QjPplxmwgiGH
xS4u5S/uoAmloXaFo+7G3ixIMXRBlFwWgoQ+94WwkJnNuSm/qiBuyo4ut9cAVNBT
zaSzpprb02nlfaUFTZ6opu+srnHCNVfohFKCqAArrVz+s73h/kDG2R73XQncdcVL
D8VakyJCULHyh3iESNhr
=5l5/
-END PGP SIGNATURE-

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



Deploy local war to Tomcat with Maven plugin

2015-06-02 Thread toddfas
I'm trying to use the Tomcat Maven plugin to deploy a local war (file path
relative to the Tomcat server) and can't seem to find the right combination
of configuration. The plugin always wants to validate the WAR file path
specified exists relative to the plugin - not the Tomcat server.

Currently we use the Ant deploy task with a localWar specified (
https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/ant/DeployTask.html#localWar).
Does the Maven plugin offer a similar option?

Background:
Our local development machines are a combination of Windows, OSX, and
Linux. All developers have Tomcat running inside a Linux Vagrant VM. The
builds happen on their host machine and are deployed to the Tomcat instance
via a shared folder path (i.e. the WAR file on their host is
c:\app\target\app-1.0.0-SNAPSHOT.war and is
/vagrant/target/app-1.0.0-SNAPSHOT.war on Vagrant VM running Tomcat). I
want to deploy to the Tomcat instance using the VM file path because it is
faster than uploading it to Tomcat over HTTP.

Here was my test using curl to compare the two (33 seconds vs 19 seconds):

time curl -T target/app-1.0.0-SNAPSHOT.war  
http://mgr:mgrpw@127.0.0.1:8080/manager/text/deploy?path=/appupdate=true;
OK - Deployed application at context path /app
curl -T target/app-1.0.0-SNAPSHOT.war   0.02s user 0.17s system 0% cpu
33.031 total

time curl 
http://mgr:mgrpw@127.0.0.1:8080/manager/text/deploy?path=/appupdate=truewar=/vagrant/target/app-1.0.0-SNAPSHOT.war

OK - Deployed application at context path /app
curl   0.00s user 0.01s system 0% cpu 19.571 total

Thanks for any insight.
Todd