Closed hhallenyang closed 9 months ago
The root tag of your taglib file (<facelet-taglib>
) should have a schema. In your case it's completely empty.
For the current version in GlassFish 7 (Faces 4):
<facelet-taglib id="someId"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facelettaglibrary_4_0.xsd"
version="4.0"
>
See e.g. https://github.com/omnifaces/showcase/blob/master/src/main/webapp/WEB-INF/showcase.taglib.xml
Thank you. The exception went away.
Here is the XHTML page I am referring the tag with 't'. However, the system can't find the namespace "http://mycompany.com/tags" when I try to call my tag "sample_tag" in my pages. What am I missing?
Here is my sample page.
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:t="http://mycompany.com/tags" >
<h:body>
<ui:composition >
<t:simple_tag label="My Label" value="My Value" />
</ui:composition>
</h:body>
Environment Details
IDE: Netbeans 19
Problem Description
I am migrating my project from Glassfish 4 to Glassfish 7. I got an exception when I run the project on Netbean 19 with Glassfish 7.0.9 server. I can run the same project on Netbeans 8.2 with Glassfish 4 successfully.
The problem is easily reproducible.
Stack traces or command outputs
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'file:/C:/Users/allen/Documents/projects/emlucy/TagLib/TagLib/target/TagLib-1.0/WEB-INF/mytagLab.xml': Cannot invoke "com.sun.faces.config.manager.FacesSchema.loadSchema()" because "schemaId" is null|#]
Steps to reproduce
Sample code/application
Here is the content of the web.xml.
Here is the content of the pom.xml.
The content of 'mytagLab.xml'.
The content of /tags/sample_tag.xhtml'
Impact of Issue
I could not continue on migrating without fixing this problem.
Please choose one each Type, Component, and Priority label
Priority: high