Re: What is the best way to view Tomcat JDBC pool properties in Tomcat 6?

2012-03-07 Thread Pid *
On 8 Mar 2012, at 02:26, hodgesz  wrote:

> In 6.0.29 we used the Spring MBeanExporter to export the Tomcat JDBC pool
> properties.
>
> We are still able to view them with this approach in JConsole and using the
> JMXProxy Servlet with Tomcat 7.
>
> However since Tomcat JDBC pool is part of Tomcat 7 are its properties
> exposed without using the Spring MBeanExporter?

Depends how you define the pool.
If you define it as a container Resource in server.xml or context.xml
then Tomcat takes care of the registration with the MBeanServer.

If you programmatically create the pool in your application then it's
up to you - which is what you're doing with Spring.


p




> --
> View this message in context: 
> http://tomcat.10.n6.nabble.com/What-is-the-best-way-to-view-Tomcat-JDBC-pool-properties-in-Tomcat-6-tp4557182p4557182.html
> Sent from the Tomcat - User mailing list archive at Nabble.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 commands, e-mail: users-h...@tomcat.apache.org



RE: Trying to compile the tomcat connector

2012-03-07 Thread Alex Samad - Yieldbroker


> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Thursday, 8 March 2012 2:31 AM
> To: Tomcat Users List
> Subject: Re: Trying to compile the tomcat connector
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Alex,
> 
> On 3/6/12 6:41 PM, Alex Samad - Yieldbroker wrote:
> > "pcre_amd64CLEAN" : cd ".\pcre" -   $(MAKE) /$(MAKEFLAGS) /F
> > ".\pcre.amd64" RECURSE=1 CLEAN +   $(MAKE) /$(MAKEFLAGS) /F
> > ".\pcre.amd64" CFG="pcre.amd64" RECURSE=1 + CLEAN cd ".."
> 
> I'm not sure about Makefiles in VS, but I don't think you can have "CLEAN" on
> a line all by itself: you should probably make your patch look like this:
> 
> > "pcre_amd64CLEAN" : cd ".\pcre" -   $(MAKE) /$(MAKEFLAGS) /F
> > ".\pcre.amd64" RECURSE=1 CLEAN +   $(MAKE) /$(MAKEFLAGS) /F
> > ".\pcre.amd64" CFG="pcre.amd64" RECURSE=1 CLEAN cd ".."
> 
> > From Failed Request tracking  on IIS
> >
> > ErrorDescription Calling LoadLibraryEx on ISAPI filter
> > "C:\YB\Shared\dev.yieldbroker.com\ajpconfig\isapi_redirect.dll"
> > failed
> 
> Any other information?
That about all I get from the IIS :(


> 
> > I tried to pull down 1.2.32 and compile it but more issues with that!
> 
> Like what?
Failed looking for jni headers... but I wanted to compile the latest version, 
because there have been patches applied to fix concurrent loading of the dll 

[snip]

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



What is the best way to view Tomcat JDBC pool properties in Tomcat 6?

2012-03-07 Thread hodgesz
In 6.0.29 we used the Spring MBeanExporter to export the Tomcat JDBC pool
properties.  

We are still able to view them with this approach in JConsole and using the
JMXProxy Servlet with Tomcat 7.  

However since Tomcat JDBC pool is part of Tomcat 7 are its properties
exposed without using the Spring MBeanExporter?

--
View this message in context: 
http://tomcat.10.n6.nabble.com/What-is-the-best-way-to-view-Tomcat-JDBC-pool-properties-in-Tomcat-6-tp4557182p4557182.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

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



Re: exception when running my struts jsp

2012-03-07 Thread Pid
On 07/03/2012 21:06, Konstantin Kolinko wrote:
> 2012/3/8 Oussama Jlassi :
>> i added my web project without the lib folder
>> i use struts 1.3.10
>> in tomcat 6 when i run
>>
>> localhost:8080/struts1/login.jsp i got
>> http://img15.hostingpics.net/pics/826740login.png
>>
>> localhost:8080/struts1/index2.jsp i got
>> http://img15.hostingpics.net/pics/192745index2.png
> 
> Your question is specific to Struts.

There was a question?  ;)


