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

Bug 333394

Summary: Can't open JPA Editor due to false detection of invalid persistence.xml
Product: [WebTools] Dali JPA Tools Reporter: Rostislav Stříbrný <rostislav.stribrny>
Component: Diagram EditorAssignee: Neil Hauge <neil.hauge>
Status: ASSIGNED --- QA Contact: Stefan Dimov <stefan.dimov>
Severity: normal    
Priority: P3 CC: neil.hauge, rostislav.stribrny
Version: 2.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Used persistence.xml none

Description Rostislav Stříbrný CLA 2011-01-02 21:05:21 EST
Eclipse Helios Service Release 1
Version: JPA Diagram Editor (Incubation)	0.5.0.201012011111


Relevant project configuration:
- Maven Project
- JPA 2.0 facet, Java 1.6
    - Hibernate 3.6.0 Final libraries included by Maven dependency
- Tried several combination of "Java persistence" Eclipse configurations, always without effect:
    - Generic 2.0 with user libs (hibernate)
    - Generic 2.0 w/o libs
    - Hibernate JPA 2.x with user libs (hibernate)
    - EclipseLink 2.1.x
  - Always without connection filled
  - With chosen: "Discover annotated classes automatically"


Misc info:
1.) I've tried putting META-INF/persistence.xml under following project directories: /src/main/resources, /, /src/main/java, /src
    - It found it just in /META-INF/persistence.xml

2.) I've also tried disabling "related" JPA validation => no effect. Disabling entire JPA validation => no effect.
    - on both workspace and/or project.




Plugins:

  CollabNet Merge Client	2.2.1	com.collabnet.subversion.merge.feature.feature.group
  Context and Dependency Injection Tools	1.1.0.v20101206-2100-H28-Beta2	org.jboss.tools.cdi.feature.feature.group
  Eclipse IDE for Java EE Developers	1.3.1.20100916-1202	epp.package.jee
  FreeMarker IDE	1.1.0.v20101206-2100-H28-Beta2	org.jboss.ide.eclipse.freemarker.feature.feature.group
  Google Plugin for Eclipse 3.6	1.4.2.v201012211742	com.google.gdt.eclipse.suite.e36.feature.feature.group
  Graphiti (Incubation)	0.7.0.v20101005-1338	org.eclipse.graphiti.feature.feature.group
  Graphiti Examples (Incubation)	0.7.0.v20101001-1402	org.eclipse.graphiti.feature.examples.feature.group
  Hibernate Tools	3.3.0.v20101206-2100-H28-Beta2	org.hibernate.eclipse.feature.feature.group
  Java EE 5 Documentation	1.0.0.201009290929	oracle.eclipse.tools.helios.doc.javaee5.feature.group
  Java EE 6 Documentation	1.0.0.201009290929	oracle.eclipse.tools.helios.doc.javaee6.feature.group
  JBoss Maven CDI Configurator	1.0.0.v20101206-2100-H28-Beta2	org.jboss.tools.maven.cdi.feature.feature.group
  JBoss Maven Hibernate Configurator	1.0.0.v20101206-2100-H28-Beta2	org.jboss.tools.maven.hibernate.feature.feature.group
  JBoss Maven Integration	1.1.0.v20101206-2100-H28-Beta2	org.jboss.tools.maven.feature.feature.group
  JBoss Maven JSF Configurator	1.0.0.v20101206-2100-H28-Beta2	org.jboss.tools.maven.jsf.feature.feature.group
  JBoss Maven Portlet Configurator	1.0.0.v20101206-2100-H28-Beta2	org.jboss.tools.maven.portlet.feature.feature.group
  JBoss Maven Seam Integration	1.1.0.v20101206-2100-H28-Beta2	org.jboss.tools.maven.seam.feature.feature.group
  JBoss Portlet	1.1.0.v20101206-2100-H28-Beta2	org.jboss.tools.portlet.feature.feature.group
  JBoss Tools Community Project Examples	1.1.0.v20101206-2100-H28-Beta2	org.jboss.tools.community.project.examples.feature.feature.group
  JBoss Tools RichFaces	3.2.0.v20101206-2100-H28-Beta2	org.jboss.tools.richfaces.feature.feature.group
  JBossAS Tools	2.2.0.v20101206-2100-H28-Beta2	org.jboss.ide.eclipse.as.feature.feature.group
  JNA Library	3.2.7	com.sun.jna.feature.group
  JPA Diagram Editor (Incubation)	0.5.0.201012011111	org.eclipse.jpt.ui.diagrameditor.feature.feature.group
  Maven Integration for Eclipse (Required)	0.12.0.20101115-1102	org.maven.ide.eclipse.feature.feature.group
  Oracle Coherence Tools	1.6.1.201010012100	oracle.eclipse.tools.helios.coherence.feature.group
  Oracle GlassFish Server Tools	1.6.1.201009290929	oracle.eclipse.tools.helios.glassfish.feature.group
  Oracle WebLogic Server Tools	1.6.1.201010012100	oracle.eclipse.tools.helios.weblogic.feature.group
  Runtime Initialization	1.1.0.v20101206-2100-H28-Beta2	org.jboss.tools.runtime.feature.feature.group
  Seam Tools	3.2.0.v20101206-2100-H28-Beta2	org.jboss.tools.seam.feature.feature.group
  Spring IDE Autowire Extension (optional)	2.5.1.201011101000-RELEASE	org.springframework.ide.eclipse.autowire.feature.feature.group
  Spring IDE Core (required)	2.5.1.201011101000-RELEASE	org.springframework.ide.eclipse.feature.feature.group
  Spring IDE Integration, Flex and Web Services Extension (optional)	2.5.1.201011101000-RELEASE	org.springframework.ide.eclipse.integration.feature.feature.group
  Spring IDE Web Flow Extension (optional)	2.5.1.201011101000-RELEASE	org.springframework.ide.eclipse.webflow.feature.feature.group
  Subclipse (Required)	1.6.16	org.tigris.subversion.subclipse.feature.group
  Subversion Client Adapter (Required)	1.6.12	org.tigris.subversion.clientadapter.feature.feature.group
  Subversion JavaHL Native Library Adapter (Required)	1.6.15	org.tigris.subversion.clientadapter.javahl.feature.feature.group
  Subversion Revision Graph	1.0.9	org.tigris.subversion.subclipse.graph.feature.feature.group
  SVNKit Client Adapter (Not required)	1.6.12	org.tigris.subversion.clientadapter.svnkit.feature.feature.group
  SVNKit Library	1.3.4.6888	org.tmatesoft.svnkit.feature.group
  XULRunner	1.9.12.v20101206-2100-H28-Beta2	org.jboss.tools.xulrunner.feature.feature.group
