1

I'm trying to run a Server application on Eclipse. I've imported the Project but, when I run it I get this error:

25  jpa-pu  WARN   [localhost-startStop-1] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'jpa-pu', root URL [file:/C:/SourceCodeTFS/DC_MicroCreditoServer/Dev/DEV/fineract-provider/bin]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.
36  jpa-pu  INFO   [localhost-startStop-1] openjpa.Runtime - OpenJPA dynamically loaded a validation provider.
14:42:49.579 [main] INFO  ch.vorburger.exec.ManagedProcess - Successfully destroyed Program [C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\bin\bin\mysqld.exe, --no-defaults, --console, --skip-grant-tables, --max_allowed_packet=64M, --basedir=C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\bin, --datadir=C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\data, --port=57244] (in working directory C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\bin)
14:42:49.579 [main] INFO  ch.vorburger.mariadb4j.DB - Database stopped.

And then, the whole application crashes:

14:42:49.579 [main] INFO  ch.vorburger.exec.ManagedProcess - Successfully destroyed Program [C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\bin\bin\mysqld.exe, --no-defaults, --console, --skip-grant-tables, --max_allowed_packet=64M, --basedir=C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\bin, --datadir=C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\data, --port=57244] (in working directory C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\build\db\bin)
14:42:49.579 [main] INFO  ch.vorburger.mariadb4j.DB - Database stopped.
Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:124)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
    at org.apache.fineract.ServerWithMariaDB4jApplication.main(ServerWithMariaDB4jApplication.java:56)
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:100)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:74)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:295)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:147)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:148)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:121)
    ... 7 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.fineract.infrastructure.core.boot.WebXmlConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.fineract.infrastructure.security.filter.TenantAwareBasicAuthenticationFilter org.apache.fineract.infrastructure.core.boot.WebXmlConfiguration.basicAuthenticationProcessingFilter; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'basicAuthenticationProcessingFilter' defined in file [C:\SourceCodeTFS\DC_MicroCreditoServer\Dev\DEV\fineract-provider\bin\org\apache\fineract\infrastructure\security\filter\TenantAwareBasicAuthenticationFilter.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.security.authentication.AuthenticationManager]: : Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'customAuthenticationProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customAuthenticationProvider' defined in URL [file:/C:/SourceCodeTFS/DC_MicroCreditoServer/Dev/DEV/fineract-provider/bin/META-INF/spring/securityContext.xml]: Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.fineract.infrastructure.security.domain.PlatformUserRepository org.apache.fineract.infrastructure.security.service.TenantAwareJpaPlatformUserDetailsService.platformUserRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appUserRepository': Cannot resolve reference to bean 'jpaMapppingContext' while setting bean property 'mappingContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMapppingContext': Invocation of init method failed; nested exception is <openjpa-2.4.1-r422266:1730418 fatal user error> org.apache.openjpa.util.MetaDataException: The type "class org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom" has not been enhanced.; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'customAuthenticationProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customAuthenticationProvider' defined in URL [file:/C:/SourceCodeTFS/DC_MicroCreditoServer/Dev/DEV/fineract-provider/bin/META-INF/spring/securityContext.xml]: Cannot resolve reference to bean 'userDetailsService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.fineract.infrastructure.security.domain.PlatformUserRepository org.apache.fineract.infrastructure.security.service.TenantAwareJpaPlatformUserDetailsService.platformUserRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appUserRepository': Cannot resolve reference to bean 'jpaMapppingContext' while setting bean property 'mappingContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMapppingContext': Invocation of init method failed; nested exception is <openjpa-2.4.1-r422266:1730418 fatal user error> org.apache.openjpa.util.MetaDataException: The type "class org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom" has not been enhanced.
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:301)

(...) and so on (...)

I'm trying to understand this error for three days now and I've managed to see that is something about the persistence.xml file, the jpa and spring but I can't understand why I get this error. Can you help me?

The persistence.xml part that the error refers:

<persistence version="2.0"
    xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

    <persistence-unit name="jpa-pu" transaction-type="RESOURCE_LOCAL">
        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <properties>
        <property name="openjpa.Compatibility" value="QuotedNumbersInQueries=true"/>
        <property name="openjpa.jdbc.DBDictionary" value="org.apache.fineract.infrastructure.core.domain.MySQLDictionaryCustom"/>
        <!--<property name="openjpa.InverseManager" value="true(Action=warn)"/> -->
      <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
       <property name="openjpa.jdbc.MappingDefaults" value="ForeignKeyDeleteAction=CASCADE"/>
    </properties>
    </persistence-unit>
</persistence>

Thank you in advance!

Carlos Bernardes
  • 473
  • 4
  • 10

1 Answers1

2
  1. Download and Install Apache Activemq 5.15 and run it.

  2. Run the Fineract platform using command, 'gradlew clean tomcatrunwar'

  3. Through Eclipse, connect to the already running Fineract server using 'Remote Debugging'

http://mail-archives.apache.org/mod_mbox/fineract-dev/201711.mbox/%3CCA+cniaRyYyMgbxpfkxTJYj_JdO61LnHrSbtkQN0JfQXqUxHZSw@mail.gmail.com%3E

Thilakraj
  • 63
  • 1
  • 10