You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by David Forslund <fo...@mail.com> on 2005/10/04 07:00:48 UTC

Re: query error

I get the following error when trying to access a field of an element of 
a list:

[PersistentField] ERROR: while set field:
[try to set 'object value' in 'target object'
target obj class: gov.lanl.PidServer.PTrait_
target field name: values
target field type: class java.util.ArrayList
target field declared in: gov.lanl.PidServer.PTrait_
object value class: 
org.apache.ojb.broker.util.collections.RemovalAwareCollection
object value: [gov.lanl.PidServer.NameValue_@1c783c5]
]
org.apache.ojb.broker.metadata.MetadataException: IllegalAccess error 
setting field:values in object:gov.lanl.PidServer.PTrait_
2005-10-03 22:45:20,189 [Thread-2] ERROR 
gov.lanl.Database.OJBDatabaseMgr  - retrieveElements: ';' filter: 
'[state = 1, [[[values.value LIKE Forslund%, [values.name = XPN.0]], 
[values.value LIKE David%, [values.name = XPN.1]], [values.value LIKE 
W.%, [values.name = XPN.2]], [values.value LIKE Dr.%, [values.name = 
XPN.3]]], [[values.value LIKE Los Alamos National Lab%, [values.name = 
XAD.0]], [values.value LIKE Los Alamos%, [values.name = XAD.2]], 
[values.value LIKE NM%, [values.name = XAD.3]], [values.value LIKE 
87544%, [values.name = XAD.4]], [values.value LIKE US%, [values.name = 
XAD.5]]], [[values.value LIKE 01%, [values.name = XTN.0]], [values.value 
LIKE 505-555-1212%, [values.name = XTN.1]]], [[values.value LIKE 
1012011234%, [values.name = ST.0]]], [[values.value LIKE 194402018%, 
[values.name = TS.0]]], [value LIKE file:///d:/Java/netforge/dwf.gif%, 
[name = vCard/PHOTO]]]]', error: 
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.metadata.MetadataException: IllegalAccess error 
setting field:values in object:gov.lanl.PidServer.PTrait_
    at 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew.setValueFor(Unknown 
Source)
    at 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew.set(Unknown 
Source)
    at 
org.apache.ojb.broker.accesslayer.CollectionPrefetcher.associateBatched(Unknown 
Source)
    at 
org.apache.ojb.broker.accesslayer.BasePrefetcher.prefetchRelationship(Unknown 
Source)
    at 
org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(Unknown 
Source)
    at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown 
Source)
    at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown 
Source)
    at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown 
Source)
    at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown 
Source)
    at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown 
Source)
    at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown 
Source)
    at 
gov.lanl.Database.OJBDatabaseMgr.retrieveElements(OJBDatabaseMgr.java:413)

PTrait_ has a private ArrayList called values.  It contains NameValue_ 
elements which have public accessible String fields (also with get/sets) 
"name" and "value"
There are gets/sets for the Values ArrayList in PTrait_.   PTrait_ 
extends an abstract class which (partially) implements the Trait_ 
interface. 

I can't tell why I can't access the values in PTrait_.  What I'm doing 
seems consistent with one of the examples in QueryTest except for the 
inheritance aspect.  Any suggestions?

Thanks,

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: query error

Posted by David Forslund <fo...@mail.com>.
Well that was the problem.   "values" was ArrayList as indicated in the 
log I sent out.  Changing it to List seems to make it work ok now.

Thanks!

Dave
Armin Waibel wrote:

