Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Persistence.xml question(XML file contet problem)
Persistence.xml question [message #892287] Wed, 27 June 2012 15:31 Go to next message
Neil Cohen is currently offline Neil CohenFriend
Messages: 12
Registered: June 2012
Junior Member
I have just tried using EclipseLink in my environment. My development environment is Eclipse with the Vaadin development kit.

I have created a number of programs that run just fine - talk to my MySQL database both as standalone java applications and as web-based apps running under Tomcat.

The problem is that our production environment blocks outgoing requests on port 80.
And my persistence.xml file starts off like this:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
    xmlns="h ttp://java.sun.com/xml/ns/persistence" xmlns:xsi="h ttp://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="h ttp://java.sun.com/xml/ns/persistence h ttp://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="My_Persistence_Unit"
        transaction-type="RESOURCE_LOCAL">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <class>com.verisign.myClass</class>
etc. etc.


When my program runs - it will hang for about 90 minutes before the verification
request times out (for h t t p: / /java.sun.com/xml....)

When I was using the Hibernate libraries previously, I was able to remove those
external requests - the persistence line looked like <persistence version="2.0">
and while Eclipse would complain about the content being wrong for the xml file,
it would compile (every other time, actually) and it would run. When I tried that with EclipseLink, the program fails as soon as I try to access the database. It produces an error that it can not find my PersistenceUnit. As soon as I put the java.sun.com lines back into persistence.xml, it works again...

Can someone tell me what the 'correct' solution for this problem would be? Is there some way I can tell the system to either not validate the schema, or to put some validation files locally and replace the external URLs?

I am an experienced Java programmer, but not so much on the database/persistence stuff. This is somewhat new to me, and I know almost nothing about EclipseLink yet.
Any information would be much appreciated, since I have to get these programs migrated as soon as possible to our new environment.

thanks in advance,

nbc

Re: Persistence.xml question [message #893523 is a reply to message #892287] Wed, 04 July 2012 12:55 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Odd, I'm not sure why your XML parser would try to access the urls.

Try just giving the namespace and not the schema, this seems to work.

<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">


James : Wiki : Book : Blog : Twitter
Re: Persistence.xml question [message #894010 is a reply to message #893523] Fri, 06 July 2012 11:46 Go to previous message
Neil Cohen is currently offline Neil CohenFriend
Messages: 12
Registered: June 2012
Junior Member
I found that 2 things did work.

1) Put a completely bogus URL in - the DNS lookup appears to fail and the system just continues on without checking

2) Copy the file from java.sun.com and store it locally. Change the URL to be file:///localhost/.... and the system appears to run correctly as well.

I did leave the namespace in place - that doesn't seem to have any effect or cause any problem...

nbc
Previous Topic:Problems with @Id in mapped superclasses
Next Topic:JPA error
Goto Forum:
  


Current Time: Thu Dec 18 05:37:59 GMT 2014

Powered by FUDForum. Page generated in 0.08289 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software