TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
247 stars 102 forks source link

JSF1091: No mime type could be found for file null. To resolve this, add a mime-type mapping to the applications web.xml. #1155

Closed abraham1980 closed 1 week ago

abraham1980 commented 3 years ago

hi, im getting this error, on fresh proyect. I run on payara 5 and tomme 8 bootsfaces version 1.5.0

26-Sep-2020 19:13:20.173 WARNING [http-nio-8080-exec-7] com.sun.faces.context.ExternalContextImpl.getMimeType JSF1091: No mime type could be found for file null. To resolve this, add a mime-type mapping to the applications web.xml.

The page to reproduce:

    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        Hello from Facelets
        <h:form>
        <b:commandButton value="boton" update="@this"/> <br/>

        </h:form>
    </h:body>
</html>

is related to de update field

stephanrauh commented 3 years ago

I don't think this bug has anything to do with BootsFaces. Maybe the error message is correct. Have you registered the *.xhtml files with the FacesServlet?


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

   ...

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
</web-app>
abraham1980 commented 3 years ago

I did:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">

...
<servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

anyway it dont broke anything just log

stephanrauh commented 3 years ago

Which URL are you using? If you configure your FacesServlet like so, it shows the index.xhtml when you navigate to http://localhost:8080/index.xhtml.

klease commented 3 years ago

I also have the error "com.sun.faces.context.ExternalContextImpl#798 - JSF1091: No mime type could be found for file null...." I'm using In Mojarra 2.3.14. It occurs in a element with an Ajax onselect handler "onselect="ajax:listBean.onSelect(entity, typeOfSelection, indexes)". Selecting a row in the table causes a POST request to trigger the onSelect() method which works correctly. By putting a breakpoint at the line mentioned in the message, I identified the cause. During the rendering phase, all the resources in the viewRoot are processed in PartialViewContextImpl.renderComponentResources(). The error message appears once for each "special" bootsfaces resource, for example when the resource is a net.bootsfaces.listeners.InternalIE8CompatiblityLinks object. It was also occurring on the dataTables-related js and css which were fetched from the CDN. By forcing those to be retrieved locally, the warning for those resources disappeared. I agree it's just a warning if the project is in development stage, but it's rather annoying and misleading.

macbl commented 3 years ago

Yes, it would be nice if there would be a fix for this (not using the CDN is a rather drastic measure)

geopossachs commented 2 years ago

About this PR I think the error comes from a missing type = "text / javascript" tag in InternalIE8CompatiblityLinks

https://github.com/TheCoder4eu/BootsFaces-OSP/blob/4678f401998430f4386f6c347037c3c3d6a1bdfa/src/main/java/net/bootsfaces/listeners/InternalIE8CompatiblityLinks.java#L62

https://github.com/TheCoder4eu/BootsFaces-OSP/pull/1173

geopossachs commented 2 years ago

found the point of the log message
https://github.com/eclipse-ee4j/mojarra/blob/master/impl/src/main/java/com/sun/faces/context/ExternalContextImpl.java#L717

geopossachs commented 2 years ago

I tried my approach, but it didn't help. The question is why is this message coming?

stephanrauh commented 1 week ago

I'm afraid development of BootsFaces has slowed down considerably. We'll never manage to address this issue. Let's close it.