Re: [Resin-interest] java.lang.IllegalStateException: Connection null was not closed.

2009-07-22 Thread .pQd


 One potential source of problems might be the start/run sequence of the 
 Thread. If, for some reason, the run() method was never called then the 
 Thread's connection would never be called. The problem with this 
 theory is that I cannot think of any reason for start() to fail to call 
 run()... :).

new sample code with which i can still reproduce the problem:

http://www.copypastecode.com/7560/

i've removed unnecessary comment and added sanity check: control if thread
was executed.

sporadically i get result in stdout.log:
[06:42:55.708] start
[06:42:55.709] stop
[06:42:55.709] [06:42:55.709] {http--8080-27} Closing dangling connections. 
All connections must have a close() in a finally block.
[06:42:55.709] [06:42:55.709] Closing dangling connections.  All connections
must have a close() in a finally block.
[06:42:55.709] [06:42:55.709] {http--8080-27}
java.lang.IllegalStateException: Connection null was not closed. Connections
must have a close() in a finally block.
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.jca.UserTransactionImpl.abortTransaction(UserTransactionImpl.java:533)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:206)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:264)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:275)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.server.port.TcpConnection.handleRequests(TcpConnection.java:644)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.server.port.TcpConnection$AcceptTask.doAccept(TcpConnection.java:1311)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.server.port.TcpConnection$AcceptTask.run(TcpConnection.java:1252)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:866)
[06:42:55.709] [06:42:55.709] {http--8080-27}   at
com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:779)
[06:42:55.709] [06:42:55.709] java.lang.IllegalStateException: Connection
null was not closed. Connections must have a close() in a finally block.
[06:42:55.709]  at
com.caucho.jca.UserTransactionImpl.abortTransaction(UserTransactionImpl.java:533)
[06:42:55.709]  at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:206)
[06:42:55.709]  at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:264)
[06:42:55.709]  at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:275)
[06:42:55.709]  at
com.caucho.server.port.TcpConnection.handleRequests(TcpConnection.java:644)
[06:42:55.709]  at
com.caucho.server.port.TcpConnection$AcceptTask.doAccept(TcpConnection.java:1311)
[06:42:55.709]  at
com.caucho.server.port.TcpConnection$AcceptTask.run(TcpConnection.java:1252)
[06:42:55.709]  at
com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:866)
[06:42:55.709]  at
com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:779)
[06:42:55.710] start
[06:42:55.710] stop

rest is just:
[06:42:55.714] stop
[06:42:55.714] start
[06:42:55.715] stop
[06:42:55.715] start
[06:42:55.716] stop
[06:42:55.716] start
[06:42:55.717] stop
[06:42:55.717] start
[06:42:55.717] stop



 Just to verify that's not the problem, you could pass the DBPool as 
 parameter to the tread and perform the DBPool.getConnection() inside the 
 thread's run method, so the connection is retrieved in the same method 
 where you are sure it is going to be returned.

if i move DBPool.getConnection() inside the thread - exception still [
rarely ] occurs:
http://www.copypastecode.com/7564/

thanks for your suggestions

Pawel Kudzia

-- 
View this message in context: 
http://www.nabble.com/java.lang.IllegalStateException%3A-Connection-null-was-not-closed.-tp24593349p24600985.html
Sent from the Resin mailing list archive at Nabble.com.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] java.lang.IllegalStateException: Connection null was not closed.

2009-07-22 Thread Daniel López
.pQd escribió:
...
 Just to verify that's not the problem, you could pass the DBPool as 
 parameter to the tread and perform the DBPool.getConnection() inside the 
 thread's run method, so the connection is retrieved in the same method 
 where you are sure it is going to be returned.
 
 if i move DBPool.getConnection() inside the thread - exception still [
 rarely ] occurs:
 http://www.copypastecode.com/7564/
 
 thanks for your suggestions
 
 Pawel Kudzia

Try with this version http://www.copypastecode.com/7568/ that has the 
getConnection() call inside the run method and inside the try. If that 
still fails, I would start looking for other places where connections 
might be retrieved as getting out of that block without calling close 
should be not possible.

S!


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] java.lang.IllegalStateException: Connection null was not closed.

2009-07-22 Thread .pQd

 Try with this version http://www.copypastecode.com/7568/ that has the 
 getConnection() call inside the run method and inside the try. If that 
 still fails, I would start looking for other places where connections 
 might be retrieved as getting out of that block without calling close 
 should be not possible.

new version:
http://www.copypastecode.com/7576/

as long as connection is closed in the same thread where it's open - i do
not get exceptions.

if i try to close it in other thread - they occur [ rarely.. ]. is it
general rule that i was not aware of or some bug that i trigger in resin's
connection pool handler?

regards
Pawel Kudzia

-- 
View this message in context: 
http://www.nabble.com/java.lang.IllegalStateException%3A-Connection-null-was-not-closed.-tp24593349p24601319.html
Sent from the Resin mailing list archive at Nabble.com.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] Kernel PAE and JVM arguments

2009-07-22 Thread Mateus Pelloso
Hi,

 

I have an environment that uses resin in cluster on 3 servers. 
Users want to test the Kernel PAE, with Linux Centos and making adjustments
to the settings of the parameters of the JVM arguments, but I am in doubt
whether you can make these changes only in a server without any impact on
others, even to continue operating in cluster ? 

By using the PAE kernel is necessary to compile the resin with the
--enable-64bit?

 

Thanks,

 

Mateus

___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] Kernel PAE and JVM arguments

2009-07-22 Thread Scott Ferguson


On Jul 22, 2009, at 6:41 AM, Mateus Pelloso wrote:


Hi,

