0

I faced with some weird behavior: my IDE can't recognize xml document if it named "persistence.xml" and all features like syntax coloring & code completion doesn't work for this file.

enter image description here

But when I rename it, idea start to support this xml document.

enter image description here

So, what can be the reason of this behavior?

(Debian, IDEA 14)

Updated persistence.xml:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">

  <persistence-unit name="ex01" transaction-type="JTA">

    <jta-data-source>java:global/jdbc/ch08</jta-data-source>
    <properties>
      <property name="javax.persistence.schema-generation.database.action" value="create"/>
      <property name="javax.persistence.schema-generation-target" value="database-and-scripts"/>

      <property name="javax.persistence.schema-generation.scripts.action" value="create"/>
      <property name="javax.persistence.schema-generation.scripts.create-target" value="create.sql"/>

      <property name="javax.persistence.sql-load-script-source" value="sql/initData.sql"/>

      <property name="javax.persistence.jdbc.driver"  value="org.apache.derby.jdbc.EmbeddedDriver"/>
      <property name="javax.persistence.jdbc.url"     value="jdbc:derby:memory:07DB;create=true"/>

        <property name="eclipselink.logging.level" value="OFF"/>
    </properties>
  </persistence-unit>
</persistence>
Alex Silkovsky
  • 541
  • 5
  • 18
  • could you paste here persistence.xml file content ? – over9k Aug 07 '15 at 20:40
  • possible duplicate of [IntelliJ not recognizing a particular file correctly, instead its stuck as a text file](http://stackoverflow.com/questions/15915202/intellij-not-recognizing-a-particular-file-correctly-instead-its-stuck-as-a-tex) – Vic Aug 12 '15 at 08:09

0 Answers0