Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink project works in one Eclipse Workspace but not in another
EclipseLink project works in one Eclipse Workspace but not in another [message #385175] Sat, 10 January 2009 00:03 Go to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Hi,

I have a very small EclipseLink example which runs perfectly in a
workspace.

I imported this example in another workspace (same Eclipse installation
therefore same version, available plug-ins, etc.) and it did not work.

The following message was issued:

Exception in thread "main" javax.persistence.PersistenceException: No
Persistence provider for EntityManager named people
at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:89)
at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:60)
at de.vogella.jpa.eclipselink.main.Main.main(Main.java:18)


After lots of checking the only difference I could find is that the
second workspace is in a deep folder structure, something like:
C:\Documents and
Settings\vogella\Desktop\Documents\08_MyDocuments\20_Documen tation\JPAPersistenceExamples\de.vogella.jpa.eclipselink2\sr c\META-INF

I imported the project into a thrid workspace with a shorter path (again
same Eclipse installation) and it did work.

Are there any restrictions in relation to the path name or are there any
other reasons why the project does not run in the second workspace?

Best regards, Lars

--
Lars Vogel
http://www.vogella.de/eclipse.html - Tutorials about Eclipse
http://www.vogella.de/articles/RichClientPlatform/article.ht ml - Eclipse
RCP Tutorial
Re: EclipseLink project works in one Eclipse Workspace but not in another [message #385179 is a reply to message #385175] Mon, 12 January 2009 01:00 Go to previous messageGo to next message
Gordon Yorke is currently offline Gordon YorkeFriend
Messages: 78
Registered: July 2009
Member
The failing project has spaces in the path. We have fixed a similar issue
in 1.1 and I believe 1.0.2.

What version of EclipseLink are you using.
--Gordon
Re: EclipseLink project works in one Eclipse Workspace but not in another [message #385180 is a reply to message #385179] Mon, 12 January 2009 10:36 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Hi Gordon,

For this example I'm using eclipselink-1.0.2.

I did try this example in a workspace which had also spaces (but a
shorter path name) and it worked.

The path in which the example is working: is
C:\Documents and
Settings\vogella\Desktop\Documents\08_MyDocuments\14_Eclipse _Test_Path\de.vogella.jpa.eclipselink

The none working path is:
C:\Documents and
Settings\vogella\Desktop\Documents\08_MyDocuments\20_Documen tation\JPAPersistenceExamples\de.vogella.jpa.eclipselink

Best regards, Lars


Gordon Yorke wrote:
> The failing project has spaces in the path. We have fixed a similar
> issue in 1.1 and I believe 1.0.2.
>
> What version of EclipseLink are you using.
> --Gordon
>


--
Lars Vogel
http://www.vogella.de/eclipse.html - Tutorials about Eclipse
http://www.vogella.de/articles/RichClientPlatform/article.ht ml - Eclipse
RCP Tutorial
Re: EclipseLink project works in one Eclipse Workspace but not in another [message #385184 is a reply to message #385180] Mon, 12 January 2009 20:44 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Hi,

this seesm to be a bug in the Java Classloader (Java 6 Update 11). I
created the following example to demonstrate it:

---------------
package de.vogella.jpa.bug;

import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;

public class Test {
public static void main(String[] args) {
ClassLoader currentLoader = Thread.currentThread()
.getContextClassLoader();
try {
Enumeration<URL> resources = currentLoader
.getResources("META-INF/persistence.xml");
while (resources.hasMoreElements()) {
System.out.println("Elements found");
resources.nextElement();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

----------

Running this in a project with a medium sized path name delivers a hit.
Running it in a project with a long path name return nothing.

I'll open a bug at Sun.

Best regards, Lars
Re: EclipseLink project works in one Eclipse Workspace but not in another [message #385243 is a reply to message #385184] Wed, 14 January 2009 16:26 Go to previous message
Michael OBrien is currently offline Michael OBrienFriend
Messages: 34
Registered: July 2009
Member
Lars,
Hi, just a reference about 1.6 releases to keep in mind.
The implementation of releases post 1.6.0_07 differ in their
ClassLoader behavior.
We had a classLoader issue in SDO recently where when we loaded >5000
classes the JVM slowed down by a factor of 300+. It turned out that this
behavior only appeared from 1.6.0_01 to 1.6.0_07, when we used a 1.5 JRE
or the 1.6.0_10 JRE there was no issue. It looked like the ClassLoader
implementation in the 1.6.0_10+ JRE's may use a different improved HotSpot
JVM.

See our tracking bug...
https://bugs.eclipse.org/bugs/show_bug.cgi?id=248019

For the SUN bug...
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6763424
Duplicated to
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6471009

thank you
/michael
Previous Topic:Source code for javax.persistence
Next Topic:OutOfMemory for simple example persisting large amount of data
Goto Forum:
  


Current Time: Thu Mar 28 11:26:06 GMT 2024

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

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

Back to the top