I have an environment that uses resin in cluster on 3 servers.
Users want to test the Kernel PAE, with Linux Centos and making  
adjustments to the settings of the parameters of the JVM arguments,  
but I am in doubt whether you can make these changes only in a  
server without any impact on others, even to continue operating in  
cluster ?


Each Resin server can be configured inside the server block with  
different jvm-arg values.  So you could have one server  
experimenting with PAE settings and the other servers in the cluster  
using plain settings.  I don't actually know if PAE itself requires  
any extra settings.  I'd think it would just mean using different -Xmx  
values.


-- Scott




By using the PAE kernel is necessary to compile the resin with the -- 
enable-64bit?


Thanks,

Mateus
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] java.lang.IllegalStateException: Connection null was not closed.

2009-07-22 Thread Scott Ferguson

On Jul 22, 2009, at 12:27 AM, .pQd wrote:


 Try with this version http://www.copypastecode.com/7568/ that has the
 getConnection() call inside the run method and inside the try. If  
 that
 still fails, I would start looking for other places where connections
 might be retrieved as getting out of that block without calling close
 should be not possible.

 new version:
 http://www.copypastecode.com/7576/

 as long as connection is closed in the same thread where it's open -  
 i do
 not get exceptions.

 if i try to close it in other thread - they occur [ rarely.. ]. is it
 general rule that i was not aware of or some bug that i trigger in  
 resin's
 connection pool handler?

I'm not sure it's a bug.  Resin's connection pool handler is a  
transactional pool, and transactions are tied to the thread.  So  
handing off a connection to a separate thread isn't really part of the  
pool's model.  Normally, in a multithreaded situation, you'd have a  
second thread open its own connection.

-- Scott



 regards
 Pawel Kudzia

 -- 
 View this message in context: 
 http://www.nabble.com/java.lang.IllegalStateException%3A-Connection-null-was-not-closed.-tp24593349p24601319.html
 Sent from the Resin mailing list archive at Nabble.com.



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] java.lang.IllegalStateException: Connection null was not closed.

2009-07-22 Thread .pQd


 I'm not sure it's a bug.  Resin's connection pool handler is a  
 transactional pool, and transactions are tied to the thread.  So  
 handing off a connection to a separate thread isn't really part of the  
 pool's model.  Normally, in a multithreaded situation, you'd have a  
 second thread open its own connection.

hello Scott,

thank you very much for your explanation. now i'll know!

best regards
Pawel Kudzia

-- 
View this message in context: 
http://www.nabble.com/java.lang.IllegalStateException%3A-Connection-null-was-not-closed.-tp24593349p24611510.html
Sent from the Resin mailing list archive at Nabble.com.



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


[Resin-interest] replace XMLOutputFactory implementation class in resin 3.1.8

2009-07-22 Thread Huitang Li
Hi,

I need to replace the com.caucho.xml.stream.XMLOutputFactoryImpl with woodstox 
stax implementation version, since it seems that the 
com.caucho.xml.stream.XMLStreamWriterImpl class created from 
com.caucho.xml.stream.XMLOutputFactoryImpl has bugs in it and cannot build good 
xml (I notice that one namespace in the expected xml is not defined). 

Is there a way to do such replacement in resin 3.1.8? 

I tried to put 

 system-property 
javax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory/
   system-property 
javax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory/
   system-property 
javax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory/

in resin.conf.

It did not work. Somehow the EnvironmentClassLoader for the web app still grabs 
the resin implementation of stax.

Please help.


Thanks.


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information.  Any unauthorized 
review, use, disclosure or distribution is prohibited. Nothing contained in 
this message or in any attachment shall constitute a contract or electronic 
signature under the Electronic Signatures in Global and National Commerce Act, 
any version of the Uniform Electronic Transactions Act or any other statute 
governing electronic transactions.


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] replace XMLOutputFactory implementation class in resin 3.1.8

2009-07-22 Thread Huitang Li
Those parameters are set on the command line when starting resin, and it works.

I downloaded resin 4.0.0 and found that trying to configure system properties 
in resin.xml still does not work. Maybe it is a deprecated feature already in 
resin to configure system properties with system-property element?

Thanks.



NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information.  Any unauthorized 
review, use, disclosure or distribution is prohibited. Nothing contained in 
this message or in any attachment shall constitute a contract or electronic 
signature under the Electronic Signatures in Global and National Commerce Act, 
any version of the Uniform Electronic Transactions Act or any other statute 
governing electronic transactions.

- Original Message -
From: Huitang Li h...@kpi-consulting.net
To: resin-interest@caucho.com
Sent: Wednesday, July 22, 2009 1:27:44 PM GMT -06:00 US/Canada Central
Subject: [Resin-interest] replace XMLOutputFactory implementation class in 
resin 3.1.8

Hi,

I need to replace the com.caucho.xml.stream.XMLOutputFactoryImpl with woodstox 
stax implementation version, since it seems that the 
com.caucho.xml.stream.XMLStreamWriterImpl class created from 
com.caucho.xml.stream.XMLOutputFactoryImpl has bugs in it and cannot build good 
xml (I notice that one namespace in the expected xml is not defined). 

Is there a way to do such replacement in resin 3.1.8? 

I tried to put 

 system-property 
javax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory/
   system-property 
javax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory/
   system-property 
javax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory/

in resin.conf.

It did not work. Somehow the EnvironmentClassLoader for the web app still grabs 
the resin implementation of stax.

Please help.


Thanks.


NOTICE: This e-mail message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information.  Any unauthorized 
review, use, disclosure or distribution is prohibited. Nothing contained in 
this message or in any attachment shall constitute a contract or electronic 
signature under the Electronic Signatures in Global and National Commerce Act, 
any version of the Uniform Electronic Transactions Act or any other statute 
governing electronic transactions.


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest