db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: JPOX issues
Date Thu, 16 Mar 2006 05:09:57 GMT
Hi Erik,

I found the problem in the CompanyFactoryAbstractImpl. The  
newDentalInsurance method always returned null.

I checked in the fix.

Craig

On Mar 15, 2006, at 4:17 PM, Erik Bengtson wrote:

> Craig,
>
> Now the error (returned null) is the same for PMClass and  
> PMInterface tests. As
> I told, I don't have any idea of the cause. Calling these methods  
> outside
> Spring works.
>
> [org.apache.jdo.tck.pc.company.CompanyFactoryPMClass] returned null
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF 
> actory.instantiteUsingFactoryMethod 
> (AbstractAutowireCapableBeanFactory.java:576)
>
> [org.apache.jdo.tck.pc.company.CompanyFactoryPMInterface] returned  
> null
> 	at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF 
> actory.instantiteUsingFactoryMethod 
> (AbstractAutowireCapableBeanFactory.java:576)
>
>> The exception thrown to the caller of newInstance should be a
>> JDOUserException.
>
> fixed in CVS
>
> Quoting Craig L Russell <Craig.Russell@Sun.COM>:
>
>> Hi Erik,
>>
>> The exception thrown to the caller of newInstance should be a
>> JDOUserException.
>>
>> The bug is fixed in JDO svn.
>>
>> Craig
>>
>> On Mar 15, 2006, at 3:36 PM, Erik Bengtson wrote:
>>
>>> Thanks Craig. I was unable to find it :(
>>>
>>> With this fixed in JPOX, the issue is that the constructor of
>>> Address is
>>> protected
>>>
>>> org.springframework.beans.factory.BeanDefinitionStoreException:
>>> Factory method
>>> [public org.apache.jdo.tck.pc.company.IAddress
>>> org.apache.jdo.tck.pc.company.CompanyFactoryAbstractImpl.newAddress
>>> (long,java.lang.String,java.lang.String,java.lang.String,java.lang.S 
>>> tr
>>> ing,java.lang.String)]
>>> threw exception; nested exception is javax.jdo.JDOFatalException:
>>> java.lang.IllegalAccessException: Class
>>> org.jpox.AbstractPersistenceManager can
>>> not access a member of class org.apache.jdo.tck.pc.company.Address
>>> with
>>> modifiers "protected"
>>> javax.jdo.JDOFatalException: java.lang.IllegalAccessException: Class
>>> org.jpox.AbstractPersistenceManager can not access a member of class
>>> org.apache.jdo.tck.pc.company.Address with modifiers "protected"
>>> 	at
>>> org.jpox.AbstractPersistenceManager.newInstance
>>> (AbstractPersistenceManager.java:2329)
>>> 	at
>>> org.apache.jdo.tck.pc.company.CompanyFactoryPMClass.newAddress
>>> (CompanyFactoryPMClass.java:38)
>>> 	at
>>> org.apache.jdo.tck.pc.company.CompanyFactoryAbstractImpl.newAddress
>>> (CompanyFactoryAbstractImpl.java:46)
>>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> 	at
>>> sun.reflect.NativeMethodAccessorImpl.invoke
>>> (NativeMethodAccessorImpl.java:39)
>>> 	at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke
>>> (DelegatingMethodAccessorImpl.java:25)
>>> ...
>>>
>>>
>>> Quoting Craig L Russell <Craig.Russell@Sun.COM>:
>>>
>>>> Hi Erik,
>>>>
>>>> Sorry, I thought I had answered this but found the message in my  
>>>> "to
>>>> be sent" box.
>>>>
>>>> The instance returned from newInstance is transient. The  
>>>> application
>>>> treats the new instance just like an instance created via the  
>>>> "new PC
>>>> ()" method call. An example implementation is:
>>>>
>>>> Object newInstance(Class pcClass) {
>>>>    if (it's a persistent interface or abstract class) {
>>>>    ... construct your implementation based on metadata
>>>>    } else if  (PersistenceCapable.class.isAssignableFrom(pcClass) {
>>>>      return pc.getConstructor(new Class[ ]{}).newInstance(); //
>>>> throws if abstract class or no privileges
>>>>    } else {
>>>>    throw JDOUserException...
>>>>    }
>>>> }
>>>>
>>>> Craig
>>>>
>>>> <spec>
>>>> The following method is used to create an instance of a  
>>>> persistence-
>>>> capable interface, or of
>>>> a concrete or abstract class.
>>>> Object newInstance(Class persistenceCapable);
>>>> The parameter must be one of the following:
>>>> •an abstract class that is declared in the metadata using the class
>>>> element, or
>>>> •an interface that is declared in the metadata using the interface
>>>> element, or
>>>> •a concrete class that is declared in the metadata as persistence-
>>>> capable. In this case,
>>>> the concrete class must declare a public no-args constructor.
>>>> The returned instance is transient, and is an “instanceof” the
>>>> parameter. Applications
>>>> might use the instance via the get and set property methods and
>>>> change its life cycle
>>>> state exactly as if it were an instance of a persistence-capable
>>>> class.
>>>> In order for the newInstance method to be used, the parameter
>>>> interface must be com-
>>>> pletely mapped. For relational implementations, the interface  
>>>> must be
>>>> mapped to a table
>>>> and all persistent properties must be mapped to columns.
>>>> Additionally, interfaces that are
>>>> the targets of all relationships from persistent propertiesþ must
>>>> also be mapped. Otherwise,
>>>> JDOUserException is thrown by the newInstance method.
>>>> For interfaces and classes that use a SingleFieldIdentity as the
>>>> object-id class, if the
>>>> returned instance is subsequently made persistent, the target class
>>>> stored in the object-id
>>>> instance is the parameter of the newInstance method that created  
>>>> it.
>>>> </spec>
>>>> On Mar 15, 2006, at 1:59 PM, Erik Bengtson wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> All issues in JPOX were solved but not the ones related to the
>>>>> newInstance
>>>>> tests.
>>>>>
>>>>>> It's not clear to me in what state must be the instance  
>>>>>> created by
>>>>>> this
>>>>>> method.
>>>>>
>>>>> Can someone answer this?
>>>>>
>>>>> Quoting Erik Bengtson <erik@jpox.org>:
>>>>>
>>>>>> Craig,
>>>>>>
>>>>>> It's not clear to me in what state must be the instance  
>>>>>> created by
>>>>>> this
>>>>>> method.
>>>>>> Can you clarify?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Quoting Craig L Russell <Craig.Russell@Sun.COM>:
>>>>>>
>>>>>>> Hi Erik,
>>>>>>>
>>>>>>> On Mar 14, 2006, at 1:21 PM, Erik Bengtson wrote:
>>>>>>>
>>>>>>>> Can someone with spring understanding check JDO-327 ?
>>>>>>>
>>>>>>> Your symptom is different from mine. Have you checked in all
the
>>>>>>> code
>>>>>>> that gives you the error on pm.newInstance
>>>>>>> (IDentalInsurance.class) ?
>>>>>>>
>>>>>>>>
>>>>>>>> With me
>>>>>>>> JDO-241
>>>>>>>> JDO-246 (Issue in derby, needs workaround implemented in
JPOX)
>>>>>>>> JDO-337 (to be fixed tonight)
>>>>>>>>
>>>>>>>> Work not started
>>>>>>>> JDO-326 (abstract class support)
>>>>>>>
>>>>>>> Note that this is not abstract class support. The parameter is
a
>>>>>>> concrete class. "All the implementation has to do" is to  
>>>>>>> recognize
>>>>>>> that the parameter is PersistenceCapable, and call the
>>>>>>> jdoNewInstance
>>>>>>> () method that's enhanced into the class.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Craig
>>>>>>>>
>>>>>>>>
>>>>>>>> Quoting Craig L Russell <Craig.Russell@Sun.COM>:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I'm looking at JDO JIRA issues 241, 246, 326, 327, and
337,  
>>>>>>>>> and
>>>>>>>>> I'm
>>>>>>>>> assuming that these issues are being looked at by the
JPOX
>>>>>>>>> folks.
>>>>>>>>>
>>>>>>>>> Please correct me if there's some TCK activity needed
here.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Craig
>>>>>>>>>
>>>>>>>>> Craig Russell
>>>>>>>>> Architect, Sun Java Enterprise System http://java.sun.com/
>>>>>>>>> products/
>>>>>>>>> jdo
>>>>>>>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>>>>>>>> P.S. A good JDO? O, Gasp!
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Craig Russell
>>>>>>> Architect, Sun Java Enterprise System http://java.sun.com/
>>>>>>> products/jdo
>>>>>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>>>>>> P.S. A good JDO? O, Gasp!
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> Craig Russell
>>>> Architect, Sun Java Enterprise System http://java.sun.com/products/
>>>> jdo
>>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>>> P.S. A good JDO? O, Gasp!
>>>>
>>>>
>>>
>>>
>>>
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>
>
>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message