You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Martin Kalén <mk...@apache.org> on 2005/06/07 10:02:46 UTC
Re: Problem borrowing a connection from pool
Martin Kalén wrote:
> You are running OJB in a JVM with a security policy. The security policy in
> effect does not allow OJB to programmatically change the access level of
> the ConnectionManager implementation's constructor.
>
> You will need to add something like this to your security policy:
>
> permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
Google reveals that other user's have been experiencing the same problem:
http://forum.java.sun.com/thread.jspa?messageID=3614844
...and that this seems to be OJB regression between 1.0rc4 and 1.0.1
ConnectionManagerImpl has a public constructor, why do we need to use
setAccessible? IMO it is a bad OJB pattern to use setAccessible and
allow non-public constructors to be accessed from
ConfigurableFactory#createNewInstance.
Any other developers care to comment on this on the dev-list?
I would say that ClassHelper methods using setAccessible(true) should
be removed, unless there is very good reason or major refactor effort
to prevent it.
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: Problem borrowing a connection from pool
Posted by Martin Kalén <mk...@apache.org>.
Armin Waibel wrote:
>> I would say that ClassHelper methods using setAccessible(true) should
>> be removed, unless there is very good reason or major refactor effort
>> to prevent it.
>
> +1 agree.
> All pluggable components have to had public constructors, so there is no
> need to suppress the java security police like e.g.
> ConfigurableFactory#createNewInstance it does.
OK, I will do this in both 1.0.x branch and HEAD if no-one has a specific
reason to keep it.
I'm short on "OJB-time" so ETA is end of next week, which means eveyone
can think about it without stress... :)
This will IMO be a good change since the users of J2EE-servers with
JVM security policies do not have to hack their policy to get OJB
up and running.
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: Problem borrowing a connection from pool
Posted by Armin Waibel <ar...@apache.org>.
Hi Martin,
Martin Kalén wrote:
> Martin Kalén wrote:
>
>> You are running OJB in a JVM with a security policy. The security
>> policy in
>> effect does not allow OJB to programmatically change the access level of
>> the ConnectionManager implementation's constructor.
>>
>> You will need to add something like this to your security policy:
>>
>> permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
>
>
> Google reveals that other user's have been experiencing the same problem:
> http://forum.java.sun.com/thread.jspa?messageID=3614844
>
> ...and that this seems to be OJB regression between 1.0rc4 and 1.0.1
>
>
> ConnectionManagerImpl has a public constructor, why do we need to use
> setAccessible? IMO it is a bad OJB pattern to use setAccessible and
> allow non-public constructors to be accessed from
> ConfigurableFactory#createNewInstance.
> Any other developers care to comment on this on the dev-list?
>
> I would say that ClassHelper methods using setAccessible(true) should
> be removed, unless there is very good reason or major refactor effort
> to prevent it.
>
+1 agree.
All pluggable components have to had public constructors, so there is no
need to suppress the java security police like e.g.
ConfigurableFactory#createNewInstance it does.
regards,
Armin
> Regards,
> Martin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
RE: Problem borrowing a connection from pool
Posted by Oscar Herrera S <oh...@studiocom.com>.
Hello Martin. I just wanted to thank you a lot for your help; indeed it
solved the problem,
Oscar Herrera S.
Developer
studiocom
_________
Disclaimer: This e-mail message is intended only to its recipient(s). If by
mistake you receive this e-mail please delete it and let me know. You are
not allowed to use any information contained here for yours or others
purposes, neither to reproduce the whole message or any part of it or its
attachments without my written authorization. Information contained in this
message cannot be taken as an official position from any organization the
author belongs to. All rights reserved, Oscar Herrera S. 2004. Any violation
to this disclaimer will be prosecuted to the last extent of the law.
-----Original Message-----
From: Martin Kalén [mailto:mkalen@apache.org]
Sent: Tuesday, June 07, 2005 4:03 AM
To: OJB Users List
Cc: OJB Developers List
Subject: Re: Problem borrowing a connection from pool
Martin Kalén wrote:
> You are running OJB in a JVM with a security policy. The security policy
in
> effect does not allow OJB to programmatically change the access level of
> the ConnectionManager implementation's constructor.
>
> You will need to add something like this to your security policy:
>
> permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
Google reveals that other user's have been experiencing the same problem:
http://forum.java.sun.com/thread.jspa?messageID=3614844
...and that this seems to be OJB regression between 1.0rc4 and 1.0.1
ConnectionManagerImpl has a public constructor, why do we need to use
setAccessible? IMO it is a bad OJB pattern to use setAccessible and
allow non-public constructors to be accessed from
ConfigurableFactory#createNewInstance.
Any other developers care to comment on this on the dev-list?
I would say that ClassHelper methods using setAccessible(true) should
be removed, unless there is very good reason or major refactor effort
to prevent it.
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org