1

Edit: Problem isn't solved - the behavour is:

Once the app gets offline in heroku because of inactive, it need at least one

heroku ps:scale web=0 
heroku ps:scale web=1

to get it fixed.

I was thinking about some initalitation-issues - i do:

Class Dao: POJO

Class Service - @ApplicationScoped, Dao gehts Injected and:

@PostConstruct
        currentTransaction.commit();
        currentSession.getSessionFactory().close();

@PreDestroy
        currentTransaction.commit();
        currentSession.getSessionFactory().close();

The Beans-Classes: @Named @RequestScoped or @ViewScoped

Service gets injected, and gets calles in And Logic is done in:

@PostConstruct

Maybe this is not related to this problem, but i want to post some more details. Does anyone maybe can point me into the right direction?


Old post:

i've been searching a long time but didn't find the right solution.

my project is running fine on TomEE 7.0.4 - but when i access the .xhtml in heroku, the following stacktrace appears:

org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke public void WEBPROJECT.ViewIndexManagedBean.init() on WEBPROJECT.ViewIndexManagedBean@5c2265d2
...
Caused by: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V
    at org.hibernate.engine.jdbc.connections.internal.PooledConnections.<init>(PooledConnections.java:36)
    at org.hibernate.engine.jdbc.connections.internal.PooledConnections.<init>(PooledConnections.java:20)
    at org.hibernate.engine.jdbc.connections.internal.PooledConnections$Builder.build(PooledConnections.java:161)
    at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.buildPool(DriverManagerConnectionProviderImpl.java:109)
    at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:72)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:242)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)
    at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:242)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)
    at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)
    at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418)
    at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691)
    at WEBPROJECT.dao.AbstractDao.getSessionFactory(AbstractDao.java:45)
    at WEBPROJECT.dao.AbstractDao.openCurrentSessionwithTransaction(AbstractDao.java:24)
    at WEBPROJECT.gui.service.Service.init(Service.java:50)
    ... 78 more

related parts The pom:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.github.jsimone</groupId>
                                    <artifactId>webapp-runner</artifactId>
                                    <version>8.5.11.2</version>
                                    <destFileName>webapp-runner.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
               <version>2.8.2</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.2.10.Final</version>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet</artifactId>
            <version>2.2.14.Final</version>
        </dependency>

        <!-- JSF api and impl -->
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.12</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.2.12</version>
        </dependency>

        <!-- servlet provided by tomcat -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>

WEB-INFO/lib:

enter image description here

Maybe its a version conflict, but with maven-tree i didn't see anything (double jars e.g.).

Maybe heroku isn't supporting Hibernate 5.x?

Thanks for your help, Best Regards

hansbobby
  • 21
  • 3

1 Answers1

1

Edit:

As edited in the original post the problem still remains, just gets temporarly fixes with scaling the dynos down and up.

Old post:

I "resolved" it by myself.

I was deploying the war with the maven plugin - when i tried it via heroku-cli

heroku war:deploy

it worked - i can't tell the reason, but maybe it will help others.

hansbobby
  • 21
  • 3