BootsFaces-OSP icon indicating copy to clipboard operation
BootsFaces-OSP copied to clipboard

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

Open abraham1980 opened this issue 5 years ago • 8 comments

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

abraham1980 avatar Sep 26 '20 17:09 abraham1980

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>

stephanrauh avatar Sep 26 '20 18:09 stephanrauh

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

abraham1980 avatar Sep 27 '20 17:09 abraham1980

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.

stephanrauh avatar Sep 27 '20 17:09 stephanrauh

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 <b:dataTable> 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.

klease avatar Jan 27 '21 20:01 klease

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

macbl avatar Feb 14 '21 18:02 macbl

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 avatar Oct 17 '21 15:10 geopossachs

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 avatar Oct 18 '21 19:10 geopossachs

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

geopossachs avatar Oct 18 '21 20:10 geopossachs

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

stephanrauh avatar Aug 12 '24 15:08 stephanrauh