Skip to main content

9. JSF: Solving common problems

1. Target Unreachable, identifier [bean] resolved to null

When you reference a bean in a xhtml file with "#{bean.method}" and get this error, you should verify that:

  • The bean implements Serializable.
  • The references (javax.servlet-api.4.0.0, javax.faces.2.3.3,  javax.el.api.3.0.1, org.primefaces.6.1) have been selected in your pom.xml
  • You have created the files bean.xml and faces-config.xml in the webapp/WEB-INF folder
  • You have used the correct annotations from CDI  (javax.inject.Named and javax.enterprise.context.SessionScoped, ...) and not ManagedBean or jsf2.2 scopes.

2. Bean declaring a passivating scope must be passivation capable

This error causes server not starting and fills up the console with long chained exceptions. It is very annoying.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/OpenWebMaven]]
 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
 .....................
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/OpenWebMaven]]
 at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
 .....................
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000072: Bean declaring a passivating scope must be passivation capable.  Bean:  Managed Bean [class openadmin.util.lang.LangUtils] with qualifiers [@Default @Any @Named]
 at org.jboss.weld.bean.ManagedBean.checkType(ManagedBean.java:216)
 at org.jboss.weld.bean.AbstractBean.initializeAfterBeanDiscovery(AbstractBean.java:108)
 at org.jboss.weld.bean.ManagedBean.initializeAfterBeanDiscovery(ManagedBean.java:122)
...................

Dec 06, 2017 7:38:04 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
 ......
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
 at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:956)

This may be due to:

  • You have created a class annotated with @Named and @xxxscoped and is used as a utility class that only provides static methods.
  • A bean annotated with @Named and @xxxscoped has not been declared as "implements Serializable".
  • The solutions to previous error can be applied here.


3. Hibernate Validation annotations not used in DDL when creating entities

Hibernate JPA when is called from a Java Application, does not use Hibernate Validator annotations, but when used in a web environment they are used. See previous post or Stackoverflow.

4. Unexpected errors  that make you think they are due to compilation or deployment processes

We are using Maven with Eclipse Oxygen. Some problems have been solved this way:

1. Take care that the files are correctly located. See these posts:

    1.a Including additional files in Maven
    1.b Creating a Maven Project.

2. In web projects, we need somewhat powerful computers. So the process of creating war or jar files can be slow. The deployment process may sometimes crash or have some residual files from older builds. Sometimes the process of building the project may be blocked and other times the application server (Tomcat) has not been initialized well. So when something strange happens, you should follow this steps:

   2.a Stop server

   2.b Right-click on the project-> Run As -> Maven Clean. (Once it failed and I had to delete a configuration file I don't remember which one)

   2.c Right-click on the project-> Maven -> Update Project ->Select options as the next image


 Wait for a moment until the process has finished. Now you can run your project. Most of the problems should have disappeared.

  2.d If you continue having problems, make the servers window visible (Window-show View -Servers) and Right-click on the server and select:

    2.d.1 Clean Tomcat Work Directory and also:
    2.d.2 Clean

This should have solved nearly all your problems. (You have to wait for a moment too) and

2.e Restart Eclipse or maybe your computer.


3. Verify that the files are deployed well in the deployment folder. You can see where the deployment folder this way:  Right-click a xhtml file -> Run Configurations ->  Select the arguments tab and you can see the deployment folder



4.  @OneToOne or @ManyToOne on references an unknown entity


In my case, the unknown entity is NOT in the persistence.xml as:

<class>openadmin.model.control.ClassNameEdu </class>

And I have excluded the classes that are not here by means of this XML sentence

<exclude-unlisted-classes>true</exclude-unlisted-classes>

As I use several persistence units, I don't want the entities to be created in every persistence unit. I want them to be created only in its own persistence unit.


5.  Server fails to start with other projects deployed on the same server.


Remove all the projects from the server (except the project you want to execute) when your Run your application as "Run on server"  (Select undesired project and Use remove button)


6.  Server fails to start. Failed to start component .. Catalina. WELD-001414: Bean name is ambiguous. Name "anyName" resolves to beans managed Bean bean1 and managed bean bean2.

There are 2 beans with annotations @Named(value = "anyName") and have the same value in the annotation. So Tomcat rejects to start with 2 beans that have the same name reference. Change the value of the @Named annotation.


7.  Pom-xml Missing artifact com.sun.xml.ws:jaxws-ri:jar:2.3.0

In this case I have this reference in the pom.xml that Eclipse complains as:

        Missing artifact com.sun.xml.ws:jaxws-ri:jar:2.3.0

    <dependency>
      <groupId>com.sun.xml.ws</groupId>
      <artifactId>jaxws-ri</artifactId>
      <version>2.3.0</version>
    </dependency>

1. In StackOverflow is a possible solution to the problem. Basically Window - Show View - Other -Maven


Open Global Repositories and right-click on central (https://repo.mvane.apache.org/maven2)


Select Update Index and/or Rebuild Index

Take care that this operation can take a long time!!!

2. But the problem with this reference is that IT IS NOT A JAR. It should be referenced as another type,for instance pom

    <dependency>
      <groupId>com.sun.xml.ws</groupId>
      <artifactId>jaxws-ri</artifactId>
      <version>2.3.0</version>
      <type>pom</type>
    </dependency>



8.  SEVERE: A child container failed during start. java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@5b057c8c] at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)

The whole trace is:

SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@5b057c8c]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:947)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@5b057c8c]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
... 21 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:114)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
at java.base/java.util.zip.ZipFile$ZipFileInputStream.initDataOffset(ZipFile.java:751)
at java.base/java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:761)
at java.base/java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:407)
at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:159)
at java.base/java.io.InputStream.readAllBytes(InputStream.java:240)
at java.base/java.util.jar.JarFile.getBytes(JarFile.java:770)
at java.base/java.util.jar.JarFile.getManifestFromReference(JarFile.java:397)
at java.base/java.util.jar.JarFile.getManifest(JarFile.java:384)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:112)
... 34 more

Feb 16, 2018 6:38:21 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:947)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:956)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
... 13 more

Feb 16, 2018 6:38:21 PM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:956)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:671)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)

Feb 16, 2018 6:38:21 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Feb 16, 2018 6:38:21 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-nio-8009"]
Feb 16, 2018 6:38:21 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Catalina]
Feb 16, 2018 6:38:21 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-8080"]
Feb 16, 2018 6:38:21 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-nio-8009"]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/home/eduard/MyPrograms/apache-tomcat-9.0.1/lib/catalina.jar) to field java.lang.Thread.threadLocals
WARNING: Please consider reporting this to the maintainers of org.apache.catalina.loader.WebappClassLoaderBase
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Feb 16, 2018 6:38:21 PM org.apache.catalina.deploy.NamingResourcesImpl cleanUp
WARNING: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/OpenWebMaven]] so no cleanup was performed for that container
javax.naming.NamingException: No naming context bound to this class loader
at org.apache.naming.ContextBindings.getClassLoader(ContextBindings.java:268)
at org.apache.catalina.deploy.NamingResourcesImpl.cleanUp(NamingResourcesImpl.java:994)
at org.apache.catalina.deploy.NamingResourcesImpl.stopInternal(NamingResourcesImpl.java:977)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5341)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:293)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:842)
at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1044)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:322)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:842)
at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1044)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:322)
at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:553)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:322)
at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:860)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:322)
at org.apache.catalina.startup.Catalina.start(Catalina.java:675)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)


It is a bit strange problem, but it has occurred just after I changed hibernate version from 5.2.12.Final to 5.2.13.Final.

If I undo this change back to 5.2.12.Final in the pom.xml, the problem disappears.

    <!-- JPA 2.1 Provider -->
    <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>5.2.12.Final</version>
    </dependency>
    
    <!-- Envers for auditing the database -->
    <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-envers -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-envers</artifactId>
      <version>5.2.12.Final</version>
    </dependency>

<!-- Hibernate Testing !!! -->
    <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-testing -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-testing</artifactId>
      <version>5.2.12.Final</version>
      <scope>test</scope>
    </dependency>


9. SEVERE: javax.faces.component.UpdateModelException: javax.el.PropertyNotWritableException: Propiedad [id] no grabable para el tipo [openadmin.model.control.Role]

It is produced when the parameter passed to the setter of an attribute is not the same type as the attibute.


1
2
3
4
5
6
7
8
9
        @Getter 
 @Id
 @GeneratedValue(strategy = GenerationType.IDENTITY) 
 private Short id;
 

        public void setId(Number pId) {
  this.id = pId.shortValue();
 }

As we can see the setter receives a Number parameter, whilst the attribute is Short type.


10. ERROR: ERROR: relation "hibernate_sequence" does not exist
  Position: 17
javax.persistence.RollbackException: Error while committing the transaction

I have been googling around, but no solution obtained.

This error was caused when I am making a batch update to a Postgresql database. This is the process:

  1. I have previously created a Postgresql database long ago.
  2. I deleted the schema and created it again
  3. I try to make a batch process to insert some data 
  4. I begin a transaction
  5. I make all the inserts
  6. When I commit the transaction the exception raises.



Finally, I created a new database and a new schema and made this process in the new one and NO PROBLEM.!!!

I have tried to delete this database but I couldn't. The system complaints that there are some users using this database.

DO NOT mix JNDI connections (in Apache Tomcat) with local connections in the same database from different programs. This may cause the problem.!!  

It seems that JNDI uses other "hibernate_sequences" Here is an example of JNDI that is commented in the persistence.xml file


