Home » Support » Issue Tracking » javax.persistence.PersistenceException Attempt to store an instance of a non persistable type java.net.URL

javax.persistence.PersistenceException Attempt to store an instance of a non persistable type java.net.URL

Type: Feature requestVersion: 2.3.6Priority: NormalStatus: ClosedReplies: 4
#1

ObjectDB 2.3.6_16:

The following works in EclipseLink+MySQL and EclipseLink+Oracle:

public Link(String name, String $url) //throws MalformedURLException
    {
        this.name = name;
        try {
            url = new URL($url);
        } catch (MalformedURLException ex) {
            log_error(ex);
        }
    }

private URL url;

 

    public URL getUrl() {
        return url;
    }

    public void setUrl(URL url) {
        this.url = url;
    }

 

I can rewrite this to simply check whether it is a valid URL $url string and storing it.

I can return getURL also as transient to keep my public contract.

But it would be nice to have URLs stored directly.

 

 

 

--- Webel IT Australia, "The Elements of the Web", Specialists in model-based UML, SysML, Enterprise Java, XML, and Drupal CMS web engineering. Dr Darren Kelly, BSc, PhD, https://www.webel.com.au
#2

This post was moved to a forum thread.

Reopen this issue if you still cannot persist URL after changing the configuration.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

I've set <persist serialization="true" /> in objectdb.conf, but still got this exception. Is there anything I should do on clinet?

#4

If you are using ObjectDB in client-server mode - verify that you changed the configuration on the client side.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#5

Thanks. I forgot to set configuration file in client.

Just set System.setProperty("objectdb.conf", "[PATH of objectdb.conf]"); before open database.


Post Reply

To post a reply and/or subscribe to update notifications - please login