RE: Prepared statements are not cached with XA in tomcat jdbc connection pool implementation

2016-05-17 Thread Sailaja Ravipati
Thank you. Will do that.

Regards,
Sailaja.

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: 18 May 2016 01:24
To: Tomcat Users List
Subject: Re: Prepared statements are not cached with XA in tomcat jdbc 
connection pool implementation

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Sailaja,

On 5/17/16 6:58 AM, Sailaja Ravipati wrote:
> I am using TomEE version Apache Tomcat Version 7.0.63. I have the 
> following test program.
> 
> public static void main(String[] args) throws Exception { final 
> TransactionManager transactionManager = TransactionManagerFactory 
> .getTransactionManager(); final PoolProperties poolProperties = new 
> PoolProperties();  SQLServerDataSource dataSource = new 
> com.microsoft.sqlserver.jdbc.SQLServerDataSource();
> dataSource.setUser("sa"); dataSource.setPassword("$9Lserver");
> dataSource.setURL("jdbc:sqlserver://sdwivedi63ks022:1433;sendStringPar
ametersAsUnicode=false");
>
> 
dataSource.setDatabaseName("himalaya");
> poolProperties.setDataSource(dataSource);  final String 
> jdbcInterceptors = 
> "org.apache.tomcat.jdbc.pool.interceptor.StatementCache(prepared=true,
callable=true)";
>
> 
poolProperties.setJdbcInterceptors(jdbcInterceptors);
> final org.apache.tomcat.jdbc.pool.DataSource pooledOracleDatasource = 
> new org.apache.tomcat.jdbc.pool.XADataSource( poolProperties); final 
> javax.sql.DataSource oracleDataSource = new 
> org.apache.openejb.resource.jdbc.managed.xa.ManagedXADataSource(
> pooledOracleDatasource, transactionManager, 
> TransactionProvider.getTransactionSynchronizationRegistry());
> Connection connection = oracleDataSource.getConnection(); for(int i=0; 
> i<50; i++) { PreparedStatement preparedStatement = 
> connection.prepareStatement("insert into MyTableNew values (" + i + 
> ")"); System.out.println(preparedStatement.getClass().getName());
> preparedStatement.execute(); preparedStatement.close(); } 
> connection.close(); }
> 
> If I run the above program, the output I see is: 
> com.sun.proxy.$Proxy11
> 
> If I just change the above program to use XA datasource, i.e. 
> Change the following line SQLServerDataSource dataSource = new 
> com.microsoft.sqlserver.jdbc.SQLServerDataSource(); To 
> SQLServerXADataSource dataSource = new 
> com.microsoft.sqlserver.jdbc.SQLServerXADataSource(); The output is
> : com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement
> 
> So, if I use XA datasource, prepared statements are not cached. How do 
> I log a defect ?

The problem would be in commons-dbcp, so you should file a bug report in JIRA 
here:

http://commons.apache.org/proper/commons-dbcp/issue-tracking.html

Bug reports with complete information (or even a patch!) will get more 
attention than those without.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXO3bFAAoJEBzwKT+lPKRY1oAP/iy4c6LQNx/Gcg+24MJry0/t
l30JkJsgeCa6uXgs7JUjCLxmaPjhCF3Fw4FtzwzqUgEY13yTF7jlFhvuq1elOoQx
w0eHpcW39iQ0DJvGvbz6cEpsR902mSSXyt6Ar7AAeZoAs7AlYKhLmp9wKBdqq1pq
PSJcBhrwxA0OcIgDscCj667diUYmmi914LRSUXNwiCCH3ymAMsoXFi63FD1/VxEf
W3vqKxJvmKwhlP1Jia0T9mCusqmwQfct2lJXuU+W9dDyCogkBdv4anDBivdRVJA8
VYRzHPjQQQOg7dwmXkulRLp1vToqFFaAFDhUVL+RSTX+R+Ee9fg+vqssUD4U6ba/
GCTXMTMck2/n06dDcNcpfF5M20nFDQ8eBUDqsmbP+NBMrTZfdyUTihCaoRW1x1rv
+YVJuD5TA6bNC6n70bWMLT2ybs3cxplB7lwPueO0t88nBehDqsz+XRSS64Si6hXn
wjKaW+CO7tVMhRmf8g9yKFKppklIUCpWX12iyJ4SRWtAVRIBcZ47HFgXfukPo03A
DcUwpjsSHgvyOUpwWe31mVeQMyY5VDu8lFSjqmaHthqQGvRnGaYUPD3VJd71mobV
AqkNTk3xcySN/sirUx6KVm6rwYClIvN2xQswn5cvFeRjRFO6BCGemjsW7+aF40Mu
+Q3ahYmlTYBownFshBV2
=Vau+
-END PGP SIGNATURE-

-
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



request.getParameter and special characters - Apache Tomcat/7.0.57 on win 7

2016-05-17 Thread Kiran Badi
Hi ,

I have this link in jsp which has below tags,

<%@page contentType="text/html" pageEncoding="UTF-8"%>

 Testing

and then my servlet looks like below,

/*
 * To change this license header, choose License Headers in Project
Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Kiran
 */
@WebServlet(name = "TestServlet", urlPatterns = {"/TestServlet"})
public class TestServlet extends HttpServlet {

/**
 * Processes requests for both HTTP GET and
POST
 * methods.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample
code. */
String param = request.getParameter("teststring");
String param1 = new
String(request.getParameter("teststring").getBytes("UTF-8"));
out.println("");
out.println("");
out.println("");
out.println("Servlet TestServlet");
out.println("");
out.println("");
out.println("Servlet TestServlet at " +
request.getContextPath() + "");
out.println("Servlet TestServlet at " + param + "");
out.println("Servlet TestServlet at " + param1 + "");
out.println("");
out.println("");
}
}