<persistence-unit name="control_post" transaction-type="RESOURCE_LOCAL">
      <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
      <!-- BEGIN: FOR Data Source in Tomcat JNDI 
      <jta-data-source>java:comp/env/control_post</jta-data-source>
           END:   FOR Data Source in Tomcat-->
      
      <class>openadmin.model.control.Access            </class>
      
      
      <exclude-unlisted-classes>true</exclude-unlisted-classes>
      
      <properties>
        <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
   <property name="hibernate.hbm2ddl.auto" value="update" />
   <property name="hibernate.show_sql" value="true" />      
         <!-- BEGIN: DataSource By Hibernate (NO TOMCAT JNDI) --> 
         <!-- property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/--> 
      
        <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/openweb" />
   <property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
   <property name="hibernate.connection.username" value="user" />
   <property name="hibernate.connection.password" value="password" /> 
   <!-- END:   DataSource By Hibernate (NO TOMCAT)  -->
      </properties>
   </persistence-unit>

Take into account that this is now working in a new database with hibernate 5.2.16 and postgres 42.2.4 versions without problems


The global trace error is

abr. 16, 2018 2:37:19 P. M. org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 0, SQLState: 42P01
abr. 16, 2018 2:37:19 P. M. org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: ERROR: relation "hibernate_sequence" does not exist
  Position: 17
javax.persistence.RollbackException: Error while committing the transaction
at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:77)
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:71)
at openadmin.dao.operation.DaoJpaEdu.commit(DaoJpaEdu.java:595)
at openadmin.util.configuration.FirstControlLoadYAML.dataLoad(FirstControlLoadYAML.java:84)
at openadmin.util.configuration.FirstControlLoadYAML.main(FirstControlLoadYAML.java:93)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:149)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)
at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:56)
... 4 more
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:69)
at org.hibernate.id.enhanced.SequenceStructure$1.getNextValue(SequenceStructure.java:95)
at org.hibernate.id.enhanced.NoopOptimizer.generate(NoopOptimizer.java:40)
at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:452)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:105)
at org.hibernate.jpa.event.internal.core.JpaSaveEventListener.saveWithGeneratedId(JpaSaveEventListener.java:56)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192)
at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:38)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177)
at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:32)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)
at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:691)
at org.hibernate.internal.SessionImpl.save(SessionImpl.java:683)
at org.hibernate.envers.internal.revisioninfo.DefaultRevisionInfoGenerator.saveRevisionData(DefaultRevisionInfoGenerator.java:76)
at org.hibernate.envers.internal.synchronization.AuditProcess.getCurrentRevisionData(AuditProcess.java:138)
at org.hibernate.envers.internal.synchronization.AuditProcess.executeInSession(AuditProcess.java:115)
at org.hibernate.envers.internal.synchronization.AuditProcess.doBeforeTransactionCompletion(AuditProcess.java:174)
at org.hibernate.envers.internal.synchronization.AuditProcessManager$1.doBeforeTransactionCompletion(AuditProcessManager.java:47)
at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:946)
at org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:521)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2413)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:473)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:156)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)
... 3 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation "hibernate_sequence" does not exist
  Position: 17
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60)
... 28 more
abr. 16, 2018 2:37:19 P. M. org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop
INFO: HHH10001008: Cleaning up connection pool [jdbc:postgresql://localhost:5432/openweb]


11. Load Session problem

SEVERE: Exception loading sessions from persistent storage
java.io.InvalidObjectException: Could not find a SessionFactory [uuid=35b05d3c-b74c-4e12-930c-45976bb01e44,name=null]

As refers Codo in Stack Overflow, we should NOT make Serializable the instances of Session, SessionFactory or DAO.

In my case, I have defined this Hibernate Class


public class DaoJpaEdu implements DaoOperationFacadeEdu, Serializable{
 

If I remove Serializable, this error disappears.



Comments

Popular posts from this blog

10. JSF How to access my resources files?

Sometimes it is really difficult to access any resources form different Java applications. So let's see some scenarios: 1. Executable jar application in a NO WEB environment. Take into account that this is not a JSF application !!! It is desired to have a property file outside the "jar file" so that we can change properties when needed. For instance, we will place the properties file in the same folder that the "jar file" lies. To access the folder where the jar is, the trick is to access the folder where the compiled classed are placed and scale 3 folders . (Oh! rather strange, if anybody knows a better idea.., he will be welcome). Here is a simple code. The name of the class containing the code is ThisClass, and we have created a Property class that feeds with a file in the same folder that the" jar file" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 /** * Gets the folder where resides the executable...

2. Create a Maven JSF project and a simple login page

Updated on Oct-25-2107 0. Introduction Remember to install previously: Java JDK 8 Eclipse Oxygen Lombok  Apache Tomcat 9 1. Create a Maven Project In the top menu select : File - New - Maven Project Press Next Now fill the next form as follows It is important to select: Group id: org.ximodante.jsf  (or another packet you like) Packaging: war Artifact Id and Name: JSFv02 or any name for the project Press Finish 2. The pom.xml file Eclipse complains about the simple generated file. It seems that a web.xml is required if the packaging is selected to war. The simple generated file is  1 2 3 4 5 6 7 8 9 <project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0.0 </modelVersion> <groupId> org.ximodante...