Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335667

Summary: FileNotFoundException in JPA Diagramm editor
Product: [WebTools] Dali JPA Tools Reporter: Dmitry Geraskov <geraskov>
Component: Diagram EditorAssignee: Stefan Dimov <stefan.dimov>
Status: RESOLVED WORKSFORME QA Contact: Stefan Dimov <stefan.dimov>
Severity: major    
Priority: P3 CC: vyemialyanchyk
Version: 3.0   
Target Milestone: 3.0 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dmitry Geraskov CLA 2011-01-28 05:07:26 EST
I created jpa project with Hibernate platform, added necessary libraries to class path (they are located in a different project CaveatEmptor), created 2 entities and opened jpa diagramm editor. It was empty. After this I tried to add an entity on the diagramm and got the exception:

java.io.FileNotFoundException: \CaveatEmptor\lib\thirdparty-all.jar (The system cannot find the path specified)
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:114)
	at java.util.jar.JarFile.<init>(JarFile.java:135)
	at java.util.jar.JarFile.<init>(JarFile.java:72)
	at org.eclipse.jpt.ui.diagrameditor.internal.feature.CreateJPAEntityFeature.isPersistenceProviderLibraryInClasspath(CreateJPAEntityFeature.java:193)
	at org.eclipse.jpt.ui.diagrameditor.internal.feature.CreateJPAEntityFeature.checkIsSetPersistenceProviderLibrary(CreateJPAEntityFeature.java:218)
	at org.eclipse.jpt.ui.diagrameditor.internal.feature.CreateJPAEntityFeature.create(CreateJPAEntityFeature.java:122)
	at org.eclipse.graphiti.features.impl.AbstractCreateFeature.execute(AbstractCreateFeature.java:100)
	at org.eclipse.graphiti.internal.command.GenericFeatureCommandWithContext.execute(GenericFeatureCommandWithContext.java:64)
	at org.eclipse.graphiti.internal.command.GFPreparableCommand.doExecute(GFPreparableCommand.java:37)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)

The CaveatEmptor project is in the workspace.
Comment 1 Stefan Dimov CLA 2011-04-13 05:09:59 EDT
I've tried to reproduce the problem, but I wasn't able to. I've tried adding the JPA hibernate API to the project classpath (as a library) and then the editor worked fine. 

First, I've created an user library and added to it the hibernate-jpa-2.0-api-1.0.0.Final.jar and then I've added this library as JPA implementation from the JPA project property page. (It also can be done during the JPA project creation from the wizard.) 

This is the correct way to add the JPA API implementation to the JPA enabled project. I don't know if you are using that way, but it should work. I'm closing this bug now, but if you feel that the problem still exists please reopen it and describe in a little more details how to reproduce the problem.