> Hi David,
>
> could it be the case that the type of 'values' is 'ArrayList' instead 
> of 'List'. OJB internally use specific collection/list implementation 
> classes.
> http://db.apache.org/ojb/docu/guides/advanced-technique.html#Manageable+Collection 
>
>
> regards,
> Armin
>
> David Forslund wrote:
>
>> Thomas Dudziak wrote:
>>
>>>
>>>> I can't tell why I can't access the values in PTrait_.  What I'm doing
>>>> seems consistent with one of the examples in QueryTest except for the
>>>> inheritance aspect.  Any suggestions?
>>>>   
>>>
>>>
>>>
>>> The IllegalAccess error suggests that you're running in an environment
>>> with a SecurityManager enabled that prevents your code from accessing
>>> private fields, eg. an application server. You can either grant your
>>> application that right (see the security manager documentation).
>>> Or you can direct OJB to make the field accessible first before using
>>> it by changing the used PersistentField implementation in
>>> OJB.properties to PersistentFieldPrivilegedImpl.
>>> Or - if the field in question has accessors - use bean access instead
>>> by changing it to PersistentFieldIntrospectorImpl or to
>>> PersistentFieldAutoProxyImpl (which uses bean access or direct
>>> (privileged) access depending on what's available).
>>>
>>> Tom
>>>
>>>
>>>  
>>>
>> I'm not running in an Application Server.  I'm running from the JVM 
>> directly from the command line. I changed to 
>> PersistentFieldPrivilegedImplNew and it still fails in the 
>> PersistentFieldDirectAccess class the same way.
>> So I'm still puzzled.
>>
>> Dave
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: query error

Posted by David Forslund <fo...@mail.com>.
There is a logical difficulty I'm having with using the idiom 
"values.value"  where values is a list and value is one of the fields in 
the elements contained
in the values list.  I want to be able to find an item which has two 
different values for "values.value" simultaneously.   However when I 
"&&" them together
they are exclusive in OJB and so I can't satisfiy both simultaneously.  
I want to be able to specify somehow that they are two different 
values.    If I could use something like "values.get(n).value"   or some 
other function in my code, it would help.  I don't want to do an "||" as 
it would give me more matches than I want.

Thanks,

Dave
Armin Waibel wrote:

> Hi David,
>
> could it be the case that the type of 'values' is 'ArrayList' instead 
> of 'List'. OJB internally use specific collection/list implementation 
> classes.
> http://db.apache.org/ojb/docu/guides/advanced-technique.html#Manageable+Collection 
>
>
> regards,
> Armin
>
> David Forslund wrote:
>
>> Thomas Dudziak wrote:
>>
>>>
>>>> I can't tell why I can't access the values in PTrait_.  What I'm doing
>>>> seems consistent with one of the examples in QueryTest except for the
>>>> inheritance aspect.  Any suggestions?
>>>>   
>>>
>>>
>>>
>>> The IllegalAccess error suggests that you're running in an environment
>>> with a SecurityManager enabled that prevents your code from accessing
>>> private fields, eg. an application server. You can either grant your
>>> application that right (see the security manager documentation).
>>> Or you can direct OJB to make the field accessible first before using
>>> it by changing the used PersistentField implementation in
>>> OJB.properties to PersistentFieldPrivilegedImpl.
>>> Or - if the field in question has accessors - use bean access instead
>>> by changing it to PersistentFieldIntrospectorImpl or to
>>> PersistentFieldAutoProxyImpl (which uses bean access or direct
>>> (privileged) access depending on what's available).
>>>
>>> Tom
>>>
>>>
>>>  
>>>
>> I'm not running in an Application Server.  I'm running from the JVM 
>> directly from the command line. I changed to 
>> PersistentFieldPrivilegedImplNew and it still fails in the 
>> PersistentFieldDirectAccess class the same way.
>> So I'm still puzzled.
>>
>> Dave
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Oracle9i BLOB

Posted by Christoph Bohl <ch...@bohl.org>.
When I try to write a DTO with a BLOB member, I get the following error -
even if the BLOB is very small.

[org.apache.ojb.broker.platforms.Oracle9iLobHandler] ERROR: Error during
temporary BLOB write
ORA-03237: Initial Extent of specified size cannot be allocated in
tablespace (TEMP)

The tablespace TEMP is really large enough.

BTW: Why does OJB 1.0.3 not raise the exception but only write an error
message to the log?

Any hint is greatly appreciated...

Best regards,
Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: query error

Posted by Armin Waibel <ar...@apache.org>.
Hi David,

could it be the case that the type of 'values' is 'ArrayList' instead of 
'List'. OJB internally use specific collection/list implementation classes.
http://db.apache.org/ojb/docu/guides/advanced-technique.html#Manageable+Collection

regards,
Armin

David Forslund wrote:
> Thomas Dudziak wrote:
> 
>>
>>> I can't tell why I can't access the values in PTrait_.  What I'm doing
>>> seems consistent with one of the examples in QueryTest except for the
>>> inheritance aspect.  Any suggestions?
>>>   
>>
>>
>> The IllegalAccess error suggests that you're running in an environment
>> with a SecurityManager enabled that prevents your code from accessing
>> private fields, eg. an application server. You can either grant your
>> application that right (see the security manager documentation).
>> Or you can direct OJB to make the field accessible first before using
>> it by changing the used PersistentField implementation in
>> OJB.properties to PersistentFieldPrivilegedImpl.
>> Or - if the field in question has accessors - use bean access instead
>> by changing it to PersistentFieldIntrospectorImpl or to
>> PersistentFieldAutoProxyImpl (which uses bean access or direct
>> (privileged) access depending on what's available).
>>
>> Tom
>>
>>
>>  
>>
> I'm not running in an Application Server.  I'm running from the JVM 
> directly from the command line. I changed to 
> PersistentFieldPrivilegedImplNew and it still fails in the 
> PersistentFieldDirectAccess class the same way.
> So I'm still puzzled.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: query error

Posted by David Forslund <fo...@mail.com>.
Thomas Dudziak wrote:

>
>>I can't tell why I can't access the values in PTrait_.  What I'm doing
>>seems consistent with one of the examples in QueryTest except for the
>>inheritance aspect.  Any suggestions?
>>    
>>
>
>The IllegalAccess error suggests that you're running in an environment
>with a SecurityManager enabled that prevents your code from accessing
>private fields, eg. an application server. You can either grant your
>application that right (see the security manager documentation).
>Or you can direct OJB to make the field accessible first before using
>it by changing the used PersistentField implementation in
>OJB.properties to PersistentFieldPrivilegedImpl.
>Or - if the field in question has accessors - use bean access instead
>by changing it to PersistentFieldIntrospectorImpl or to
>PersistentFieldAutoProxyImpl (which uses bean access or direct
>(privileged) access depending on what's available).
>
>Tom
>
>
>  
>
I'm not running in an Application Server.  I'm running from the JVM 
directly from the command line. 
I changed to PersistentFieldPrivilegedImplNew and it still fails in the 
PersistentFieldDirectAccess class the same way.
So I'm still puzzled.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: query error

Posted by Thomas Dudziak <to...@gmail.com>.
On 10/4/05, David Forslund <fo...@mail.com> wrote:
> I get the following error when trying to access a field of an element of
> a list:
>
> [PersistentField] ERROR: while set field:
> [try to set 'object value' in 'target object'
> target obj class: gov.lanl.PidServer.PTrait_
> target field name: values
> target field type: class java.util.ArrayList
> target field declared in: gov.lanl.PidServer.PTrait_
> object value class:
> org.apache.ojb.broker.util.collections.RemovalAwareCollection
> object value: [gov.lanl.PidServer.NameValue_@1c783c5]
> ]
> org.apache.ojb.broker.metadata.MetadataException: IllegalAccess error
> setting field:values in object:gov.lanl.PidServer.PTrait_
> 2005-10-03 22:45:20,189 [Thread-2] ERROR
> gov.lanl.Database.OJBDatabaseMgr  - retrieveElements: ';' filter:
> '[state = 1, [[[values.value LIKE Forslund%, [values.name = XPN.0]],
> [values.value LIKE David%, [values.name = XPN.1]], [values.value LIKE
> W.%, [values.name = XPN.2]], [values.value LIKE Dr.%, [values.name =
> XPN.3]]], [[values.value LIKE Los Alamos National Lab%, [values.name =
> XAD.0]], [values.value LIKE Los Alamos%, [values.name = XAD.2]],
> [values.value LIKE NM%, [values.name = XAD.3]], [values.value LIKE
> 87544%, [values.name = XAD.4]], [values.value LIKE US%, [values.name =
> XAD.5]]], [[values.value LIKE 01%, [values.name = XTN.0]], [values.value
> LIKE 505-555-1212%, [values.name = XTN.1]]], [[values.value LIKE
> 1012011234%, [values.name = ST.0]]], [[values.value LIKE 194402018%,
> [values.name = TS.0]]], [value LIKE file:///d:/Java/netforge/dwf.gif%,
> [name = vCard/PHOTO]]]]', error:
> org.apache.ojb.broker.PersistenceBrokerException:
> org.apache.ojb.broker.metadata.MetadataException: IllegalAccess error
> setting field:values in object:gov.lanl.PidServer.PTrait_
>     at
> org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew.setValueFor(Unknown
> Source)
>     at
> org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew.set(Unknown
> Source)
>     at
> org.apache.ojb.broker.accesslayer.CollectionPrefetcher.associateBatched(Unknown
> Source)
>     at
> org.apache.ojb.broker.accesslayer.BasePrefetcher.prefetchRelationship(Unknown
> Source)
>     at
> org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(Unknown
> Source)
>     at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> Source)
>     at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> Source)
>     at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> Source)
>     at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown
> Source)
>     at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown
> Source)
>     at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown
> Source)
>     at
> gov.lanl.Database.OJBDatabaseMgr.retrieveElements(OJBDatabaseMgr.java:413)
>
> PTrait_ has a private ArrayList called values.  It contains NameValue_
> elements which have public accessible String fields (also with get/sets)
> "name" and "value"
> There are gets/sets for the Values ArrayList in PTrait_.   PTrait_
> extends an abstract class which (partially) implements the Trait_
> interface.
>
> I can't tell why I can't access the values in PTrait_.  What I'm doing
> seems consistent with one of the examples in QueryTest except for the
> inheritance aspect.  Any suggestions?

The IllegalAccess error suggests that you're running in an environment
with a SecurityManager enabled that prevents your code from accessing
private fields, eg. an application server. You can either grant your
application that right (see the security manager documentation).
Or you can direct OJB to make the field accessible first before using
it by changing the used PersistentField implementation in
OJB.properties to PersistentFieldPrivilegedImpl.
Or - if the field in question has accessors - use bean access instead
by changing it to PersistentFieldIntrospectorImpl or to
PersistentFieldAutoProxyImpl (which uses bean access or direct
(privileged) access depending on what's available).

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org