0

After deploying our EAR file to Glassfish 3.1.2 Build 23, I receive this error in my Firefox browser:

XML Parsing Error: no element found Location: https://localhost:8181/TranscriptTool/welcome/index.xhtml Line Number 1, Column 1:

The EAR file deployed without any errors and works fine on another server, but this server generates the above error.

I've not been successful in finding the reason for this.

This is the index.xhtml file:

<?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">
<ui:composition template="/template/no_menu_layout.xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    xmlns:tt="http://jsf/transcripttool">
    <ui:define name="title">
        Login
    </ui:define>
    <ui:define name="content">
    <h:form prependId="false">
        <br/>
        <p:panelGrid  style="margin: 0 auto;">
            <p:row>  
                <p:column><h:outputLabel for="username" value="Username:" /></p:column>
                <p:column><p:inputText value="#{userLoginSession.username}"   
                    id="username" required="true" label="username" /></p:column>        
            </p:row>
            <p:row>  
                <p:column><h:outputLabel for="password" value="Password:" /></p:column>
                <p:column><p:password value="#{userLoginSession.password}"   
                            id="password" label="password" /></p:column>        
            </p:row>
            <p:row>
                <p:column colspan="2" style="text-align: center;"><p:commandButton id="loginButton" value="Login"    
                     action="#{userLoginSession.login}" ajax="false"/></p:column>
            </p:row>
        </p:panelGrid>
        <div class="ui-widget" style="text-align: center;">
            <h:link outcome="passwordReset" value="Reset Password"/>
        </div>          
    </h:form>
    <div style="position: absolute;width: 100%;bottom: 70px;">
    </div>
    <tt:errPopup id="userError" isModal="true"
            errorHandle="#{userLoginSession.errorMessages}" />
    </ui:define>
</ui:composition>

Thanks Avis

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Avis W
  • 9
  • 5
  • To exclude one and other: 1) how does the response body look like? ("View source" in browser) 2) what's the response content type? (check response headers in browser's HTTP traffic monitor (press F12 and open Network tab)) Regardless, you should have posted code in MCVE flavor, not a full and incomplete code dump. Surely things like `
    `, `
    `, `style="..."`, etc don't contribute to the problem. See also http://stackoverflow.com/tags/jsf/info
    – BalusC Sep 15 '15 at 19:26
  • Not very familiar with primefaces, but why would you have an html (xhtml transitional) doctype declaration in this file? – Daniel Haley Sep 15 '15 at 19:42
  • Could you post `faces-config.xml` file content, or only first lines if it is very large? – Javier Haro Sep 15 '15 at 20:46
  • @DanielHaley: see http://stackoverflow.com/tags/xhtml/info and http://stackoverflow.com/q/16035349 – BalusC Sep 15 '15 at 20:51
  • @lametaweb: what `faces-config.xml` problem did you expect to find that it could possibly cause the symptoms OP is facing? – BalusC Sep 15 '15 at 20:52
  • @BalusC, I was wondering if Mojarra version would differ between Glassfish 3.1.2 and the server where the application is now running. – Javier Haro Sep 15 '15 at 20:59
  • I have googled a little and it could be possible the server is returning an empty page due to an exception during Render Response phase due to a wrong library version. In order to indentify the cause perhaps it wolud help to cut some chunks of code from index.xhtml and check if the problem goes away. – Javier Haro Sep 15 '15 at 21:30
  • Unless OP is blind, it would be surprising if OP didn't notice any exception in server log. – BalusC Sep 16 '15 at 08:10
  • @BalusC The response body is completely blank. And the response content type isn't listed. The Network Tab shows a "500 Internal Server Error" whenever I try to load this page. The console tab does show "no element found" too. It's weird to me, that this exact same EAR file works on another server running Glassfish 3.1.2 as well without any errors at all. Don't know what else to check. – Avis W Sep 16 '15 at 14:27
  • @lametaweb Here's the first few lines of my faces-config.xml file: – Avis W Sep 16 '15 at 14:28
  • @BalusC I did just notice a WARNING in the server.log: jmac.provider_unable_to_load_authmodule Any idea what to check to stop this warning? – Avis W Sep 16 '15 at 14:34

2 Answers2

0

We fixed the error by copying the whole GLASSFISH directory over from the one server that worked to the one that didn't. Naturally had to change a few entries in the domain.xml file but after doing this, the application now runs properly.

Avis W
  • 9
  • 5
-1

I will suggest you examine the template page referenced in the index.xhtml "template="/template/no_menu_layout.xhtml" as this index.xhtml seems ok. Also check to be sure all tags are properly closed in custom components referenced at xmlns:tt="http://jsf/transcripttool".

Tunde Michael
  • 364
  • 4
  • 8