1

I newbie here.

My troubleshooting is that from one day to another I can't deploy my project. I have reverted every modification previous to this problem but no success, it still throws the new exception.

The hibernate models have not been modified, the database has not been modified.

Actually I dont't know whats going on.

01-Jul-2019 09: 43: 07.243 SERIOUS [main] org.apache.catalina.core.StandardContext.listenerStart Exception when sending an initialized context event to the class listener instance [com.sun.faces.config.ConfigureListener ]
java.lang.RuntimeException: com.sun.faces.mgbean.ManagedBeanCreationException: The managerTdocumentFormenter property can not be defined for the managed bean catalogosBean
in com.sun.faces.config.ConfigureListener.contextInitialized (ConfigureListener.java:292)

Caused by: com.sun.faces.mgbean.ManagedBeanCreationException: The managerTdocumentFormenter property can not be defined for the managed bean catalogosBean
in com.sun.faces.mgbean.ManagedBeanBuilder $ BakedBeanProperty.set (ManagedBeanBuilder.java:615)
in com.sun.faces.mgbean.ManagedBeanBuilder.buildBean (ManagedBeanBuilder.java:133)
in com.sun.faces.mgbean.BeanBuilder.build (BeanBuilder.java:104)
in com.sun.faces.mgbean.BeanManager.createAndPush (BeanManager.java:409)
in com.sun.faces.mgbean.BeanManager.create (BeanManager.java:269)
in com.sun.faces.mgbean.BeanManager.create (BeanManager.java:256)
in com.sun.faces.config.ConfigureListener.contextInitialized (ConfigureListener.java:255)
... 41 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with the name 'sessionFactory' defined in the ServletContext resource [/WEB-INF/classes/resources/spring/config/Hibernate.xml]: invocation of the start method failed; the nested exception is org.hibernate.InvalidMappingException: the mapping document of an invalid mapping could not be parsed
in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1455)
in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:519)
in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:456)
in org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject (AbstractBeanFactory.java:294)
in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:225)
in org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:291)
in org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:193)
in org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:567)
in org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:913)
in org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:464)
in org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext (ContextLoader.java:385)
in org.springframework.web.context.ContextLoader.initWebApplicationContext (ContextLoader.java:284)
in org.springframework.web.context.ContextLoaderListener.contextInitialized (ContextLoaderListener.java:111)
in org.apache.catalina.core.StandardContext.listenerStart (StandardContext.java:4663)
... 40 more
Caused by: org.hibernate.InvalidMappingException: The mapping document of an invalid mapping could not be parsed
in org.hibernate.cfg.Configuration.addInputStream (Configuration.java:502)

Caused by: org.xml.sax.SAXParseException; lineNumber: 5; column number: 20; The type of element "hibernate-mapping" must be declared.
in com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException (ErrorHandlerWrapper.java:203)

About the beans mention in the exception, I have:

public class CatalogosBean implements java.io.Serializable {

    ...
    private transient TdocumentoParametroBo manejadorTdocumentoParamentro;
    ...
public TdocumentoParametroBo getManejadorTdocumentoParamentro() {
        return manejadorTdocumentoParamentro;
    }

    public void setManejadorTdocumentoParamentro(TdocumentoParametroBo manejadorTdocumentoParamentro) {
        this.manejadorTdocumentoParamentro = manejadorTdocumentoParamentro;
    }

1
  • Hi @IMustBeSomeone ITranslate the exception. I'm really sorry. Thanks for your help Commented Jul 1, 2019 at 15:19

1 Answer 1

3

We were having a very similar problem here, but with a Hibernate reverse engineering file rather than a Hibernate mapping file. In our case, the file itself had not been modified since November 2018 but stopped working late last week. In diagnosing our issue when I set some breakpoints in the build, I found that the SAXParserException only prints the first error returned from the error logger created by XML parser. As it turned out, every single XML element in the file was flagged with the same type of error:

org.xml.sax.saxparseexception element type "hibernate-reverse-engineering" must be declared

The parser had found 498 errors even though only the first one was printed.

What fixed the issue in our case was changing the DOCTYPE in the hibernate.reveng.xml file from: <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-reverse-engineering-3.0.dtd">

to

<!DOCTYPE hibernate-reverse-engineering SYSTEM "https://hibernate.org/dtd/hibernate-reverse-engineering-3.0.dtd" >

That is, we changed from using a public identifier to a system identifier and from http to https.

The original form (the PUBLIC one) is what we got from previous hibernate.org (jboss.org) documentation (from around the Hibernate 3.2 time frame). The new one is what we find looking at the JBoss documentation for Hibernate Reverse Engineering today. What I would guess is that you need a similar change to your Hibernate mapping file (Hibernate.xml or hbm.xml or whatever name you are using) to at least use https in place of http and possibly to change the DOCTYPE to:

<!DOCTYPE hibernate-mapping SYSTEM https://hibernate.org/hibernate-mapping-3.0.dtd">

If that doesn't help, try adding your Hibernate.xml file to the question (after removing as much sensitive information as possible).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.