Comment 1 Rostislav Stříbrný CLA 2011-01-02 21:07:28 EST
Created attachment 185940 [details]
Used persistence.xml
Comment 2 Stefan Dimov CLA 2011-01-18 06:54:29 EST
Rostislav, I don't think that problem is related with the diagram editor. The editor doesn't detect persistence.xml. It works on a bit higher level - the java classes representing persistence model. If the model is successfully resolved by Dali then the diagram editor will be able to visualize the java entities. 

It would be helpful if you provide some more info. Do you have some errors in the error log? What errors do you see in problems view? Maybe, some exceptions in the console?

I've googled it and found similar problems dscribed by some Hibernate JPA users:

http://stackoverflow.com/questions/2662677/jpa-2-0-hiberante-3-5-jars-persistence-xml-location

http://forum.springsource.org/showthread.php?t=89055

Most likely I will move this bug to another component of Dali JPA Tools (perhaps 'General' or 'Framework') although I'm not sure if the problem is in Dali at all, but perhaps someone might be aware of the problem. 

But first of all I'd like to see the errors/exceptions you get. Please, provide them.
Comment 3 Stefan Dimov CLA 2011-01-26 09:57:35 EST
Is someone aware of such a problem?
Comment 4 Neil Hauge CLA 2011-01-26 10:18:39 EST
Hi guys...I think the following thread will be helpful for dealing with these issues regarding Maven and persistence.xml location.

http://www.eclipse.org/forums/index.php?t=msg&goto=619384

Also see bug 251323 and bug 317900 for more information.

We should probably open an enhancement against m2e to support the extension provided under bug 317900.  That should more completely address this issue, without the need for user intervention to solve the problem.

I'll leave this open for now for tracking purposes and move under diagram editor so that others who might encounter this issue will find the bug.
Comment 5 Rostislav Stříbrný CLA 2011-01-27 16:14:09 EST
Hi Stefan,
sorry for the delay. I've just reproduced the problem with clean logs to see if some error will appear.

1.) RE: Do you have some errors in the error log? What errors do you see in problems view? Maybe, some exceptions in the console?

No errors/warnings in Eclipse Problems window, Eclipse Console window or .metadata/.log logging file.

2.) I've tried following steps mentioned forum you sent.

For testing purposes, I've put my persistence.xml nearly everywhere:
    src/main/resources/META-INF/persistence.xml
    src/main/resources/persistence.xml
    src/main/java/META-INF/persistence.xml
    META-INF/persistence.xml

Steps:
- remove JPA facet
- remove '**' from src/main/resources excluded option => no success
- move src/main/resources to the top in the "Order and export" tab => no success
- add JPA facet back
- restart Eclipse

=> no success
Comment 6 Neil Hauge CLA 2011-02-08 11:14:52 EST
(In reply to comment #5)

Make sure you perform a project "Clean..." after making changes to see if the project builds correctly.