// 
/**
 * Handles the HTTP GET method.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}

/**
 * Handles the HTTP POST method.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}

   }

and getParameter for some reason seems to truncating the value after &

Servlet TestServlet at testingServlet TestServlet at testing

I really need to understand as what characters are accepted and what
characters get truncated with getParameter.

I am building few links on the fly which might have space,backslashes,
comma and & characters in it.So wanted to understand should I encode it via
js or container can take care of those for me.

container connector setting has URIEncoding="UTF-8" settings.

Thanking you
Kiran Badi


How to acess HttpServletRequest in Jaas login module in Tomcat

2016-05-17 Thread Saurabh.Suman
Hello experts

How to acess HttpServletRequest in Jaas login module in Tomcat? In Jboss we can 
get it through


HttpServletRequest request = 
(HttpServletRequest)PolicyContext.getContext("javax.servlet.http.HttpServletRequest")

But it's not working in Tomcat since Jacc is not supported by Tomcat yet. Is 
there anyother way in tomcat to get HttpServletRequest in Jaas login module ?



SAURABH SUMAN
Software Developer
Markets & International Banking
RBS
Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 
122002, India
Office: +91 124 6195699  |  Mobile: +91 375289


***
 
The Royal Bank of Scotland plc. Registered in Scotland No 90312. 
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised by the Prudential Regulation Authority and regulated 
by the Financial Conduct Authority and Prudential Regulation Authority. 
The Royal Bank of Scotland N.V. is authorised and regulated by the 
De Nederlandsche Bank and has its seat at Amsterdam, the 
Netherlands, and is registered in the Commercial Register under 
number 33002587. Registered Office: Gustav Mahlerlaan 350, 
Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and 
The Royal Bank of Scotland plc are authorised to act as agent for each 
other in certain jurisdictions. 
  
This e-mail message is confidential and for use by the addressee only. 
If the message is received by anyone other than the addressee, please 
return the message to the sender by replying to it and then delete the 
message from your computer. Internet e-mails are not necessarily 
secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
N.V. including its affiliates ("RBS group") does not accept responsibility 
for changes made to this message after it was sent. For the protection
of RBS group and its clients and customers, and in compliance with
regulatory requirements, the contents of both incoming and outgoing
e-mail communications, which could include proprietary information and
Non-Public Personal Information, may be read by authorised persons
within RBS group other than the intended recipient(s). 

Whilst all reasonable care has been taken to avoid the transmission of 
viruses, it is the responsibility of the recipient to ensure that the onward 
transmission, opening or use of this message and any attachments will 
not adversely affect its systems or data. No responsibility is accepted 
by the RBS group in this regard and the recipient should carry out such 
virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com 
***
  


Re: Tomcat DS question

2016-05-17 Thread pradeep reddy
Also, how to determine if the application is using ojdbc6.jar or
tomcat-dbcp.jar for connection pool. Apologies I am not a developer and
want to understand the concept of connection pool.

Thanks
Pradeep

On Tue, May 17, 2016 at 2:32 PM, Woonsan Ko  wrote:

> I don't know much about that for Oracle. What I was trying to mention
> was simply that you can check if you have a system property
> (-Djavax.sql.DataSource.Factory=...) to use a custom one. (Even though
> it's not that common, but it's still possible to override it by system
> property.) Your configuration doesn't have the factory attribute, so
> if you don't have the specific system property, then you can rule out
> my suspicion and focus on some other possibilities.
>
> Regards,
>
> Woonsan
>
>
> On Tue, May 17, 2016 at 2:51 PM, pradeep reddy 
> wrote:
> > Thanks for response, would you know if there is any recommended dbcp jar
> > that we need to use for Oracle 12 and Tomcat 6 ?
> >
> > Thanks
> > Pradeep
> >
> > On Tue, May 17, 2016 at 11:07 AM, Woonsan Ko  wrote:
> >
> >> Hi Pradeep,
> >>
> >> I saw you had Oracle specific settings such as
> >> connectionCachingEnabled. So, maybe you're using Oracle specific
> >> DataSourceFactory instead of the default dbcp one.
> >> As far as I know, the default factory
> >> (org.apache...BasicDataSourceFactory) can be overridden by either
> >> factory attribute in the  element or
> >> javax.sql.DataSource.Factory system property.
> >> In that case, it might be an issue around the custom factory
> >> implementation, not tomcat.
> >>
> >> Regards,
> >>
> >> Woonsan
> >>
> >>
> >> On Mon, May 16, 2016 at 6:54 PM, pradeep reddy 
> >> wrote:
> >> > Hello Woonsan,
> >> >Via Jconsole I had validated all my changes that were made in
> >> > context.xml. But for some reason the logs doesn't show anything about
> >> > abandoned connections in catalina.out. I am not sure at this time if
> its
> >> a
> >> > bug in tomcat 6 or tomcat-dbcp.jar, but threaddumps clearly show that
> >> > threads are waiting on connections from connection pool.
> >> >
> >> > Thanks
> >> > Pradeep
> >> >
> >> > On Mon, May 16, 2016 at 4:38 PM, Woonsan Ko 
> wrote:
> >> >
> >> >> Hi Pradeep,
> >> >>
> >> >> Just in case, you might want to make sure your changes were really
> >> >> applied. For example, an effective context.xml could be in
> >> >> conf/Catalina/localhost/...
> >> >> If it was applied properly, the stack trace should have shown
> >> >> o.a.c.dbcp.AbandonedObjectPool#borrowObject() as well.
> >> >>
> >> >> Regards,
> >> >>
> >> >> Woonsan
> >> >>
> >> >>
> >> >> On Mon, May 16, 2016 at 5:54 PM, pradeep reddy <
> pradeep@gmail.com>
> >> >> wrote:
> >> >> > unfortunately it is not writing anything catalina.out :-(
> >> >> >
> >> >> > Thanks
> >> >> > Pradeep
> >> >> >
> >> >> > On Mon, May 16, 2016 at 3:47 PM, Christopher Schultz <
> >> >> > ch...@christopherschultz.net> wrote:
> >> >> >
> >> >> >> -BEGIN PGP SIGNED MESSAGE-
> >> >> >> Hash: SHA256
> >> >> >>
> >> >> >> Pradeep,
> >> >> >>
> >> >> >> On 5/16/16 5:13 PM, pradeep reddy wrote:
> >> >> >> > Hello Christopher,
> >> >> >> >
> >> >> >> > Let me post my thread dump here.
> >> >> >> >
> >> >> >> > All  HTTP threads are in WAITING state.
> >> >> >> >
> >> >> >> > "http-12453-346" daemon prio=10 tid=0x7fbd3061f800
> nid=0x59d0
> >> >> >> > in Object.wait() [0x7fbbe124f000] java.lang.Thread.State:
> >> >> >> > WAITING (on object monitor) at java.lang.Object.wait(Native
> >> >> >> > Method) at java.lang.Object.wait(Object.java:485) at
> >> >> >> >
> >> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(Generi
> >> >> >> cObjectPool.java:1104)
> >> >> >> >
> >> >> >> >
> >> >> >> - - locked <0x00072b18f320> (a
> >> >> >> > org.apache.tomcat.dbcp.pool.impl.GenericObjectPool$Latch) at
> >> >> >> >
> >> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDat
> >> >> >> aSource.java:106)
> >> >> >> >
> >> >> >> >
> >> >> >> at
> >> >> >>
> >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
> >> >> >> e.java:1044)
> >> >> >> > at
> >> >> >> >
> >> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.g
> >> >> >> etConnection(LocalDataSourceConnectionProvider.java:82)
> >> >> >>
> >> >> >> Yep,
> >> >> >> >
> >> >> >> that certainly looks like you are waiting for connections from
> >> >> >> Tomcat's DBCP-based pool.
> >> >> >>
> >> >> >> >  >> >> >> > type="javax.sql.DataSource"
> >> >> >> > driverClassName="oracle.jdbc.OracleDriver" url="XXX"
> >> >> >> > username="XX" password="XX" initialSize="1"
> maxActive="10"
> >> >> >> > minIdle="1" maxIdle="1" connectionCachingEnabled="true"
> >> >> >> > fastConnectionFailoverEnabled="true"
> >> >> >> > connectionCacheProperties="{MinLimit=1, MaxLimit=20,
> >> >> >> > InitialLimit=1,
> 

RE: Failed to process TLD with path [/WEB-INF/struts-tiles.tld]

2016-05-17 Thread Venkata Reddy P
Many Thanks Marks. In my case I have references in the .jsp pages, after 
replacing /WEB-INF/... to as below. Now it got generated but as you said still 
wanrings and info are getting generated.
<%@ taglib uri="http://struts.apache.org/tags-bean; prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html; prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic; prefix="logic" %>

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: 18 May 2016 02:23
To: Tomcat Users List
Subject: Re: Failed to process TLD with path [/WEB-INF/struts-tiles.tld]

On 17/05/2016 21:46, Venkata Reddy P wrote:
> Hi,
> While compiling .jsp file using tomcat8.0.33 binaries getting the following 
> error, can you please advice?

There is no error. There are two warnings (because the JSP references TLD files 
that don't exist) and one INFO message that you can improve the application 
start time by not scanning JARs for TLDs when the JARs don't contain TLDs.

Mark


> These jsps were compiling well in tomcat6.0.43
> 
> [apply] WARNING: Failed to process TLD with path [/WEB-INF/struts-tiles.tld] 
> and URI [/tags/struts-tiles]. The specified path does not exist.
> [apply] May 17, 2016 4:26:58 PM org.apache.jasper.servlet.TldScanner 
> scanJspConfig
> [apply] WARNING: Failed to process TLD with path 
> [/WEB-INF/struts-nested.tld] and URI [/tags/struts-nested]. The specified 
> path does not exist.
> [apply] May 17, 2016 4:26:58 PM org.apache.jasper.servlet.TldScanner 
> scanJars
> [apply] INFO: At least one JAR was scanned for TLDs yet contained 
> no TLDs. Enable debug logging for this logger for a complete list of 
> JARs that were scanned but no TLDs were found in them. Skipping 
> unneeded JARs during scanning can improve startup
> 
> Thanks in advance
> 


-
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: Failed to process TLD with path [/WEB-INF/struts-tiles.tld]

2016-05-17 Thread Mark Thomas
On 17/05/2016 21:46, Venkata Reddy P wrote:
> Hi,
> While compiling .jsp file using tomcat8.0.33 binaries getting the following 
> error, can you please advice?

There is no error. There are two warnings (because the JSP references
TLD files that don't exist) and one INFO message that you can improve
the application start time by not scanning JARs for TLDs when the JARs
don't contain TLDs.

Mark


> These jsps were compiling well in tomcat6.0.43
> 
> [apply] WARNING: Failed to process TLD with path [/WEB-INF/struts-tiles.tld] 
> and URI [/tags/struts-tiles]. The specified path does not exist.
> [apply] May 17, 2016 4:26:58 PM org.apache.jasper.servlet.TldScanner 
> scanJspConfig
> [apply] WARNING: Failed to process TLD with path 
> [/WEB-INF/struts-nested.tld] and URI [/tags/struts-nested]. The specified 
> path does not exist.
> [apply] May 17, 2016 4:26:58 PM org.apache.jasper.servlet.TldScanner 
> scanJars
> [apply] INFO: At least one JAR was scanned for TLDs yet contained no 
> TLDs. Enable debug logging for this logger for a complete list of JARs that 
> were scanned but no TLDs were found in them. Skipping unneeded JARs during 
> scanning can improve startup
> 
> Thanks in advance
> 


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



Failed to process TLD with path [/WEB-INF/struts-tiles.tld]

2016-05-17 Thread Venkata Reddy P
Hi,
While compiling .jsp file using tomcat8.0.33 binaries getting the following 
error, can you please advice?
These jsps were compiling well in tomcat6.0.43

[apply] WARNING: Failed to process TLD with path [/WEB-INF/struts-tiles.tld] 
and URI [/tags/struts-tiles]. The specified path does not exist.
[apply] May 17, 2016 4:26:58 PM org.apache.jasper.servlet.TldScanner 
scanJspConfig
[apply] WARNING: Failed to process TLD with path 
[/WEB-INF/struts-nested.tld] and URI [/tags/struts-nested]. The specified path 
does not exist.
[apply] May 17, 2016 4:26:58 PM org.apache.jasper.servlet.TldScanner 
scanJars
[apply] INFO: At least one JAR was scanned for TLDs yet contained no TLDs. 
Enable debug logging for this logger for a complete list of JARs that were 
scanned but no TLDs were found in them. Skipping unneeded JARs during scanning 
can improve startup

Thanks in advance


Re: Tomcat DS question

2016-05-17 Thread Woonsan Ko
I don't know much about that for Oracle. What I was trying to mention
was simply that you can check if you have a system property
(-Djavax.sql.DataSource.Factory=...) to use a custom one. (Even though
it's not that common, but it's still possible to override it by system
property.) Your configuration doesn't have the factory attribute, so
if you don't have the specific system property, then you can rule out
my suspicion and focus on some other possibilities.

Regards,

Woonsan


On Tue, May 17, 2016 at 2:51 PM, pradeep reddy  wrote:
> Thanks for response, would you know if there is any recommended dbcp jar
> that we need to use for Oracle 12 and Tomcat 6 ?
>
> Thanks
> Pradeep
>
> On Tue, May 17, 2016 at 11:07 AM, Woonsan Ko  wrote:
>
>> Hi Pradeep,
>>
>> I saw you had Oracle specific settings such as
>> connectionCachingEnabled. So, maybe you're using Oracle specific
>> DataSourceFactory instead of the default dbcp one.
>> As far as I know, the default factory
>> (org.apache...BasicDataSourceFactory) can be overridden by either
>> factory attribute in the  element or
>> javax.sql.DataSource.Factory system property.
>> In that case, it might be an issue around the custom factory
>> implementation, not tomcat.
>>
>> Regards,
>>
>> Woonsan
>>
>>
>> On Mon, May 16, 2016 at 6:54 PM, pradeep reddy 
>> wrote:
>> > Hello Woonsan,
>> >Via Jconsole I had validated all my changes that were made in
>> > context.xml. But for some reason the logs doesn't show anything about
>> > abandoned connections in catalina.out. I am not sure at this time if its
>> a
>> > bug in tomcat 6 or tomcat-dbcp.jar, but threaddumps clearly show that
>> > threads are waiting on connections from connection pool.
>> >
>> > Thanks
>> > Pradeep
>> >
>> > On Mon, May 16, 2016 at 4:38 PM, Woonsan Ko  wrote:
>> >
>> >> Hi Pradeep,
>> >>
>> >> Just in case, you might want to make sure your changes were really
>> >> applied. For example, an effective context.xml could be in
>> >> conf/Catalina/localhost/...
>> >> If it was applied properly, the stack trace should have shown
>> >> o.a.c.dbcp.AbandonedObjectPool#borrowObject() as well.
>> >>
>> >> Regards,
>> >>
>> >> Woonsan
>> >>
>> >>
>> >> On Mon, May 16, 2016 at 5:54 PM, pradeep reddy 
>> >> wrote:
>> >> > unfortunately it is not writing anything catalina.out :-(
>> >> >
>> >> > Thanks
>> >> > Pradeep
>> >> >
>> >> > On Mon, May 16, 2016 at 3:47 PM, Christopher Schultz <
>> >> > ch...@christopherschultz.net> wrote:
>> >> >
>> >> >> -BEGIN PGP SIGNED MESSAGE-
>> >> >> Hash: SHA256
>> >> >>
>> >> >> Pradeep,
>> >> >>
>> >> >> On 5/16/16 5:13 PM, pradeep reddy wrote:
>> >> >> > Hello Christopher,
>> >> >> >
>> >> >> > Let me post my thread dump here.
>> >> >> >
>> >> >> > All  HTTP threads are in WAITING state.
>> >> >> >
>> >> >> > "http-12453-346" daemon prio=10 tid=0x7fbd3061f800 nid=0x59d0
>> >> >> > in Object.wait() [0x7fbbe124f000] java.lang.Thread.State:
>> >> >> > WAITING (on object monitor) at java.lang.Object.wait(Native
>> >> >> > Method) at java.lang.Object.wait(Object.java:485) at
>> >> >> >
>> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(Generi
>> >> >> cObjectPool.java:1104)
>> >> >> >
>> >> >> >
>> >> >> - - locked <0x00072b18f320> (a
>> >> >> > org.apache.tomcat.dbcp.pool.impl.GenericObjectPool$Latch) at
>> >> >> >
>> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDat
>> >> >> aSource.java:106)
>> >> >> >
>> >> >> >
>> >> >> at
>> >> >>
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
>> >> >> e.java:1044)
>> >> >> > at
>> >> >> >
>> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.g
>> >> >> etConnection(LocalDataSourceConnectionProvider.java:82)
>> >> >>
>> >> >> Yep,
>> >> >> >
>> >> >> that certainly looks like you are waiting for connections from
>> >> >> Tomcat's DBCP-based pool.
>> >> >>
>> >> >> > > >> >> > type="javax.sql.DataSource"
>> >> >> > driverClassName="oracle.jdbc.OracleDriver" url="XXX"
>> >> >> > username="XX" password="XX" initialSize="1" maxActive="10"
>> >> >> > minIdle="1" maxIdle="1" connectionCachingEnabled="true"
>> >> >> > fastConnectionFailoverEnabled="true"
>> >> >> > connectionCacheProperties="{MinLimit=1, MaxLimit=20,
>> >> >> > InitialLimit=1, oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR=3000}"
>> >> >> > ONSConfiguration="nodes=X" validationQuery="SELECT 1 from
>> >> >> > DUAL" removeAbandoned="true" removeAbandonedTimeout="30"
>> >> >> > logAbandoned="true" maxWait="-1"/>
>> >> >>
>> >> >> That configuration looks okay to me.
>> >> >>
>> >> >> The "abandoned" logs are logged to stdout, so they should show up in
>> >> >> your catalina.out file (or stdout.log if you are using a Windows
>> Service
>> >> >> ).
>> >> >>
>> >> >> Are you getting no messages about the abandoned connections?
>> >> >>
>> >> >> - -chris
>> 

Re: Tomcat DS question

2016-05-17 Thread pradeep reddy
Hi Chris,
It is not writing anything related to DBCP in catalina.out.

Thanks
Pradeep

On Tue, May 17, 2016 at 1:49 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Pradeep,
>
> On 5/17/16 2:51 PM, pradeep reddy wrote:
> > Thanks for response, would you know if there is any recommended
> > dbcp jar that we need to use for Oracle 12 and Tomcat 6 ?
>
> You don't need anything special. Woonson did not read your original
> configuration evidently, or the stack trace. Both of those show that
> DBCP is in fact in use and no special factory is being used.
>
> When you say that "it is not writing anything catalina.out", do you
> mean that catalina.out does not exist, is empty, or has log messages
> in it but nothing about DBCP itself?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXO3XlAAoJEBzwKT+lPKRYoiIP/R5hPraVx3xDft+E4zLSPdon
> SM+9nQcqdTRGfLvjbOHdsH1Yt+4cRIhTegxHdfSalsHvBV8iuh5xPdcn4epwKZl4
> Twu+s8LTaNK5PD3bhV3qJtlNpg+IyBAQoqk9weZcHsgaa/0tfZEeH3tIrJbBoZ+L
> v///WExXCnviksBGxwk2w5iimYMcsyTVdADh/Pi8SgdinKtakxly+d0rfu0aUR2S
> KFfBMaKr4bqf22PxVM5IhNxURzrGep73b18mT0kZ96yTjWpan7lOBzyx6w+2u5GK
> +GIuwHGqqtoWDPxLEo9hG0JgNOCiLszNcdMGeyd3l3CXlPxp4vvMcj4LvUx7lqrs
> oJ/UoPNFgPW2SfJNSagluvlIcqMzkFADLu7pfF15QoHJQsR2gNcoFn6xLq4E08WM
> 0Igcyxn9+42Gkl5troeGnt0DOgMF4SzFATXg70263GwXELqLBHB6DYPBrugLmdCx
> XBhPGh9PAy/mT3wJ1qEVlAQCAl7vY5jI0E6ZBl1ljLcQM9x1YQZ3sJhPlOgcqMCB
> bERByGDx3DMls5/eWFwohPbVV2kG6xpDfvhW2ZLF1IP/+DHNyD/phyZZr9sPS164
> d7/eYEWL63qWCt1MR3AlXO37UDIRQ15kdcPuK9QCvR+nC/ULPqAGB50KeDe7YyLH
> fBuVMTq84RA9M1pCYCRy
> =W5lv
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Prepared statements are not cached with XA in tomcat jdbc connection pool implementation

2016-05-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Sailaja,

On 5/17/16 6:58 AM, Sailaja Ravipati wrote:
> I am using TomEE version Apache Tomcat Version 7.0.63. I have the
> following test program.
> 
> public static void main(String[] args) throws Exception { final
> TransactionManager transactionManager = TransactionManagerFactory 
> .getTransactionManager(); final PoolProperties poolProperties = new
> PoolProperties();  SQLServerDataSource dataSource = new
> com.microsoft.sqlserver.jdbc.SQLServerDataSource(); 
> dataSource.setUser("sa"); dataSource.setPassword("$9Lserver"); 
> dataSource.setURL("jdbc:sqlserver://sdwivedi63ks022:1433;sendStringPar
ametersAsUnicode=false");
>
> 
dataSource.setDatabaseName("himalaya");
> poolProperties.setDataSource(dataSource);  final String
> jdbcInterceptors =
> "org.apache.tomcat.jdbc.pool.interceptor.StatementCache(prepared=true,
callable=true)";
>
> 
poolProperties.setJdbcInterceptors(jdbcInterceptors);
> final org.apache.tomcat.jdbc.pool.DataSource pooledOracleDatasource
> = new org.apache.tomcat.jdbc.pool.XADataSource( poolProperties); 
> final javax.sql.DataSource oracleDataSource = new
> org.apache.openejb.resource.jdbc.managed.xa.ManagedXADataSource( 
> pooledOracleDatasource, transactionManager, 
> TransactionProvider.getTransactionSynchronizationRegistry()); 
> Connection connection = oracleDataSource.getConnection(); for(int
> i=0; i<50; i++) { PreparedStatement preparedStatement =
> connection.prepareStatement("insert into MyTableNew values (" + i +
> ")"); System.out.println(preparedStatement.getClass().getName()); 
> preparedStatement.execute(); preparedStatement.close(); } 
> connection.close(); }
> 
> If I run the above program, the output I see is: 
> com.sun.proxy.$Proxy11
> 
> If I just change the above program to use XA datasource, i.e. 
> Change the following line SQLServerDataSource dataSource = new
> com.microsoft.sqlserver.jdbc.SQLServerDataSource(); To 
> SQLServerXADataSource dataSource = new
> com.microsoft.sqlserver.jdbc.SQLServerXADataSource(); The output is
> : com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement
> 
> So, if I use XA datasource, prepared statements are not cached. How
> do I log a defect ?

The problem would be in commons-dbcp, so you should file a bug report
in JIRA here:

http://commons.apache.org/proper/commons-dbcp/issue-tracking.html

Bug reports with complete information (or even a patch!) will get more
attention than those without.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXO3bFAAoJEBzwKT+lPKRY1oAP/iy4c6LQNx/Gcg+24MJry0/t
l30JkJsgeCa6uXgs7JUjCLxmaPjhCF3Fw4FtzwzqUgEY13yTF7jlFhvuq1elOoQx
w0eHpcW39iQ0DJvGvbz6cEpsR902mSSXyt6Ar7AAeZoAs7AlYKhLmp9wKBdqq1pq
PSJcBhrwxA0OcIgDscCj667diUYmmi914LRSUXNwiCCH3ymAMsoXFi63FD1/VxEf
W3vqKxJvmKwhlP1Jia0T9mCusqmwQfct2lJXuU+W9dDyCogkBdv4anDBivdRVJA8
VYRzHPjQQQOg7dwmXkulRLp1vToqFFaAFDhUVL+RSTX+R+Ee9fg+vqssUD4U6ba/
GCTXMTMck2/n06dDcNcpfF5M20nFDQ8eBUDqsmbP+NBMrTZfdyUTihCaoRW1x1rv
+YVJuD5TA6bNC6n70bWMLT2ybs3cxplB7lwPueO0t88nBehDqsz+XRSS64Si6hXn
wjKaW+CO7tVMhRmf8g9yKFKppklIUCpWX12iyJ4SRWtAVRIBcZ47HFgXfukPo03A
DcUwpjsSHgvyOUpwWe31mVeQMyY5VDu8lFSjqmaHthqQGvRnGaYUPD3VJd71mobV
AqkNTk3xcySN/sirUx6KVm6rwYClIvN2xQswn5cvFeRjRFO6BCGemjsW7+aF40Mu
+Q3ahYmlTYBownFshBV2
=Vau+
-END PGP SIGNATURE-

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



Re: Tomcat DS question

2016-05-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pradeep,

On 5/17/16 2:51 PM, pradeep reddy wrote:
> Thanks for response, would you know if there is any recommended
> dbcp jar that we need to use for Oracle 12 and Tomcat 6 ?

You don't need anything special. Woonson did not read your original
configuration evidently, or the stack trace. Both of those show that
DBCP is in fact in use and no special factory is being used.

When you say that "it is not writing anything catalina.out", do you
mean that catalina.out does not exist, is empty, or has log messages
in it but nothing about DBCP itself?

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXO3XlAAoJEBzwKT+lPKRYoiIP/R5hPraVx3xDft+E4zLSPdon
SM+9nQcqdTRGfLvjbOHdsH1Yt+4cRIhTegxHdfSalsHvBV8iuh5xPdcn4epwKZl4
Twu+s8LTaNK5PD3bhV3qJtlNpg+IyBAQoqk9weZcHsgaa/0tfZEeH3tIrJbBoZ+L
v///WExXCnviksBGxwk2w5iimYMcsyTVdADh/Pi8SgdinKtakxly+d0rfu0aUR2S
KFfBMaKr4bqf22PxVM5IhNxURzrGep73b18mT0kZ96yTjWpan7lOBzyx6w+2u5GK
+GIuwHGqqtoWDPxLEo9hG0JgNOCiLszNcdMGeyd3l3CXlPxp4vvMcj4LvUx7lqrs
oJ/UoPNFgPW2SfJNSagluvlIcqMzkFADLu7pfF15QoHJQsR2gNcoFn6xLq4E08WM
0Igcyxn9+42Gkl5troeGnt0DOgMF4SzFATXg70263GwXELqLBHB6DYPBrugLmdCx
XBhPGh9PAy/mT3wJ1qEVlAQCAl7vY5jI0E6ZBl1ljLcQM9x1YQZ3sJhPlOgcqMCB
bERByGDx3DMls5/eWFwohPbVV2kG6xpDfvhW2ZLF1IP/+DHNyD/phyZZr9sPS164
d7/eYEWL63qWCt1MR3AlXO37UDIRQ15kdcPuK9QCvR+nC/ULPqAGB50KeDe7YyLH
fBuVMTq84RA9M1pCYCRy
=W5lv
-END PGP SIGNATURE-

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



Re: Tomcat DS question

2016-05-17 Thread pradeep reddy
Thanks for response, would you know if there is any recommended dbcp jar
that we need to use for Oracle 12 and Tomcat 6 ?

Thanks
Pradeep

On Tue, May 17, 2016 at 11:07 AM, Woonsan Ko  wrote:

> Hi Pradeep,
>
> I saw you had Oracle specific settings such as
> connectionCachingEnabled. So, maybe you're using Oracle specific
> DataSourceFactory instead of the default dbcp one.
> As far as I know, the default factory
> (org.apache...BasicDataSourceFactory) can be overridden by either
> factory attribute in the  element or
> javax.sql.DataSource.Factory system property.
> In that case, it might be an issue around the custom factory
> implementation, not tomcat.
>
> Regards,
>
> Woonsan
>
>
> On Mon, May 16, 2016 at 6:54 PM, pradeep reddy 
> wrote:
> > Hello Woonsan,
> >Via Jconsole I had validated all my changes that were made in
> > context.xml. But for some reason the logs doesn't show anything about
> > abandoned connections in catalina.out. I am not sure at this time if its
> a
> > bug in tomcat 6 or tomcat-dbcp.jar, but threaddumps clearly show that
> > threads are waiting on connections from connection pool.
> >
> > Thanks
> > Pradeep
> >
> > On Mon, May 16, 2016 at 4:38 PM, Woonsan Ko  wrote:
> >
> >> Hi Pradeep,
> >>
> >> Just in case, you might want to make sure your changes were really
> >> applied. For example, an effective context.xml could be in
> >> conf/Catalina/localhost/...
> >> If it was applied properly, the stack trace should have shown
> >> o.a.c.dbcp.AbandonedObjectPool#borrowObject() as well.
> >>
> >> Regards,
> >>
> >> Woonsan
> >>
> >>
> >> On Mon, May 16, 2016 at 5:54 PM, pradeep reddy 
> >> wrote:
> >> > unfortunately it is not writing anything catalina.out :-(
> >> >
> >> > Thanks
> >> > Pradeep
> >> >
> >> > On Mon, May 16, 2016 at 3:47 PM, Christopher Schultz <
> >> > ch...@christopherschultz.net> wrote:
> >> >
> >> >> -BEGIN PGP SIGNED MESSAGE-
> >> >> Hash: SHA256
> >> >>
> >> >> Pradeep,
> >> >>
> >> >> On 5/16/16 5:13 PM, pradeep reddy wrote:
> >> >> > Hello Christopher,
> >> >> >
> >> >> > Let me post my thread dump here.
> >> >> >
> >> >> > All  HTTP threads are in WAITING state.
> >> >> >
> >> >> > "http-12453-346" daemon prio=10 tid=0x7fbd3061f800 nid=0x59d0
> >> >> > in Object.wait() [0x7fbbe124f000] java.lang.Thread.State:
> >> >> > WAITING (on object monitor) at java.lang.Object.wait(Native
> >> >> > Method) at java.lang.Object.wait(Object.java:485) at
> >> >> >
> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(Generi
> >> >> cObjectPool.java:1104)
> >> >> >
> >> >> >
> >> >> - - locked <0x00072b18f320> (a
> >> >> > org.apache.tomcat.dbcp.pool.impl.GenericObjectPool$Latch) at
> >> >> >
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDat
> >> >> aSource.java:106)
> >> >> >
> >> >> >
> >> >> at
> >> >>
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
> >> >> e.java:1044)
> >> >> > at
> >> >> >
> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.g
> >> >> etConnection(LocalDataSourceConnectionProvider.java:82)
> >> >>
> >> >> Yep,
> >> >> >
> >> >> that certainly looks like you are waiting for connections from
> >> >> Tomcat's DBCP-based pool.
> >> >>
> >> >> >  >> >> > type="javax.sql.DataSource"
> >> >> > driverClassName="oracle.jdbc.OracleDriver" url="XXX"
> >> >> > username="XX" password="XX" initialSize="1" maxActive="10"
> >> >> > minIdle="1" maxIdle="1" connectionCachingEnabled="true"
> >> >> > fastConnectionFailoverEnabled="true"
> >> >> > connectionCacheProperties="{MinLimit=1, MaxLimit=20,
> >> >> > InitialLimit=1, oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR=3000}"
> >> >> > ONSConfiguration="nodes=X" validationQuery="SELECT 1 from
> >> >> > DUAL" removeAbandoned="true" removeAbandonedTimeout="30"
> >> >> > logAbandoned="true" maxWait="-1"/>
> >> >>
> >> >> That configuration looks okay to me.
> >> >>
> >> >> The "abandoned" logs are logged to stdout, so they should show up in
> >> >> your catalina.out file (or stdout.log if you are using a Windows
> Service
> >> >> ).
> >> >>
> >> >> Are you getting no messages about the abandoned connections?
> >> >>
> >> >> - -chris
> >> >> -BEGIN PGP SIGNATURE-
> >> >> Comment: GPGTools - http://gpgtools.org
> >> >> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> >> >>
> >> >> iQIcBAEBCAAGBQJXOj/gAAoJEBzwKT+lPKRYFVQP/RJKOl0QoU8/qcgMBtdrqwbr
> >> >> gddAEbqeDVT4nb8Bp/MWpWEoICBr75IGMgSir+qKASwTKXNsORceyxcSn+YxRJnK
> >> >> POZgIZfwti4vLYMBr9jU1kdUsxCGriettcBZ8pkwJAAtyVX9O0lZiwEZuCp7WwA5
> >> >> sbatkYHNtJQsjxQli1XA6NPNjQBS6y+WuQZQ0e/mf3CJUq9Rqa0uvsgAOK9XQTDB
> >> >> HBNfhF1sjIFy2ro5Vb6OagRHB+9CBxc01gM8V2d37hrbqmUVpiE4pKqO2sWZ6cz5
> >> >> yCwSBEcxyNKvDoeP2kz/1HGIhSwB7ifV1zkbhgZaB5eQZVZZubXVcdwgmRMswUgl
> >> >> RtzqCPF6rOHkgccoe5IqZLb89pQITibz6G3xTAoHhcvh2m7bADAkoN9Jq88DxUqT
> >> >> 

Re: Tomcat DS question

2016-05-17 Thread Woonsan Ko
Hi Pradeep,

I saw you had Oracle specific settings such as
connectionCachingEnabled. So, maybe you're using Oracle specific
DataSourceFactory instead of the default dbcp one.
As far as I know, the default factory
(org.apache...BasicDataSourceFactory) can be overridden by either
factory attribute in the  element or
javax.sql.DataSource.Factory system property.
In that case, it might be an issue around the custom factory
implementation, not tomcat.

Regards,

Woonsan


On Mon, May 16, 2016 at 6:54 PM, pradeep reddy  wrote:
> Hello Woonsan,
>Via Jconsole I had validated all my changes that were made in
> context.xml. But for some reason the logs doesn't show anything about
> abandoned connections in catalina.out. I am not sure at this time if its a
> bug in tomcat 6 or tomcat-dbcp.jar, but threaddumps clearly show that
> threads are waiting on connections from connection pool.
>
> Thanks
> Pradeep
>
> On Mon, May 16, 2016 at 4:38 PM, Woonsan Ko  wrote:
>
>> Hi Pradeep,
>>
>> Just in case, you might want to make sure your changes were really
>> applied. For example, an effective context.xml could be in
>> conf/Catalina/localhost/...
>> If it was applied properly, the stack trace should have shown
>> o.a.c.dbcp.AbandonedObjectPool#borrowObject() as well.
>>
>> Regards,
>>
>> Woonsan
>>
>>
>> On Mon, May 16, 2016 at 5:54 PM, pradeep reddy 
>> wrote:
>> > unfortunately it is not writing anything catalina.out :-(
>> >
>> > Thanks
>> > Pradeep
>> >
>> > On Mon, May 16, 2016 at 3:47 PM, Christopher Schultz <
>> > ch...@christopherschultz.net> wrote:
>> >
>> >> -BEGIN PGP SIGNED MESSAGE-
>> >> Hash: SHA256
>> >>
>> >> Pradeep,
>> >>
>> >> On 5/16/16 5:13 PM, pradeep reddy wrote:
>> >> > Hello Christopher,
>> >> >
>> >> > Let me post my thread dump here.
>> >> >
>> >> > All  HTTP threads are in WAITING state.
>> >> >
>> >> > "http-12453-346" daemon prio=10 tid=0x7fbd3061f800 nid=0x59d0
>> >> > in Object.wait() [0x7fbbe124f000] java.lang.Thread.State:
>> >> > WAITING (on object monitor) at java.lang.Object.wait(Native
>> >> > Method) at java.lang.Object.wait(Object.java:485) at
>> >> > org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(Generi
>> >> cObjectPool.java:1104)
>> >> >
>> >> >
>> >> - - locked <0x00072b18f320> (a
>> >> > org.apache.tomcat.dbcp.pool.impl.GenericObjectPool$Latch) at
>> >> > org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDat
>> >> aSource.java:106)
>> >> >
>> >> >
>> >> at
>> >> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
>> >> e.java:1044)
>> >> > at
>> >> > org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.g
>> >> etConnection(LocalDataSourceConnectionProvider.java:82)
>> >>
>> >> Yep,
>> >> >
>> >> that certainly looks like you are waiting for connections from
>> >> Tomcat's DBCP-based pool.
>> >>
>> >> > > >> > type="javax.sql.DataSource"
>> >> > driverClassName="oracle.jdbc.OracleDriver" url="XXX"
>> >> > username="XX" password="XX" initialSize="1" maxActive="10"
>> >> > minIdle="1" maxIdle="1" connectionCachingEnabled="true"
>> >> > fastConnectionFailoverEnabled="true"
>> >> > connectionCacheProperties="{MinLimit=1, MaxLimit=20,
>> >> > InitialLimit=1, oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR=3000}"
>> >> > ONSConfiguration="nodes=X" validationQuery="SELECT 1 from
>> >> > DUAL" removeAbandoned="true" removeAbandonedTimeout="30"
>> >> > logAbandoned="true" maxWait="-1"/>
>> >>
>> >> That configuration looks okay to me.
>> >>
>> >> The "abandoned" logs are logged to stdout, so they should show up in
>> >> your catalina.out file (or stdout.log if you are using a Windows Service
>> >> ).
>> >>
>> >> Are you getting no messages about the abandoned connections?
>> >>
>> >> - -chris
>> >> -BEGIN PGP SIGNATURE-
>> >> Comment: GPGTools - http://gpgtools.org
>> >> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>> >>
>> >> iQIcBAEBCAAGBQJXOj/gAAoJEBzwKT+lPKRYFVQP/RJKOl0QoU8/qcgMBtdrqwbr
>> >> gddAEbqeDVT4nb8Bp/MWpWEoICBr75IGMgSir+qKASwTKXNsORceyxcSn+YxRJnK
>> >> POZgIZfwti4vLYMBr9jU1kdUsxCGriettcBZ8pkwJAAtyVX9O0lZiwEZuCp7WwA5
>> >> sbatkYHNtJQsjxQli1XA6NPNjQBS6y+WuQZQ0e/mf3CJUq9Rqa0uvsgAOK9XQTDB
>> >> HBNfhF1sjIFy2ro5Vb6OagRHB+9CBxc01gM8V2d37hrbqmUVpiE4pKqO2sWZ6cz5
>> >> yCwSBEcxyNKvDoeP2kz/1HGIhSwB7ifV1zkbhgZaB5eQZVZZubXVcdwgmRMswUgl
>> >> RtzqCPF6rOHkgccoe5IqZLb89pQITibz6G3xTAoHhcvh2m7bADAkoN9Jq88DxUqT
>> >> CqXEc/01A0AdC5zzqdGPToReLPEcaifLuAK0seGQsHIHAtOytYEY2E9rmoPtCrGp
>> >> J4AshEzNtmVT+WUc40FS1+KeabolYBk0biXZiZG/mkVEmKf1DpzPtsBGFfYvo3/i
>> >> 0IAOS4zBvluQT1xaqNO6bFJ4fyfIwyWE26FBEPWRpsju2CEg/9+uXw6YM3xYxdkc
>> >> TmTTXqp4wvfE82fb2NMGQT3Av/q2fD4Yvzt7DiyHmWL0i0BlsnWBRdJD0dogKFRK
>> >> oVun2+a1tFD7lvJnVoiu
>> >> =AHDK
>> >> -END PGP SIGNATURE-
>> >>
>> >> -
>> >> To unsubscribe, e-mail: 

Re: Tomcat 7, startup problems

2016-05-17 Thread tomcat

On 17.05.2016 18:14, Mark Thomas wrote:

On 17/05/2016 16:49, André Warnier (tomcat) wrote:

Hello experts.

What does the following mean,


The constant values are from the Java virtual machine specification and
related to new features added in Java 7.

Those errors mean that the byte scanning code (o.a.t.u.bcel, copied from
Apache Commons BCEL) doesn't know how to handle them.


and/or (better) what do we have to do to get rid of these ?


If you look at the change log for 7.0.x, you'll see Java 7 support was
first added in 7.0.30 and improved in 7.0.54.

You have a couple of options.

1. Upgrade Tomcat, ideally to the latest 7.0.x release.
2. Add those JARs to jarsToSkip in catalina.properties (assuming there
aren't any annotations in those JARs you need to scan).

Mark



Thanks, great.
Let's see now which Tomcat 7 we find nowadays in the Debian repositories..

But something puzzles me :

# java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~deb7u1)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
#

So that's the "default" java.

# /usr/share/tomcat7/bin/version.sh
Using CATALINA_BASE:   /usr/share/tomcat7
Using CATALINA_HOME:   /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME:/usr
Using CLASSPATH: 
/usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.28
Server built:   Jan 11 2016 11:40:31
Server number:  7.0.28.0
OS Name:Linux
OS Version: 3.16.0-0.bpo.4-amd64
Architecture:   amd64
JVM Version:1.7.0_75-b13
JVM Vendor: Oracle Corporation
#

And that would seem to be pointing to a different version (the -b13 at the 
end)..


While all the messages below seem to point to :
[jar:file:/opt/jdk8/jre/lib/jar!/]

Why would the Tomcat 7 JVM (1.7) go scan jars there ?

We do have a Java 8 installed on  that machine also, but as far as I know that one was 
only for Confluence, which has its own private Tomcat.


I'm a bit confused. Not that I would be surprised if some Debian links were pointing all 
over the place.


André






Note : below is only a small sample, there are hundreds of these
in-between (about 2.3 MB of logfile worth of them).


INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
May 11, 2016 2:08:18 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry
[jdk/nashorn/internal/objects/NativeString.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 15
 at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

 at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)

...
May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry
[jdk/nashorn/internal/objects/NativeDate$Constructor.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 15
 at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

...
May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry [com/sun/glass/ui/Window.class] from
Jar [jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 18
 at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

 at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)


...
May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry
[com/sun/javafx/css/StyleManager.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 18
 at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

 at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)

...
...
May 11, 2016 2:09:55 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry [javafx/stage/Screen.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 18
 at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

 at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)

 at

RE: java.lang.NoSuchMethodError: org.apache.tomcat.util.buf.ByteChunk.findByte

2016-05-17 Thread Venkata Reddy P
I tried fresh setup and it works now. Thanks to Christopher.

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: 17 May 2016 03:19
To: Tomcat Users List
Subject: Re: java.lang.NoSuchMethodError: 
org.apache.tomcat.util.buf.ByteChunk.findByte

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Venkata,

On 5/16/16 5:01 PM, Venkata Reddy P wrote:
> Hi,
> 
> I am using tomcat8.0.33 with jre1.8u91,  I am getting the following 
> errors. What I am doing wrong? java.lang.NoSuchMethodError:
> org.apache.tomcat.util.buf.ByteChunk.findByte([BIIB)
> java.lang.NoSuchMethodError:
> org.apache.catalina.connector.OutputBuffer.getContentWritten()J
> 
> 
> SEVERE: Error processing request java.lang.NoSuchMethodError:
> org.apache.tomcat.util.buf.ByteChunk.findByte([BIIB)I at
> org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:83) at
> org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:210) at
> org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAda
> pter.java:821)
>
> 
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:517)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp1
> 1Processor.java:1095)
>
> 
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoi
> nt.java:1502)
>
> 
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j
> ava:1142)
>
> 
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThr
> ead.java:61)
>
> 
at java.lang.Thread.run(Thread.java:745)
> 
> May 16, 2016 1:54:11 PM
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler
> process SEVERE: Error reading request, ignored
> java.lang.NoSuchMethodError:
> org.apache.catalina.connector.OutputBuffer.getContentWritten()J at
> org.apache.catalina.connector.Response.getContentWritten(Response.java
> :294)
>
> 
at
org.apache.catalina.connector.CoyoteAdapter.checkRecycled(CoyoteAdapter.java:704)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.recycle(AbstractHttp1
> 1Processor.java:1832)
>
> 
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.release(Http11NioProtocol.java:218)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(A
> bstractProtocol.java:771)
>
> 
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint
> .java:1458)
>
> 
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.
> java:617)
>
> 
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> at java.lang.Thread.run(Thread.java:745)
> 
> Many thanks.

It looks like you have broken your Tomcat installation. Have you overwritten 
any of the JAR file in Tomcat's lib/ directory?

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXOkBSAAoJEBzwKT+lPKRYdpsQAMC0atmwVXSLebw5q7hSsgru
ndyLNlLq0MO1WDCggdU+OgWQO/TPsijvoDKgiLpjehrn+T5dBfuAACoerzdtsRiB
BxF8wxAzFbAF51qxxkm4XrGWJqWPCzdG03+ULBeYzIFW+LszQvruS31r+xzjOPSs
e8sgAXJRcEyrkPb/l3bgiAoYoy+nbUVv+mlTQT31mG5YbsefZaquooHWzKlCXYdg
h8MNLYENX9Y5rbAll1KKQBgOHcUC2+j8yNYNPtOWiL++1ykOXL2aqvchZtB/uR5L
p6HrEpzPUKAmsttHOvSXswjky63pGoXr+HjBV9PxVV4QhV/FyCZVheFhse7++6NT
V6BwWX1XH/gHpfHu9JryiKd0+u8bChNrWds9fAMzoK20X11JZb8Yh7vx1EKtDe8k
eeAsQmjzRh0qPW/Dr2LTwFxhYANG3j5ZrUN4uStOHxXhtau/LsddN+jwmSjl1nP9
cz2heQ2nbIoblGAOj2oZH72Zeu6cR0mm0UPqfYvwXgykWyEi//YrB53Viic7+AR1
IKurQiEyDfJjLK2poCnI6PhrlHECdw3eMqtInK1dK1ZESXy7DDHjEnnei5nePqXb
M/e4ZvQXRhsIpVl6ip5MD2qhiGwZrLeC+/d7tmHMxhVMfj0mQPb71Z+MhXZ8NVL9
8+L4NxvuakTFdRk1CQdC
=HnYI
-END PGP SIGNATURE-

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



Re: Tomcat 7, startup problems

2016-05-17 Thread Mark Thomas
On 17/05/2016 16:49, André Warnier (tomcat) wrote:
> Hello experts.
> 
> What does the following mean,

The constant values are from the Java virtual machine specification and
related to new features added in Java 7.

Those errors mean that the byte scanning code (o.a.t.u.bcel, copied from
Apache Commons BCEL) doesn't know how to handle them.

> and/or (better) what do we have to do to get rid of these ?

If you look at the change log for 7.0.x, you'll see Java 7 support was
first added in 7.0.30 and improved in 7.0.54.

You have a couple of options.

1. Upgrade Tomcat, ideally to the latest 7.0.x release.
2. Add those JARs to jarsToSkip in catalina.properties (assuming there
aren't any annotations in those JARs you need to scan).

Mark



> Note : below is only a small sample, there are hundreds of these
> in-between (about 2.3 MB of logfile worth of them).
> 
> 
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
> May 11, 2016 2:08:18 PM org.apache.catalina.startup.HostConfig
> deployDirectory
> INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
> May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig
> processAnnotationsJar
> SEVERE: Unable to process Jar entry
> [jdk/nashorn/internal/objects/NativeString.class] from Jar
> [jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
> org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
> tag in constant pool: 15
> at
> org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
> 
> at
> org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)
> 
> ...
> May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig
> processAnnotationsJar
> SEVERE: Unable to process Jar entry
> [jdk/nashorn/internal/objects/NativeDate$Constructor.class] from Jar
> [jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
> org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
> tag in constant pool: 15
> at
> org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
> 
> ...
> May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig
> processAnnotationsJar
> SEVERE: Unable to process Jar entry [com/sun/glass/ui/Window.class] from
> Jar [jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
> org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
> tag in constant pool: 18
> at
> org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
> 
> at
> org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)
> 
> 
> ...
> May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig
> processAnnotationsJar
> SEVERE: Unable to process Jar entry
> [com/sun/javafx/css/StyleManager.class] from Jar
> [jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
> org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
> tag in constant pool: 18
> at
> org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
> 
> at
> org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)
> 
> ...
> ...
> May 11, 2016 2:09:55 PM org.apache.catalina.startup.ContextConfig
> processAnnotationsJar
> SEVERE: Unable to process Jar entry [javafx/stage/Screen.class] from Jar
> [jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
> org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
> tag in constant pool: 18
> at
> org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
> 
> at
> org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)
> 
> at
> org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
> 
> at
> org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
> 
> at
> org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2049)
> 
> at
> org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1931)
> 
> at
> org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1899)
> 
> at
> org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)
> 
> at
> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1281)
> 
> at
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
> 
> at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:346)
> 
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> 
> at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> 
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172)
> 
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> 

Re: Tomcat 7, startup problems

2016-05-17 Thread David kerber

On 5/17/2016 11:49 AM, André Warnier (tomcat) wrote:

Hello experts.

What does the following mean, and/or (better) what do we have to do to
get rid of these ?

Note : below is only a small sample, there are hundreds of these
in-between (about 2.3 MB of logfile worth of them).


It looks to me like you're building your jar files to a different java 
version standard than you're running them on (Java 4 vs Java 7, or some 
such thing).






INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
May 11, 2016 2:08:18 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry
[jdk/nashorn/internal/objects/NativeString.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 15
at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)

...
May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry
[jdk/nashorn/internal/objects/NativeDate$Constructor.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 15
at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

...
May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry [com/sun/glass/ui/Window.class] from
Jar [jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 18
at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)


...
May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry
[com/sun/javafx/css/StyleManager.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 18
at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)

...
...
May 11, 2016 2:09:55 PM org.apache.catalina.startup.ContextConfig
processAnnotationsJar
SEVERE: Unable to process Jar entry [javafx/stage/Screen.class] from Jar
[jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag in constant pool: 18
at
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)

at
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)

at
org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)

at
org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)

at
org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2049)

at
org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1931)

at
org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1899)

at
org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)

at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1281)

at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)

at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:346)

at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)

at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)

at
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)

at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at

Tomcat 7, startup problems

2016-05-17 Thread tomcat

Hello experts.

What does the following mean, and/or (better) what do we have to do to get rid 
of these ?

Note : below is only a small sample, there are hundreds of these in-between (about 2.3 MB 
of logfile worth of them).



INFO: Starting Servlet Engine: Apache Tomcat/7.0.28
May 11, 2016 2:08:18 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig 
processAnnotationsJar
SEVERE: Unable to process Jar entry [jdk/nashorn/internal/objects/NativeString.class] from 
Jar [jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant 
pool: 15

at 
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at 
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)
...
May 11, 2016 2:08:18 PM org.apache.catalina.startup.ContextConfig 
processAnnotationsJar
SEVERE: Unable to process Jar entry 
[jdk/nashorn/internal/objects/NativeDate$Constructor.class] from Jar 
[jar:file:/opt/jdk8/jre/lib/ext/nashorn.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant 
pool: 15

at 
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
...
May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig 
processAnnotationsJar
SEVERE: Unable to process Jar entry [com/sun/glass/ui/Window.class] from Jar 
[jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant 
pool: 18

at 
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at 
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)

...
May 11, 2016 2:08:19 PM org.apache.catalina.startup.ContextConfig 
processAnnotationsJar
SEVERE: Unable to process Jar entry [com/sun/javafx/css/StyleManager.class] from Jar 
[jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant 
pool: 18

at 
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at 
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)
...
...
May 11, 2016 2:09:55 PM org.apache.catalina.startup.ContextConfig 
processAnnotationsJar
SEVERE: Unable to process Jar entry [javafx/stage/Screen.class] from Jar 
[jar:file:/opt/jdk8/jre/lib/ext/jfxrt.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant 
pool: 18

at 
org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at 
org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:60)
at 
org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
at 
org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
	at 
org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2049)

at 
org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1931)
at 
org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1899)
at 
org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)
at 
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1281)
at 
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:346)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at 
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 

Prepared statements are not cached with XA in tomcat jdbc connection pool implementation

2016-05-17 Thread Sailaja Ravipati
Hi

I am using TomEE version Apache Tomcat Version 7.0.63. 
I have the following test program.

public static void main(String[] args) throws Exception 
{
final TransactionManager transactionManager = 
TransactionManagerFactory
.getTransactionManager();
final PoolProperties poolProperties = new PoolProperties();

SQLServerDataSource dataSource = new 
com.microsoft.sqlserver.jdbc.SQLServerDataSource();
dataSource.setUser("sa");
dataSource.setPassword("$9Lserver");

dataSource.setURL("jdbc:sqlserver://sdwivedi63ks022:1433;sendStringParametersAsUnicode=false");
dataSource.setDatabaseName("himalaya");
poolProperties.setDataSource(dataSource);

final String jdbcInterceptors = 
"org.apache.tomcat.jdbc.pool.interceptor.StatementCache(prepared=true,callable=true)";
poolProperties.setJdbcInterceptors(jdbcInterceptors);
final org.apache.tomcat.jdbc.pool.DataSource 
pooledOracleDatasource = new org.apache.tomcat.jdbc.pool.XADataSource(
poolProperties);
final javax.sql.DataSource oracleDataSource = new 
org.apache.openejb.resource.jdbc.managed.xa.ManagedXADataSource(
pooledOracleDatasource, transactionManager,

TransactionProvider.getTransactionSynchronizationRegistry());
Connection connection = oracleDataSource.getConnection();
for(int i=0; i<50; i++)
{
PreparedStatement preparedStatement = 
connection.prepareStatement("insert into MyTableNew values (" + i + ")");

System.out.println(preparedStatement.getClass().getName());
preparedStatement.execute();
preparedStatement.close();
}
connection.close();
}

If I run the above program, the output I see is:
com.sun.proxy.$Proxy11

If I just change the above program to use XA datasource, i.e.
Change the following line
SQLServerDataSource dataSource = new 
com.microsoft.sqlserver.jdbc.SQLServerDataSource();
To
SQLServerXADataSource dataSource = new 
com.microsoft.sqlserver.jdbc.SQLServerXADataSource();
The output is :
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement

So, if I use XA datasource, prepared statements are not cached. How do I log a 
defect ?

Regards,
Sailaja.


[ANN] Apache Tomcat 8.5.2 BETA available

2016-05-17 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 8.5.2 BETA.

Apache Tomcat 8.0 is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Unified Expression Language, Java
WebSocket and Java Authentication Service Provider Interface for
Containers technologies.

Apache Tomcat 8.5.x is intended to replace 8.0.x and includes new
features pulled forward from the 9.0.x branch. The notable changes since
8.5.0 include:

- Add the org.apache.catalina.servlet4preview package that can be
  used to gain early access to Servlet 4.0 features. Note that this
  package will not be present in Tomcat 9.

- Make default TLS configuration more secure

- Add direct HTTP/2 connection support

- Update the packaged version of the Tomcat Native Library to 1.2.7 to
  pick up the Windows binaries that are based on OpenSSL 1.0.2h and
  APR 1.5.2.

Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-8.5-doc/changelog.html

Downloads:
http://tomcat.apache.org/download-80.cgi

Migration guides from Apache Tomcat 5.x, 6.x, 7.x and 8.0.x:
http://tomcat.apache.org/migration.html

Enjoy!

- The Apache Tomcat team

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



Re: Policy Context not being set in tomcat 6.0.44

2016-05-17 Thread Mark Thomas
On 17/05/2016 09:41, saurabh.su...@rbs.com.INVALID wrote:
> Which Tomcat version support JACC?

http://tomcat.apache.org/whichversion.html

None.

It is currently on the "maybe" list for Tomcat 9 but it is a long way
down the priority list.

Mark

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



RE: Policy Context not being set in tomcat 6.0.44

2016-05-17 Thread Saurabh.Suman
Which Tomcat version support JACC?

SAURABH SUMAN
Software Developer 
Markets & International Banking
RBS
Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 
122002, India
Office: +91 124 6195699   |  Mobile: +91 375289 

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Tuesday, May 17, 2016 2:08 PM
To: Tomcat Users List
Subject: Re: Policy Context not being set in tomcat 6.0.44

*
" This message originates from outside our organisation. Consider carefully 
whether you should click on any links, open any attachments or reply. If in 
doubt, forward to ~ Phishing"
*

On 17/05/2016 09:32, saurabh.su...@rbs.com.INVALID wrote:
> I tried with Tomcat 7.0.69 (Window 64 bit) , but still getting same output 
> i.e. 
> 
> PolicyContext.getContextID(), it is returning null and
> PolicyContext.getHandlerKeys() returning Blank array.

Tomcat 7 doesn't support JACC either.

Mark

> 
> SAURABH SUMAN
> Software Developer
> Markets & International Banking
> RBS
> Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 
> 122002, India
> Office: +91 124 6195699   |  Mobile: +91 375289 
> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org]
> Sent: Tuesday, May 17, 2016 1:43 PM
> To: Tomcat Users List
> Subject: Re: Policy Context not being set in tomcat 6.0.44
> 
> *
> " This message originates from outside our organisation. Consider carefully 
> whether you should click on any links, open any attachments or reply. If in 
> doubt, forward to ~ Phishing"
> *
> 
> On 17/05/2016 08:56, saurabh.su...@rbs.com.INVALID wrote:
>> Hi All
>>
>> I am using Apache-Tomcat version: 6.0.44 and my and OS is window 10.My Java 
>> version in jdk1.6.0_45.
>>  I am using Jaas Realm for Authentication. My authentication is working well 
>> but when I tried to get HttpServletRequest object from 
>> javax.security.jacc.PolicyContext in login() method of my Custom Login class 
>> which extends javax.security.auth.spi.LoginModule by below code:
>>
>> HttpServletRequest request = (HttpServletRequest)
>> PolicyContext.getContext("javax.servlet.http.HttpServletRequest")
>>
>>
>> , I am getting below error:
>>
>> "javax.security.auth.login.LoginException: 
>> java.lang.IllegalArgumentException: unknown handler key at 
>> javax.security.jacc.PolicyContext.getContext(PolicyContext.java:311)"
>>
>> When I printed PolicyContext.getContextID(), it is returning null and
>> PolicyContext.getHandlerKeys() returning Blank array.
>>
>> I have already set jaas.config and configuration in context.xml. My question 
>> is : Do I need to set PolicyContext explicitly in Tomcat ? If yes , how?
> 
> Tomcat 6 doesn't implement JACC.
> 
> Mark
> 
> 
>>
>>
>>
>>   
>>   javax.servlet
>>   javax.servlet-api
>>   3.0.1
>>   provided
>>
>>
>>   
>> javax.security.jacc
>> javax.security.jacc-api
>> 1.4
>> 
>>
>>
>> SAURABH SUMAN
>> Software Developer
>> Markets & International Banking
>> RBS
>> Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, 
>> Haryana, 122002, India
>> Office: +91 124 6195699  |  Mobile: +91 375289
>>
>> *
>> *
>> * The Royal Bank of Scotland plc. Registered in Scotland 
>> No 90312.
>> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
>> Authorised by the Prudential Regulation Authority and regulated by 
>> the Financial Conduct Authority and Prudential Regulation Authority.
>> The Royal Bank of Scotland N.V. is authorised and regulated by the De 
>> Nederlandsche Bank and has its seat at Amsterdam, the Netherlands, 
>> and is registered in the Commercial Register under number 33002587.
>> Registered Office: Gustav Mahlerlaan 350, Amsterdam, The Netherlands. 
>> The Royal Bank of Scotland N.V. and The Royal Bank of Scotland plc 
>> are authorised to act as agent for each other in certain jurisdictions.
>>   
>> This e-mail message is confidential and for use by the addressee only. 
>> If the message is received by anyone other than the addressee, please 
>> return the message to the sender by replying to it and then delete 
>> the message from your computer. Internet e-mails are not necessarily 
>> secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
>> N.V. including its affiliates ("RBS group") does not accept 
>> responsibility for changes made to this message after it was sent. 
>> For the protection of RBS group and its clients and customers, and in 
>> compliance with regulatory requirements, the contents of both 
>> incoming and outgoing e-mail communications, which could include 
>> proprietary information and Non-Public Personal Information, may be 
>> read by authorised persons within RBS group 

Re: Policy Context not being set in tomcat 6.0.44

2016-05-17 Thread Mark Thomas
On 17/05/2016 09:32, saurabh.su...@rbs.com.INVALID wrote:
> I tried with Tomcat 7.0.69 (Window 64 bit) , but still getting same output 
> i.e. 
> 
> PolicyContext.getContextID(), it is returning null 
> and
> PolicyContext.getHandlerKeys() returning Blank array.

Tomcat 7 doesn't support JACC either.

Mark

> 
> SAURABH SUMAN
> Software Developer 
> Markets & International Banking
> RBS
> Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 
> 122002, India
> Office: +91 124 6195699   |  Mobile: +91 375289 
> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org] 
> Sent: Tuesday, May 17, 2016 1:43 PM
> To: Tomcat Users List
> Subject: Re: Policy Context not being set in tomcat 6.0.44
> 
> *
> " This message originates from outside our organisation. Consider carefully 
> whether you should click on any links, open any attachments or reply. If in 
> doubt, forward to ~ Phishing"
> *
> 
> On 17/05/2016 08:56, saurabh.su...@rbs.com.INVALID wrote:
>> Hi All
>>
>> I am using Apache-Tomcat version: 6.0.44 and my and OS is window 10.My Java 
>> version in jdk1.6.0_45.
>>  I am using Jaas Realm for Authentication. My authentication is working well 
>> but when I tried to get HttpServletRequest object from 
>> javax.security.jacc.PolicyContext in login() method of my Custom Login class 
>> which extends javax.security.auth.spi.LoginModule by below code:
>>
>> HttpServletRequest request = (HttpServletRequest) 
>> PolicyContext.getContext("javax.servlet.http.HttpServletRequest")
>>
>>
>> , I am getting below error:
>>
>> "javax.security.auth.login.LoginException: 
>> java.lang.IllegalArgumentException: unknown handler key at 
>> javax.security.jacc.PolicyContext.getContext(PolicyContext.java:311)"
>>
>> When I printed PolicyContext.getContextID(), it is returning null and
>> PolicyContext.getHandlerKeys() returning Blank array.
>>
>> I have already set jaas.config and configuration in context.xml. My question 
>> is : Do I need to set PolicyContext explicitly in Tomcat ? If yes , how?
> 
> Tomcat 6 doesn't implement JACC.
> 
> Mark
> 
> 
>>
>>
>>
>>   
>>   javax.servlet
>>   javax.servlet-api
>>   3.0.1
>>   provided
>>
>>
>>   
>> javax.security.jacc
>> javax.security.jacc-api
>> 1.4
>> 
>>
>>
>> SAURABH SUMAN
>> Software Developer
>> Markets & International Banking
>> RBS
>> Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, 
>> Haryana, 122002, India
>> Office: +91 124 6195699  |  Mobile: +91 375289
>>
>> **
>> * The Royal Bank of Scotland plc. Registered in Scotland 
>> No 90312.
>> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
>> Authorised by the Prudential Regulation Authority and regulated by the 
>> Financial Conduct Authority and Prudential Regulation Authority.
>> The Royal Bank of Scotland N.V. is authorised and regulated by the De 
>> Nederlandsche Bank and has its seat at Amsterdam, the Netherlands, and 
>> is registered in the Commercial Register under number 33002587. 
>> Registered Office: Gustav Mahlerlaan 350, Amsterdam, The Netherlands. 
>> The Royal Bank of Scotland N.V. and The Royal Bank of Scotland plc are 
>> authorised to act as agent for each other in certain jurisdictions.
>>   
>> This e-mail message is confidential and for use by the addressee only. 
>> If the message is received by anyone other than the addressee, please 
>> return the message to the sender by replying to it and then delete the 
>> message from your computer. Internet e-mails are not necessarily 
>> secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
>> N.V. including its affiliates ("RBS group") does not accept 
>> responsibility for changes made to this message after it was sent. For 
>> the protection of RBS group and its clients and customers, and in 
>> compliance with regulatory requirements, the contents of both incoming 
>> and outgoing e-mail communications, which could include proprietary 
>> information and Non-Public Personal Information, may be read by 
>> authorised persons within RBS group other than the intended recipient(s).
>>
>> Whilst all reasonable care has been taken to avoid the transmission of 
>> viruses, it is the responsibility of the recipient to ensure that the 
>> onward transmission, opening or use of this message and any 
>> attachments will not adversely affect its systems or data. No 
>> responsibility is accepted by the RBS group in this regard and the 
>> recipient should carry out such virus and other checks as it considers 
>> appropriate.
>>
>> Visit our website at www.rbs.com
>> **
>> *
>>
> 
> 
> -
> To unsubscribe, e-mail: 

RE: Policy Context not being set in tomcat 6.0.44

2016-05-17 Thread Saurabh.Suman
I tried with Tomcat 7.0.69 (Window 64 bit) , but still getting same output i.e. 

PolicyContext.getContextID(), it is returning null 
and
PolicyContext.getHandlerKeys() returning Blank array.

SAURABH SUMAN
Software Developer 
Markets & International Banking
RBS
Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 
122002, India
Office: +91 124 6195699   |  Mobile: +91 375289 
-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Tuesday, May 17, 2016 1:43 PM
To: Tomcat Users List
Subject: Re: Policy Context not being set in tomcat 6.0.44

*
" This message originates from outside our organisation. Consider carefully 
whether you should click on any links, open any attachments or reply. If in 
doubt, forward to ~ Phishing"
*

On 17/05/2016 08:56, saurabh.su...@rbs.com.INVALID wrote:
> Hi All
> 
> I am using Apache-Tomcat version: 6.0.44 and my and OS is window 10.My Java 
> version in jdk1.6.0_45.
>  I am using Jaas Realm for Authentication. My authentication is working well 
> but when I tried to get HttpServletRequest object from 
> javax.security.jacc.PolicyContext in login() method of my Custom Login class 
> which extends javax.security.auth.spi.LoginModule by below code:
> 
> HttpServletRequest request = (HttpServletRequest) 
> PolicyContext.getContext("javax.servlet.http.HttpServletRequest")
> 
> 
> , I am getting below error:
> 
> "javax.security.auth.login.LoginException: 
> java.lang.IllegalArgumentException: unknown handler key at 
> javax.security.jacc.PolicyContext.getContext(PolicyContext.java:311)"
> 
> When I printed PolicyContext.getContextID(), it is returning null and
> PolicyContext.getHandlerKeys() returning Blank array.
> 
> I have already set jaas.config and configuration in context.xml. My question 
> is : Do I need to set PolicyContext explicitly in Tomcat ? If yes , how?

Tomcat 6 doesn't implement JACC.

Mark


> 
> 
> 
>   
>   javax.servlet
>   javax.servlet-api
>   3.0.1
>   provided
>
> 
>   
> javax.security.jacc
> javax.security.jacc-api
> 1.4
> 
> 
> 
> SAURABH SUMAN
> Software Developer
> Markets & International Banking
> RBS
> Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, 
> Haryana, 122002, India
> Office: +91 124 6195699  |  Mobile: +91 375289
> 
> **
> * The Royal Bank of Scotland plc. Registered in Scotland 
> No 90312.
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
> Authorised by the Prudential Regulation Authority and regulated by the 
> Financial Conduct Authority and Prudential Regulation Authority.
> The Royal Bank of Scotland N.V. is authorised and regulated by the De 
> Nederlandsche Bank and has its seat at Amsterdam, the Netherlands, and 
> is registered in the Commercial Register under number 33002587. 
> Registered Office: Gustav Mahlerlaan 350, Amsterdam, The Netherlands. 
> The Royal Bank of Scotland N.V. and The Royal Bank of Scotland plc are 
> authorised to act as agent for each other in certain jurisdictions.
>   
> This e-mail message is confidential and for use by the addressee only. 
> If the message is received by anyone other than the addressee, please 
> return the message to the sender by replying to it and then delete the 
> message from your computer. Internet e-mails are not necessarily 
> secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
> N.V. including its affiliates ("RBS group") does not accept 
> responsibility for changes made to this message after it was sent. For 
> the protection of RBS group and its clients and customers, and in 
> compliance with regulatory requirements, the contents of both incoming 
> and outgoing e-mail communications, which could include proprietary 
> information and Non-Public Personal Information, may be read by 
> authorised persons within RBS group other than the intended recipient(s).
> 
> Whilst all reasonable care has been taken to avoid the transmission of 
> viruses, it is the responsibility of the recipient to ensure that the 
> onward transmission, opening or use of this message and any 
> attachments will not adversely affect its systems or data. No 
> responsibility is accepted by the RBS group in this regard and the 
> recipient should carry out such virus and other checks as it considers 
> appropriate.
> 
> Visit our website at www.rbs.com
> **
> *
> 


-
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 

[ANN] Apache Tomcat 9.0.0.M6 available

2016-05-17 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 9.0.0.M6.

Apache Tomcat 9 is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Unified Expression Language, Java
WebSocket and JASPIC technologies.

Apache Tomcat 9.0.0.M6 is a milestone release of the 9.0.x branch and
has been made to provide users with early access to the new features in
Apache Tomcat 9.0.x so that they may provide feedback. The notable
changes compared to 9.0.0.M4 include:

- Add direct HTTP/2 connection support

- Update the implementation of the the proposed Servlet 4.0 API to
  provide mapping type information for the current request to reflect
  discussions within the EG.

- Update the packaged version of the Tomcat Native Library to 1.2.7 to
  pick up the Windows binaries that are based on OpenSSL 1.0.2h and APR
  1.5.2.

- Improve default configuration for TLS connectors.

Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-9.0-doc/changelog.html

Downloads:
http://tomcat.apache.org/download-90.cgi

Migration guides from Apache Tomcat 5.x, 6.x, 7.x and 8.x:
http://tomcat.apache.org/migration.html

Enjoy!

- The Apache Tomcat team

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



Re: Policy Context not being set in tomcat 6.0.44

2016-05-17 Thread Mark Thomas
On 17/05/2016 08:56, saurabh.su...@rbs.com.INVALID wrote:
> Hi All
> 
> I am using Apache-Tomcat version: 6.0.44 and my and OS is window 10.My Java 
> version in jdk1.6.0_45.
>  I am using Jaas Realm for Authentication. My authentication is working well 
> but when I tried to get HttpServletRequest object from 
> javax.security.jacc.PolicyContext in login() method of my Custom Login class 
> which extends javax.security.auth.spi.LoginModule by below code:
> 
> HttpServletRequest request = (HttpServletRequest) 
> PolicyContext.getContext("javax.servlet.http.HttpServletRequest")
> 
> 
> , I am getting below error:
> 
> "javax.security.auth.login.LoginException: 
> java.lang.IllegalArgumentException: unknown handler key at 
> javax.security.jacc.PolicyContext.getContext(PolicyContext.java:311)"
> 
> When I printed PolicyContext.getContextID(), it is returning null and
> PolicyContext.getHandlerKeys() returning Blank array.
> 
> I have already set jaas.config and configuration in context.xml. My question 
> is : Do I need to set PolicyContext explicitly in Tomcat ? If yes , how?

Tomcat 6 doesn't implement JACC.

Mark


> 
> 
> 
>   
>   javax.servlet
>   javax.servlet-api
>   3.0.1
>   provided
>
> 
>   
> javax.security.jacc
> javax.security.jacc-api
> 1.4
> 
> 
> 
> SAURABH SUMAN
> Software Developer
> Markets & International Banking
> RBS
> Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 
> 122002, India
> Office: +91 124 6195699  |  Mobile: +91 375289
> 
> ***
>  
> The Royal Bank of Scotland plc. Registered in Scotland No 90312. 
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
> Authorised by the Prudential Regulation Authority and regulated 
> by the Financial Conduct Authority and Prudential Regulation Authority. 
> The Royal Bank of Scotland N.V. is authorised and regulated by the 
> De Nederlandsche Bank and has its seat at Amsterdam, the 
> Netherlands, and is registered in the Commercial Register under 
> number 33002587. Registered Office: Gustav Mahlerlaan 350, 
> Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and 
> The Royal Bank of Scotland plc are authorised to act as agent for each 
> other in certain jurisdictions. 
>   
> This e-mail message is confidential and for use by the addressee only. 
> If the message is received by anyone other than the addressee, please 
> return the message to the sender by replying to it and then delete the 
> message from your computer. Internet e-mails are not necessarily 
> secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
> N.V. including its affiliates ("RBS group") does not accept responsibility 
> for changes made to this message after it was sent. For the protection
> of RBS group and its clients and customers, and in compliance with
> regulatory requirements, the contents of both incoming and outgoing
> e-mail communications, which could include proprietary information and
> Non-Public Personal Information, may be read by authorised persons
> within RBS group other than the intended recipient(s). 
> 
> Whilst all reasonable care has been taken to avoid the transmission of 
> viruses, it is the responsibility of the recipient to ensure that the onward 
> transmission, opening or use of this message and any attachments will 
> not adversely affect its systems or data. No responsibility is accepted 
> by the RBS group in this regard and the recipient should carry out such 
> virus and other checks as it considers appropriate. 
> 
> Visit our website at www.rbs.com 
> ***
>   
> 


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



Re: Tomcat Maven Plugin release?

2016-05-17 Thread Konstantin Welke
Hi!

I have the same issue here. We currently use 2.3-SNAPSHOT but would much prefer 
to have a stable 2.3...

Thanks in advance!

Cheers,
Konstantin Welke

On 04/04/16 09:04, "Magnus Skoglund"  wrote:

>I have found that the current release 2.2 is not working for me, and there
>are two issues that have been fixed in trunk development, that fixes the
>problems I encounter. I have built the trunk version (2.3-SNAPSHOT) plugin
>locally, and that works fine for me.
>
>I prefer not to use SNAPSHOT, and I would not like to do a local fork of
>the project.
>
>Has anyone knowledge of the upcoming release plan for the Tomcat Maven
>Plugin project?



Policy Context not being set in tomcat 6.0.44

2016-05-17 Thread Saurabh.Suman
Hi All

I am using Apache-Tomcat version: 6.0.44 and my and OS is window 10.My Java 
version in jdk1.6.0_45.
 I am using Jaas Realm for Authentication. My authentication is working well 
but when I tried to get HttpServletRequest object from 
javax.security.jacc.PolicyContext in login() method of my Custom Login class 
which extends javax.security.auth.spi.LoginModule by below code:

HttpServletRequest request = (HttpServletRequest) 
PolicyContext.getContext("javax.servlet.http.HttpServletRequest")


, I am getting below error:

"javax.security.auth.login.LoginException: java.lang.IllegalArgumentException: 
unknown handler key at 
javax.security.jacc.PolicyContext.getContext(PolicyContext.java:311)"

When I printed PolicyContext.getContextID(), it is returning null and
PolicyContext.getHandlerKeys() returning Blank array.

I have already set jaas.config and configuration in context.xml. My question is 
: Do I need to set PolicyContext explicitly in Tomcat ? If yes , how?



  
  javax.servlet
  javax.servlet-api
  3.0.1
  provided
   

  
javax.security.jacc
javax.security.jacc-api
1.4



SAURABH SUMAN
Software Developer
Markets & International Banking
RBS
Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 
122002, India
Office: +91 124 6195699  |  Mobile: +91 375289

***
 
The Royal Bank of Scotland plc. Registered in Scotland No 90312. 
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised by the Prudential Regulation Authority and regulated 
by the Financial Conduct Authority and Prudential Regulation Authority. 
The Royal Bank of Scotland N.V. is authorised and regulated by the 
De Nederlandsche Bank and has its seat at Amsterdam, the 
Netherlands, and is registered in the Commercial Register under 
number 33002587. Registered Office: Gustav Mahlerlaan 350, 
Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and 
The Royal Bank of Scotland plc are authorised to act as agent for each 
other in certain jurisdictions. 
  
This e-mail message is confidential and for use by the addressee only. 
If the message is received by anyone other than the addressee, please 
return the message to the sender by replying to it and then delete the 
message from your computer. Internet e-mails are not necessarily 
secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
N.V. including its affiliates ("RBS group") does not accept responsibility 
for changes made to this message after it was sent. For the protection
of RBS group and its clients and customers, and in compliance with
regulatory requirements, the contents of both incoming and outgoing
e-mail communications, which could include proprietary information and
Non-Public Personal Information, may be read by authorised persons
within RBS group other than the intended recipient(s). 

Whilst all reasonable care has been taken to avoid the transmission of 
viruses, it is the responsibility of the recipient to ensure that the onward 
transmission, opening or use of this message and any attachments will 
not adversely affect its systems or data. No responsibility is accepted 
by the RBS group in this regard and the recipient should carry out such 
virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com 
***