You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Catalina Wei (JIRA)" <ji...@apache.org> on 2007/05/11 23:22:15 UTC

[jira] Created: (OPENJPA-238) Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.

Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.
------------------------------------------------------------------------------------------------

                 Key: OPENJPA-238
                 URL: https://issues.apache.org/jira/browse/OPENJPA-238
             Project: OpenJPA
          Issue Type: Bug
          Components: xml store
            Reporter: Catalina Wei


Problem reported by Ngo, Anh (full description with attachments can be found in openjpa-dev mails, subject title: xml store help?

In evaluating openJPA to use for our current project.  It works fine for our need with database.  But I am having problem with the XMLStoreManager.  I have two simple objects - Customer and User.  Customer can have multiple users.  I look at the object store in xml file.  It stored like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<extent>

    <object class="net.iss.mss.jpa.examples.remedy.Customer" oid="1" version="0">

        <field name="customerId">

            "1"

        </field>

        <field name="customerName">

            "customer1"

        </field>

        <field name="users">

            <element>

                org.apache.openjpa.util.StringId:1

            </element>

            <element>

                org.apache.openjpa.util.StringId:2

            </element>

        </field>

    </object>

</extent>

 

Shoud the Users element store User object?  The XMLStoreManager failed to load data in because it doest not know how to create this object:                org.apache.openjpa.util.StringId:1

 

Please help...




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-238) Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.

Posted by "David Wisneski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Wisneski updated OPENJPA-238:
-----------------------------------

    Attachment:     (was: XMLFileHandler.patch)

> Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-238
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-238
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: xml store
>            Reporter: Catalina Wei
>         Attachments: XMLFileHandler.java.patch
>
>
> Problem reported by Ngo, Anh (full description with attachments can be found in openjpa-dev mails, subject title: xml store help?
> In evaluating openJPA to use for our current project.  It works fine for our need with database.  But I am having problem with the XMLStoreManager.  I have two simple objects - Customer and User.  Customer can have multiple users.  I look at the object store in xml file.  It stored like this:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <extent>
>     <object class="net.iss.mss.jpa.examples.remedy.Customer" oid="1" version="0">
>         <field name="customerId">
>             "1"
>         </field>
>         <field name="customerName">
>             "customer1"
>         </field>
>         <field name="users">
>             <element>
>                 org.apache.openjpa.util.StringId:1
>             </element>
>             <element>
>                 org.apache.openjpa.util.StringId:2
>             </element>
>         </field>
>     </object>
> </extent>
>  
> Shoud the Users element store User object?  The XMLStoreManager failed to load data in because it doest not know how to create this object:                org.apache.openjpa.util.StringId:1
>  
> Please help...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-238) Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.

Posted by "Abe White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496016 ] 

Abe White commented on OPENJPA-238:
-----------------------------------

Custom id classes can have either a (Class,String) or just a String constructor.  So the patch can't just assume a (Class,String) constructor -- it has to check to see what the class has.  That's pretty ugly and still won't cover certain cases, but it'll work for this user and previous users.

If we really want to make a proper solution, we'd write out the class of the entity and the stringified oid instead of the class of the oid and the stringified oid.  Then in fromXMLString we'd check to see if relMeta uses datastore identity and if so construct a LongId from the stored entity class and string.  If not we'd use PCRegistry.newObjectId(Class,String).  We'd also need the old processing for old XML files... we could detect an old file by maybe adding a new version attribute to the top-level <extent> element -- old files will be missing the version attribute.

> Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-238
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-238
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: xml store
>            Reporter: Catalina Wei
>         Attachments: XMLFileHandler.java.patch
>
>
> Problem reported by Ngo, Anh (full description with attachments can be found in openjpa-dev mails, subject title: xml store help?
> In evaluating openJPA to use for our current project.  It works fine for our need with database.  But I am having problem with the XMLStoreManager.  I have two simple objects - Customer and User.  Customer can have multiple users.  I look at the object store in xml file.  It stored like this:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <extent>
>     <object class="net.iss.mss.jpa.examples.remedy.Customer" oid="1" version="0">
>         <field name="customerId">
>             "1"
>         </field>
>         <field name="customerName">
>             "customer1"
>         </field>
>         <field name="users">
>             <element>
>                 org.apache.openjpa.util.StringId:1
>             </element>
>             <element>
>                 org.apache.openjpa.util.StringId:2
>             </element>
>         </field>
>     </object>
> </extent>
>  
> Shoud the Users element store User object?  The XMLStoreManager failed to load data in because it doest not know how to create this object:                org.apache.openjpa.util.StringId:1
>  
> Please help...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-238) Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.

Posted by "David Wisneski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Wisneski updated OPENJPA-238:
-----------------------------------

    Attachment:     (was: XMLFileHandler.patch)

> Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-238
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-238
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: xml store
>            Reporter: Catalina Wei
>         Attachments: XMLFileHandler.java.patch
>
>
> Problem reported by Ngo, Anh (full description with attachments can be found in openjpa-dev mails, subject title: xml store help?
> In evaluating openJPA to use for our current project.  It works fine for our need with database.  But I am having problem with the XMLStoreManager.  I have two simple objects - Customer and User.  Customer can have multiple users.  I look at the object store in xml file.  It stored like this:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <extent>
>     <object class="net.iss.mss.jpa.examples.remedy.Customer" oid="1" version="0">
>         <field name="customerId">
>             "1"
>         </field>
>         <field name="customerName">
>             "customer1"
>         </field>
>         <field name="users">
>             <element>
>                 org.apache.openjpa.util.StringId:1
>             </element>
>             <element>
>                 org.apache.openjpa.util.StringId:2
>             </element>
>         </field>
>     </object>
> </extent>
>  
> Shoud the Users element store User object?  The XMLStoreManager failed to load data in because it doest not know how to create this object:                org.apache.openjpa.util.StringId:1
>  
> Please help...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-238) Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.

Posted by "David Wisneski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Wisneski updated OPENJPA-238:
-----------------------------------

    Attachment: XMLFileHandler.java.patch

Re-attach patch for OPENJPA-238

> Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-238
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-238
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: xml store
>            Reporter: Catalina Wei
>         Attachments: XMLFileHandler.java.patch
>
>
> Problem reported by Ngo, Anh (full description with attachments can be found in openjpa-dev mails, subject title: xml store help?
> In evaluating openJPA to use for our current project.  It works fine for our need with database.  But I am having problem with the XMLStoreManager.  I have two simple objects - Customer and User.  Customer can have multiple users.  I look at the object store in xml file.  It stored like this:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <extent>
>     <object class="net.iss.mss.jpa.examples.remedy.Customer" oid="1" version="0">
>         <field name="customerId">
>             "1"
>         </field>
>         <field name="customerName">
>             "customer1"
>         </field>
>         <field name="users">
>             <element>
>                 org.apache.openjpa.util.StringId:1
>             </element>
>             <element>
>                 org.apache.openjpa.util.StringId:2
>             </element>
>         </field>
>     </object>
> </extent>
>  
> Shoud the Users element store User object?  The XMLStoreManager failed to load data in because it doest not know how to create this object:                org.apache.openjpa.util.StringId:1
>  
> Please help...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-238) Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.

Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Catalina Wei updated OPENJPA-238:
---------------------------------

    Attachment: XMLFileHandler.patch

The attached patch  has been sent to Anh Ngo, and it  resolved his problem.
I need some openjpa developer to verify the patch is correct before committing this patch.

> Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-238
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-238
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: xml store
>            Reporter: Catalina Wei
>         Attachments: XMLFileHandler.patch
>
>
> Problem reported by Ngo, Anh (full description with attachments can be found in openjpa-dev mails, subject title: xml store help?
> In evaluating openJPA to use for our current project.  It works fine for our need with database.  But I am having problem with the XMLStoreManager.  I have two simple objects - Customer and User.  Customer can have multiple users.  I look at the object store in xml file.  It stored like this:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <extent>
>     <object class="net.iss.mss.jpa.examples.remedy.Customer" oid="1" version="0">
>         <field name="customerId">
>             "1"
>         </field>
>         <field name="customerName">
>             "customer1"
>         </field>
>         <field name="users">
>             <element>
>                 org.apache.openjpa.util.StringId:1
>             </element>
>             <element>
>                 org.apache.openjpa.util.StringId:2
>             </element>
>         </field>
>     </object>
> </extent>
>  
> Shoud the Users element store User object?  The XMLStoreManager failed to load data in because it doest not know how to create this object:                org.apache.openjpa.util.StringId:1
>  
> Please help...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-238) Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.

Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Catalina Wei updated OPENJPA-238:
---------------------------------

    Attachment: XMLFileHandler.patch

New patch for OPENJPA-238. The previous patch won't compile with Java1.4.2.

> Error in XMLFileHandler, failed to load field element with type org.apace.openjpa.util.StringId.
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-238
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-238
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: xml store
>            Reporter: Catalina Wei
>         Attachments: XMLFileHandler.patch, XMLFileHandler.patch
>
>
> Problem reported by Ngo, Anh (full description with attachments can be found in openjpa-dev mails, subject title: xml store help?
> In evaluating openJPA to use for our current project.  It works fine for our need with database.  But I am having problem with the XMLStoreManager.  I have two simple objects - Customer and User.  Customer can have multiple users.  I look at the object store in xml file.  It stored like this:
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <extent>
>     <object class="net.iss.mss.jpa.examples.remedy.Customer" oid="1" version="0">
>         <field name="customerId">
>             "1"
>         </field>
>         <field name="customerName">
>             "customer1"
>         </field>
>         <field name="users">
>             <element>
>                 org.apache.openjpa.util.StringId:1
>             </element>
>             <element>
>                 org.apache.openjpa.util.StringId:2
>             </element>
>         </field>
>     </object>
> </extent>
>  
> Shoud the Users element store User object?  The XMLStoreManager failed to load data in because it doest not know how to create this object:                org.apache.openjpa.util.StringId:1
>  
> Please help...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.