June 26, 2013

Error: Page template name already used in library


I have created a page template with name “PageTemplate.jspx” in JDeveloper for my application, but I deleted the file later. Again when I tried to create a page template with the same name “PageTemplate.jspx”  in the application then I got the below validation error “Page template name already used in library”.





Even if we delete the file from JDeveloper, entries from some configuration files may not be deleted. Hence, we get this error.
There are two solutions for this.
The simplest one is to give different name to the template :D .
Another one is,
  • Go to META-INF folder under Application Source of the project
  • Open the file “pagetemplate-metadata.xml”
  • You should find your pagetemplate entry with in the tags
     <pagetemplate-jsp-ui-def>…</pagetemplate-jsp-ui-def>
  • Remove the entry and save the xml file
  • Now you should be able to create the page template with the same name