p

> You are more likely to get an
> answer on their mailing list, see STRUTS-USER here:
> 
> http://struts.apache.org/mail.html
> 
> Best regards,
> Konstantin Kolinko
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: exception when running my struts jsp

2012-03-07 Thread Konstantin Kolinko
2012/3/8 Oussama Jlassi :
> i added my web project without the lib folder
> i use struts 1.3.10
> in tomcat 6 when i run
>
> localhost:8080/struts1/login.jsp i got
> http://img15.hostingpics.net/pics/826740login.png
>
> localhost:8080/struts1/index2.jsp i got
> http://img15.hostingpics.net/pics/192745index2.png

Your question is specific to Struts. You are more likely to get an
answer on their mailing list, see STRUTS-USER here:

http://struts.apache.org/mail.html

Best regards,
Konstantin Kolinko

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



Re: tomcat6w.exe -- 32bit and 64bit versions identical?

2012-03-07 Thread André Warnier

For what it's worth :
I just added a FAQ entry on this topic, to provide somewhere to send to for a range of 
similar questions.


http://wiki.apache.org/tomcat/FAQ/Windows#Q11


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



Re: Tomcat 7.0.26 Expression Language Issue when Comparing Character Objects

2012-03-07 Thread Konstantin Kolinko
2012/3/7 Christopher Schultz :
>
> I think that's the deal: Tomcat takes the character from your object's
> property and decides that everything should be coerced to Long, then
> tries to coerce your String literal to a Long, which obviously does
> not work (there appear to be no rules for coercing String to Number
> unless the target type is BigDecimal. It seems ambiguous to me since
> there is no "otherwise" in section 1.18.3 when String is being coerced
> to something other than BigDecimal.

The "If N is BigInteger then:" line below it is misaligned.

After the BigInteger cases there is
"If N.valueOf(A) throws an exception, then error."

So Long.valueOf(A).

>
>> It seems a little crazy to have to workaround this issue. I
>> shouldn't have to change my code. This greatly increases the amount
>> of code changes and testing we have to do in order to move
>> applications from Tomcat 6 to 7. If this is a bug in Tomcat 7.0.26
>> (x64) then we may hold off on the upgrade. However, if it is not a
>> bug, then please explain to me why my original code no longer works
>> and the best practices for implementation.

A bug in implementation of ELSupport.equals(A,B),
https://issues.apache.org/bugzilla/show_bug.cgi?id=52666

Fixed in 7.0.26 and also in 6.0 with
http://svn.apache.org/viewvc?view=revision&revision=1245686

Before this change Strings were compared before numbers, contrary to the spec.

So you cannot stay on 6.0 without fixing your code.

>> I have identified 2 workarounds for this issue:
>> (1) Since it is a character, I can use the EL Function "contains" for
>> the comparison
>> 
>>  Please explain:
>>  
>>  
>> 

fn:contains, fn:startsWith are good.

It is possible to force conversion of first operand to String and then
apply '==', e.g. ${fn:trim(program.is_general_public_yn) eq 'N'}, but
that will require more operations that just calling the above
functions.


Best regards,
Konstantin Kolinko

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



Re: tomcat6w.exe -- 32bit and 64bit versions identical?

2012-03-07 Thread André Warnier

Jim Garrison wrote:

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Tuesday, March 06, 2012 12:27 PM
To: Tomcat Users List
Subject: RE: tomcat6w.exe -- 32bit and 64bit versions identical?


From: Jim Garrison [mailto:jim.garri...@troux.com]
Subject: tomcat6w.exe -- 32bit and 64bit versions identical?
The two versions of tomcat6w.exe are identical.
Is this correct?

That is correct.  The tomcat6w.exe program does not access the JVM, so it
need not match the JVM's execution mode.


Thanks. Is that a change from 6.0.20?



Not as far as I know. tomcat5/6/7w.exe is a Windows GUI program which only accesses the 
Registry, to set/modify values in it. So for this program, the type of the JVM (32/64-bit) 
doesn't matter, as it never interacts with it.


These Registry values are later read by the tomcat5/6/7.exe program, and used as 
parameters for itself and to set options for the JVM which this program starts and runs, 
as a "wrapper".  So for this second program, the type of JVM matters very much, and must 
match the type of the wrapper.


I mention 5/6/7 above to stress that the above has been true since at least 
Tomcat 5.

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



Re: tomcat6w.exe -- 32bit and 64bit versions identical?

2012-03-07 Thread Konstantin Kolinko
2012/3/7 Jim Garrison :
>> -Original Message-
>> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
>> Sent: Tuesday, March 06, 2012 12:27 PM
>> To: Tomcat Users List
>> Subject: RE: tomcat6w.exe -- 32bit and 64bit versions identical?
>>
>> > From: Jim Garrison [mailto:jim.garri...@troux.com]
>> > Subject: tomcat6w.exe -- 32bit and 64bit versions identical?
>>
>> > The two versions of tomcat6w.exe are identical.
>>
>> > Is this correct?
>>
>> That is correct.  The tomcat6w.exe program does not access the JVM, so it
>> need not match the JVM's execution mode.
>
> Thanks. Is that a change from 6.0.20?
>

from Commons Daemon.  The files are from Commons Daemon, prunsrv and
prunmgr respectively.

6.0.20 is old, as Charles noted. I do not remember exactly as well.

Best regards,
Konstantin Kolinko

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



RE: tomcat6w.exe -- 32bit and 64bit versions identical?

2012-03-07 Thread Caldarale, Charles R
> From: Jim Garrison [mailto:jim.garri...@troux.com] 
> Subject: RE: tomcat6w.exe -- 32bit and 64bit versions identical?

> > That is correct.  The tomcat6w.exe program does not access the JVM, so it
> > need not match the JVM's execution mode.

> Is that a change from 6.0.20?

No idea - that's almost two years old.  Take a look in the archives.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



RE: tomcat6w.exe -- 32bit and 64bit versions identical?

2012-03-07 Thread Jim Garrison
> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> Sent: Tuesday, March 06, 2012 12:27 PM
> To: Tomcat Users List
> Subject: RE: tomcat6w.exe -- 32bit and 64bit versions identical?
> 
> > From: Jim Garrison [mailto:jim.garri...@troux.com]
> > Subject: tomcat6w.exe -- 32bit and 64bit versions identical?
> 
> > The two versions of tomcat6w.exe are identical.
> 
> > Is this correct?
> 
> That is correct.  The tomcat6w.exe program does not access the JVM, so it
> need not match the JVM's execution mode.

Thanks. Is that a change from 6.0.20?

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



Re: Tomcat 7.0.26 Expression Language Issue when Comparing Character Objects

2012-03-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kerry,

On 3/7/12 10:59 AM, ke...@kjaklive.com wrote:
> My issue is with the Expression Language and how a Character object
> is compared to an in-line Character object in order to decide what
> content to display on the web page.
> 
> My original comparison code is as follows:  test="${program.isGeneralPublicYN == 'N'}">  

I'm not that steeped in the EL spec, but it looks like Section 1.3 in
spec 2.2 MR says that there is no such thing as a character literal:
only strings (and others):

"
Literals
There are literals for boolean, integer, floating point, string, and
null in an eval- expression.
■ Boolean - true and false
■ Integer - As defined by the IntegerLiteral construct in Section 1.19
■ Floating point - As defined by the FloatingPointLiteral construct in
Section 1.19
■ String - With single and double quotes - " is escaped as \", ' is
escaped as \',
and \ is escaped as \\. Quotes only need to be escaped in a string
value enclosed
in the same type of quote
■ Null-null
"

The grammar for EL (section 1.19) also defines "StringLiteral" to be
anything between single- or double-quotes.

What if you did something like this:


 


Or, if you can think of another way to coerce the string "N" to a
character, the spec says that coercing a String to a Character results
in the first character of the string being used.

> It doesn't make much sense that it would convert a referenced
> object, but not an in-line object of the same type. Possibly
> because in-line the compiler has a harder time differentiating a
> one-character string object and a character object?

I think that's the deal: Tomcat takes the character from your object's
property and decides that everything should be coerced to Long, then
tries to coerce your String literal to a Long, which obviously does
not work (there appear to be no rules for coercing String to Number
unless the target type is BigDecimal. It seems ambiguous to me since
there is no "otherwise" in section 1.18.3 when String is being coerced
to something other than BigDecimal.

> It seems a little crazy to have to workaround this issue. I
> shouldn't have to change my code. This greatly increases the amount
> of code changes and testing we have to do in order to move
> applications from Tomcat 6 to 7. If this is a bug in Tomcat 7.0.26
> (x64) then we may hold off on the upgrade. However, if it is not a
> bug, then please explain to me why my original code no longer works
> and the best practices for implementation.

Each version of Tomcat generally becomes more strict when it comes to
spec-compliance. That may be the case, here.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9XphEACgkQ9CaO5/Lv0PCgkACfU83Xxek0aj+kJjrC59UWHwKN
MvcAnAoSKMO7Pby0zeRylOLqdTG3wBPn
=rSTu
-END PGP SIGNATURE-

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



Re: JMX JVM bug workaround question

2012-03-07 Thread Kari Scott




On Mar 7, 2012, at 11:49 AM, Jess Holle wrote:

How can this be a "low" priority JVM bug!?!


I know. My other motive in posting this was to draw attention to it and maybe 
get some other folks to vote for it. :-)




On 3/7/2012 11:21 AM, Konstantin Kolinko wrote:
2012/3/7 Kari Scottmailto:kari.sc...@cdw.com>>:

We are using Tomcat 7.0.23 with jdk1.6.0_30 on Solaris 10, mod_ajp 1.3  and 
Apache 2.2.21.

I'm using the following code to retrieve memory information from our JMX server:


ObjectName contextObjectName = new ObjectName("java.lang:type=Memory");
CompositeData memoryUsage = 
(CompositeData)server.getAttribute(contextObjectName, "HeapMemoryUsage");


This works really well most of the time but we occasionally we get this 
exception when trying to retrieve HeapMemoryUsage:

javax.management.RuntimeMBeanException:
java.lang.IllegalArgumentException: committed = 1607688192 should be<  max = 
1607270400


After some digging, I found that it is a bug in the JVM (It occurs in 1.7, too):

 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7100266


My questions for the list then are has anyone else come across this and, if so, 
how did you get around it? Is there an alternative way for retrieving used and 
committed memory from a JMX MBean?
The issue seems like some threading issue when "max" and "committed"
memory settings are calculated independently at different moments and
fail to pass a consistency check between them.

I think I would wait a while and retry, but only once.

Do you check what Runtime.freeMemory(), Runtime.totalMemory() return
at the same time? Maybe there is so little free memory that it is
worth to worry.



Just to have our bases covered, I've added code to print free/total runtime 
memory when the error occurs. I'll let you know if this reveals anything juicy.



_
Kari Scott
Senior Programmer
kari.sc...@cdw.com

CDW
5520 Research Park Drive
Madison, WI 53711
Office: 608 298 1223
Fax: 608 288 3007








Re: JMX JVM bug workaround question

2012-03-07 Thread Jess Holle

How can this be a "low" priority JVM bug!?!

On 3/7/2012 11:21 AM, Konstantin Kolinko wrote:

2012/3/7 Kari Scott:


We are using Tomcat 7.0.23 with jdk1.6.0_30 on Solaris 10, mod_ajp 1.3  and 
Apache 2.2.21.

I'm using the following code to retrieve memory information from our JMX server:


ObjectName contextObjectName = new ObjectName("java.lang:type=Memory");
CompositeData memoryUsage = (CompositeData)server.getAttribute(contextObjectName, 
"HeapMemoryUsage");


This works really well most of the time but we occasionally we get this 
exception when trying to retrieve HeapMemoryUsage:

javax.management.RuntimeMBeanException:
java.lang.IllegalArgumentException: committed = 1607688192 should be<  max = 
1607270400


After some digging, I found that it is a bug in the JVM (It occurs in 1.7, too):

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7100266


My questions for the list then are has anyone else come across this and, if so, 
how did you get around it? Is there an alternative way for retrieving used and 
committed memory from a JMX MBean?

The issue seems like some threading issue when "max" and "committed"
memory settings are calculated independently at different moments and
fail to pass a consistency check between them.

I think I would wait a while and retry, but only once.

Do you check what Runtime.freeMemory(), Runtime.totalMemory() return
at the same time? Maybe there is so little free memory that it is
worth to worry.

Best regards,
Konstantin Kolinko

-
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: JMX JVM bug workaround question

2012-03-07 Thread Konstantin Kolinko
2012/3/7 Kari Scott :
>
>
> We are using Tomcat 7.0.23 with jdk1.6.0_30 on Solaris 10, mod_ajp 1.3  and 
> Apache 2.2.21.
>
> I'm using the following code to retrieve memory information from our JMX 
> server:
>
>
> ObjectName contextObjectName = new ObjectName("java.lang:type=Memory");
> CompositeData memoryUsage = 
> (CompositeData)server.getAttribute(contextObjectName, "HeapMemoryUsage");
>
>
> This works really well most of the time but we occasionally we get this 
> exception when trying to retrieve HeapMemoryUsage:
>
> javax.management.RuntimeMBeanException:
> java.lang.IllegalArgumentException: committed = 1607688192 should be < max = 
> 1607270400
>
>
> After some digging, I found that it is a bug in the JVM (It occurs in 1.7, 
> too):
>
>  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7100266
>
>
> My questions for the list then are has anyone else come across this and, if 
> so, how did you get around it? Is there an alternative way for retrieving 
> used and committed memory from a JMX MBean?

The issue seems like some threading issue when "max" and "committed"
memory settings are calculated independently at different moments and
fail to pass a consistency check between them.

I think I would wait a while and retry, but only once.

Do you check what Runtime.freeMemory(), Runtime.totalMemory() return
at the same time? Maybe there is so little free memory that it is
worth to worry.

Best regards,
Konstantin Kolinko

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



JMX JVM bug workaround question

2012-03-07 Thread Kari Scott


We are using Tomcat 7.0.23 with jdk1.6.0_30 on Solaris 10, mod_ajp 1.3  and 
Apache 2.2.21.

I'm using the following code to retrieve memory information from our JMX server:


ObjectName contextObjectName = new ObjectName("java.lang:type=Memory");
CompositeData memoryUsage = 
(CompositeData)server.getAttribute(contextObjectName, "HeapMemoryUsage");


This works really well most of the time but we occasionally we get this 
exception when trying to retrieve HeapMemoryUsage:

javax.management.RuntimeMBeanException:
java.lang.IllegalArgumentException: committed = 1607688192 should be < max = 
1607270400


After some digging, I found that it is a bug in the JVM (It occurs in 1.7, too):

 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7100266


My questions for the list then are has anyone else come across this and, if so, 
how did you get around it? Is there an alternative way for retrieving used and 
committed memory from a JMX MBean?

Thank you,
-Kari


_
Kari Scott
Senior Programmer
kari.sc...@cdw.com

CDW
5520 Research Park Drive
Madison, WI 53711
Office: 608 298 1223
Fax: 608 288 3007








Tomcat 7.0.26 Expression Language Issue when Comparing Character Objects

2012-03-07 Thread kerry
Hello. I have been testing a Java Web Application to upgrade from Tomcat
6.0.32 (x86) to Tomcat 7.0.26 (x64). I am using Java 6 update 31. I have
also tried pointing Tomcat 7.0.26 (x64) to Java 7 Update 3 and
experience the same issue.

Windows 7 x64
IDE is Netbeans 7.0.1
Tomcat 7.0.26 x64
Java 6 update 31
Hibernate
Spring MVC 2.5.6
JSTL 1.1

I have come across an issue with existing code in the application. This
code has been in production using Tomcat 6.0.32 (x86) for over 1 year
and has not had a problem.

My issue is with the Expression Language and how a Character object is
compared to an in-line Character object in order to decide what content
to display on the web page.

My original comparison code is as follows:

 


Where program is a Program object and isGeneralPublicYN is a char
property of the program object.

When I access this page running on Tomcat 7.0.26 (x64), I receive the
following error:
 javax.el.ELException: Cannot convert N of type class
java.lang.String to class java.lang.Long

I started looking around and found the following in section 1.8.1 of the
Expression Language Specification Version 2.2 Maintenance Release
(http://download.oracle.com/otn-pub/jcp/expression_language-2.2-mrel-eval-oth-JSpec/expression_language-2_2-mrel-spec.pdf)
=> 
A {<,>,<=,>=,lt,gt,le,ge} B
■ If A==B, if operator is <=, le, >=, or ge return true.
■ If A is null or B is null, return false
■ If A or B is BigDecimal, coerce both A and B to BigDecimal and use
the return
value of A.compareTo(B).
■ If A or B is Float or Double coerce both A and B to Double apply
operator
■ If A or B is BigInteger, coerce both A and B to BigInteger and use
the return
value of A.compareTo(B).
Chapter 1 Language Syntax and Semantics 13
■ If A or B is Byte, Short, Character, Integer, or Long coerce both A
and B to
Long and apply operator
■ If A or B is String coerce both A and B to String, compare lexically
■ If A is Comparable, then:
■ If A.compareTo(B) throws exception, error.
■ Otherwise use result of A.compareTo(B)
■ If B is Comparable, then:
■ If B.compareTo(A) throws exception, error.
■ Otherwise use result of B.compareTo(A)
■ Otherwise, error

I am particularly interested in the following line of logic:
■ If A or B is Byte, Short, Character, Integer, or Long coerce both A
and B to
Long and apply operator

The expression I am evaluating appears to meet the requirements here.
program.isGeneralPublicYN is a Character object. It is being converted
to a Long as the specification states. However, my in-line variable
('N') is not being converted to a Long, but is instead being converted
to a String.

Am I reading the specification wrong? Since program.isGeneralPublicYN is
a Character, shouldn't EL convert both sides to a Long for the
comparison? Was this implemented incorrectly in Tomcat 6.0.32 (x86) and
corrected in Tomcat 7.0.26 (x64)?

I have identified 2 workarounds for this issue:
(1) Since it is a character, I can use the EL Function "contains" for
the comparison
 
 Please explain: 
  
  
 

(2) I can pass a character to the page via the reference map in the
controller to the page and then do the comparison on that object instead
of doing it in-line

Map refData = new HashMap();

refData.put("charN", 'N');


 Please explain:
 
 


It doesn't make much sense that it would convert a referenced object,
but not an in-line object of the same type. Possibly because in-line the
compiler has a harder time differentiating a one-character string object
and a character object?

It seems a little crazy to have to workaround this issue. I shouldn't
have to change my code. This greatly increases the amount of code
changes and testing we have to do in order to move applications from
Tomcat 6 to 7. If this is a bug in Tomcat 7.0.26 (x64) then we may hold
off on the upgrade. However, if it is not a bug, then please explain to
me why my
original code no longer works and the best practices for implementation.

I appreciate your time looking into this concern and I hope to hear from
the community in the near future regarding this matter. Thank you,

--Kerry--

http://www.kjaklive.com


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



Re: [OT] Using tomcat7-maven-plugin- 2.0-beta-1: java.lang.RuntimeException: Name jdbc is not bound in this Context

2012-03-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Guofeng,

On 3/7/12 5:32 AM, Guofeng Zhang wrote:
>  name="jdbc/iviewDS" testQuery="select count(*) from T_ROLE"

You might want to use a simper testQuery (like "SELECT 1 FROM DUAL",
for instance). Some RDBMS engines don't have great performance with
"SELECT COUNT(*)" (for instance, MySQL using the InnoDB engine).

Also, does your factory generate a DataSource for which "testQuery" is
a valid property? If you are using Tomcat's standard connection poll
(DBCP's BasicDataSource) or Tomcat's "other" pool (jdbc-pool), then
the proper configuration attribute is "validationQuery".

See
http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#JDBC_Data_Sources

Specifically, step #4 under that heading.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9XhGoACgkQ9CaO5/Lv0PB7yACguvu8xlUz6Yf+MJKMqv5NH0V9
Lv0AnA+8Qyo5NUClxyAJHsfMIaaBbXXk
=K1IB
-END PGP SIGNATURE-

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



Re: Trying to compile the tomcat connector

2012-03-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alex,

On 3/6/12 6:41 PM, Alex Samad - Yieldbroker wrote:
> "pcre_amd64CLEAN" : cd ".\pcre" -   $(MAKE) /$(MAKEFLAGS) /F
> ".\pcre.amd64" RECURSE=1 CLEAN +   $(MAKE) /$(MAKEFLAGS) /F
> ".\pcre.amd64" CFG="pcre.amd64" RECURSE=1 + CLEAN cd ".."

I'm not sure about Makefiles in VS, but I don't think you can have
"CLEAN" on a line all by itself: you should probably make your patch
look like this:

> "pcre_amd64CLEAN" : cd ".\pcre" -   $(MAKE) /$(MAKEFLAGS) /F
> ".\pcre.amd64" RECURSE=1 CLEAN +   $(MAKE) /$(MAKEFLAGS) /F
> ".\pcre.amd64" CFG="pcre.amd64" RECURSE=1 CLEAN cd ".."

> From Failed Request tracking  on IIS
> 
> ErrorDescription Calling LoadLibraryEx on ISAPI filter
> "C:\YB\Shared\dev.yieldbroker.com\ajpconfig\isapi_redirect.dll"
> failed

Any other information?

> I tried to pull down 1.2.32 and compile it but more issues with
> that!

Like what?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9Xf0gACgkQ9CaO5/Lv0PDnKACguDt1VuawWPsDFRo7HHAK59pI
l6oAoMKNYfcaQwOC3FEbUAKffZzX3CoU
=B3jJ
-END PGP SIGNATURE-

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



Re: Service Temporaily Unavailbale Message and tomcat servers starts responding without a restart after few mins

2012-03-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Amol,

On 3/7/12 4:53 AM, Amol Puglia wrote:
> We are getting service temporarily unavailable message very
> frequently from our application.
> 
> We are having following versions of tomcat and apache.
> 
> Tomcat Version :- Apache Tomcat/6.0.26

Would it be possible to test with the latest Tomcat 6.0.35? There have
been a handful of improvements in AJP during the past 2 years.

> Apache Version :- 2.2.16

Are you using mod_jk or mod_proxy_ajp? If mod_proxy, what version?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9XfokACgkQ9CaO5/Lv0PBYaACfc1+PbMpl6dVrbnVwTuDaxRRT
sSEAn2KlJvMMFOTH034GDXJCYOsEkGpj
=z+1l
-END PGP SIGNATURE-

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



Re: JDBC Pool - Error handling during connection creation

2012-03-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Amit,

On 3/7/12 12:12 AM, amit shah wrote:
> I am using tomcat-jdbc.jar and tomcat-juli.jar from version
> 7.0.26.
> 
>> I don't see any place in setupConnection where an exception is 
>> swallowed, do you?
>> 
>> http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?view=markup
>
>> 
> Have a look at the public boolean validate(int
> validateAction,String sql) method in PooledConnection class line no
> - 445.

> The validate method ignores any exception which is thrown while
> validating the connection or executing the initSQL query.

If you have debug logging enabled, it will log the exception. So,
enable debug logging and try again. *shrug*

> The createConnection() method in ConnectionPool class which calls
> the validate() method returns null in such a case and hence it
> leads to a null pointer exception in setupConnection method.
> 
> Ignoring the exception in the validate() method may sound
> appropriate (not sure for what reason though) but my point is that
> it makes troubleshooting the issue a lot harder.

Just turn on debug logging and you'll see the original exception. I
think in this case, the error is quite fatal so checking for null and
emitting some other error message would only be slightly more helpful
to you, but the effect would be the same.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9XfYMACgkQ9CaO5/Lv0PBdqQCgjhbGeAQ2QU64XOrYP5VBEkF6
VkoAoL6g5gMTaYpnHvj7HZDqWT6P+qcE
=AzPZ
-END PGP SIGNATURE-

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



Re: Using tomcat7-maven-plugin- 2.0-beta-1: java.lang.RuntimeException: Name jdbc is not bound in this Context

2012-03-07 Thread Olivier Lamy
Hello
Sounds like an issue.
It will be really lovely if you could create a sample project to
reproduce that and attach it to a new issue here:
https://issues.apache.org/jira/browse/MTOMCAT

BTW does that work using a context file tru the configuration
${tomcatContextXml} (and not with a
server.xml file I mean nothing in src\main\tomcatconf ) ?


Thanks,

2012/3/7 Guofeng Zhang :
> Hi,
>
> I try tomcat7-maven-plugin/2.0-beta-1. When I use "mvn tomcat7:run" to launch 
> my app, I got:
>  javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>
> I configured the datatsource as global naming datasource in server.xml,
>  
>        auth="Container"
>       maxPoolSize="100" minPoolSize="10"
>       name="jdbc/iviewDS"
>       testQuery="select count(*) from T_ROLE"
>       factory=".."
>       type="javax.sql.DataSource"
>       uniqueResourceName="jdbc/iviewDS"/>
>
> The server.xml is copied to src\main\tomcatconf, (this also copyied by the 
> plugin to target\tomcat\conf, so it is used).
>
> then in webapp/META-INF/context.xml, I have:
>           name="jdbc/iviewDS"
>        global="jdbc/iviewDS"
>        type="javax.sql.DataSource"
>    />
>
> And in web.xml:
>                
>                                datasoruce
>                                jdbc/iviewDS
>                                javax.sql.DataSource
>                                Container
>                
> In my code, I lookup the datasource using 'java:/comp/env/jdbc/iviewDS'.
>
> This works well when I deploy the app into tomcat/app directory.
>
> How to solve the issue when use the plugin?
>
> Thanks
>
> Guofeng
>
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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



Using tomcat7-maven-plugin- 2.0-beta-1: java.lang.RuntimeException: Name jdbc is not bound in this Context

2012-03-07 Thread Guofeng Zhang
Hi,

I try tomcat7-maven-plugin/2.0-beta-1. When I use "mvn tomcat7:run" to launch 
my app, I got:
  javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

I configured the datatsource as global naming datasource in server.xml,
  


The server.xml is copied to src\main\tomcatconf, (this also copyied by the 
plugin to target\tomcat\conf, so it is used).

then in webapp/META-INF/context.xml, I have:
   

And in web.xml:

datasoruce
jdbc/iviewDS
javax.sql.DataSource
Container

In my code, I lookup the datasource using 'java:/comp/env/jdbc/iviewDS'.

This works well when I deploy the app into tomcat/app directory.

How to solve the issue when use the plugin?

Thanks

Guofeng




Service Temporaily Unavailbale Message and tomcat servers starts responding without a restart after few mins

2012-03-07 Thread Amol Puglia
Hello Team,

We are getting service temporarily unavailable message very frequently from our 
application.

We are having following versions of tomcat and apache.

Tomcat Version :- Apache Tomcat/6.0.26

Apache Version :- 2.2.16

Java Version :- jdk1.6.0_24

Whenever there is service temporarily message ,we have notice following error 
messages in the tomcat logs.

Kindly provide some guidance and let me know if further information is required.


Mar 7, 2012 7:33:02 AM org.apache.coyote.ajp.AjpMessage processHeader
SEVERE: Invalid message recieved with signature 11565
CCBDecisionCrHandler.handle()