org.nuxeo.ecm.core.api.ClientException: Failed to initialize repository

JIRA | Olivier Grisel | 9 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    For instance when registering a type that depends on a non registered schema (e.g. because of a typo in the schema name), the following exception is raised: org.nuxeo.ecm.core.api.ClientException: Failed to initialize repository at org.nuxeo.ecm.core.api.ejb.EJBExceptionHandler.wrapException(EJBExceptionHandler.java:70) at org.nuxeo.ecm.core.api.ejb.DocumentManagerBean.getSession(DocumentManagerBean.java:191) at org.nuxeo.ecm.core.api.AbstractSession.connect(AbstractSession.java:171) at org.nuxeo.ecm.core.api.ejb.DocumentManagerBean.connect(DocumentManagerBean.java:168) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [snipped 100KB of useless stacktrace] Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: org.nuxeo.ecm.core.api.DocumentException. message: Failed to initialize repository at org.nuxeo.ecm.core.repository.jcr.JCRRepository.initialize(JCRRepository.java:161) at org.nuxeo.ecm.core.repository.jcr.JCRRepository.getSession(JCRRepository.java:98) at org.nuxeo.ecm.core.jca.JCAConnectionFactory.getSession(JCAConnectionFactory.java:81) at org.nuxeo.ecm.core.api.ejb.DocumentManagerBean.createSession(DocumentManagerBean.java:201) at org.nuxeo.ecm.core.api.ejb.DocumentManagerBean.getSession(DocumentManagerBean.java:188) ... 392 more Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: java.lang.NullPointerException. message: null at org.nuxeo.ecm.core.repository.jcr.TypeAdapter.getSchemaName(TypeAdapter.java:87) at org.nuxeo.ecm.core.repository.jcr.TypeImporter.createDocTypeDefinition(TypeImporter.java:481) at org.nuxeo.ecm.core.repository.jcr.TypeImporter.collectDocTypes(TypeImporter.java:432) at org.nuxeo.ecm.core.repository.jcr.TypeImporter.registerTypes(TypeImporter.java:117) at org.nuxeo.ecm.core.repository.jcr.BuiltinTypes.registerUserTypes(BuiltinTypes.java:155) at org.nuxeo.ecm.core.repository.jcr.BuiltinTypes.registerTypes(BuiltinTypes.java:131) at org.nuxeo.ecm.core.repository.jcr.JCRRepository.initialize(JCRRepository.java:157) at org.nuxeo.ecm.core.repository.jcr.JCRRepository.getSession(JCRRepository.java:98) at org.nuxeo.ecm.core.jca.JCAConnectionFactory.getSession(JCAConnectionFactory.java:81) TypeAdapter should have raised a meaningful message such as : throw new InvalidConfigurationException(String.format("type '%s' could not be registered because schema '%s' was not found", typeName, schemaName)); and then JCRRepository.initialize should catch that exception a rewrapped it as something like: throw new ClientException("Failed to initialize repository: " + e.getMessage(), e); so that the developers sees directly the top level error message: Failed to initialize repository: type 'MyType' could not be registered because schema 'my_schema_with_a_typo' was not found and then not have to parse hundreds of logs to know at which line of which class to put an eclipse breakpoint and restart jboss just to get the offending schema name.

    JIRA | 9 years ago | Olivier Grisel
    org.nuxeo.ecm.core.api.ClientException: Failed to initialize repository

    Root Cause Analysis

    1. org.nuxeo.ecm.core.api.WrappedException

      Exception: java.lang.NullPointerException. message: null

      at org.nuxeo.ecm.core.repository.jcr.TypeAdapter.getSchemaName()
    2. org.nuxeo.ecm
      JCAConnectionFactory.getSession
      1. org.nuxeo.ecm.core.repository.jcr.TypeAdapter.getSchemaName(TypeAdapter.java:87)
      2. org.nuxeo.ecm.core.repository.jcr.TypeImporter.createDocTypeDefinition(TypeImporter.java:481)
      3. org.nuxeo.ecm.core.repository.jcr.TypeImporter.collectDocTypes(TypeImporter.java:432)
      4. org.nuxeo.ecm.core.repository.jcr.TypeImporter.registerTypes(TypeImporter.java:117)
      5. org.nuxeo.ecm.core.repository.jcr.BuiltinTypes.registerUserTypes(BuiltinTypes.java:155)
      6. org.nuxeo.ecm.core.repository.jcr.BuiltinTypes.registerTypes(BuiltinTypes.java:131)
      7. org.nuxeo.ecm.core.repository.jcr.JCRRepository.initialize(JCRRepository.java:157)
      8. org.nuxeo.ecm.core.repository.jcr.JCRRepository.getSession(JCRRepository.java:98)
      9. org.nuxeo.ecm.core.jca.JCAConnectionFactory.getSession(JCAConnectionFactory.java:81)
      9 frames