1

I am using JPA for my DB process with Tomcat. But I always get this warning from server.

WARNING: Cannot serialize session attribute com.sun.faces.application.view.activeViewMaps for session 41560BDF307FF26E0020EFD1E461AB1D
java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManagerImpl

How to solve this problem in my tomcat?

akhilless
  • 3,169
  • 19
  • 24
emreturka
  • 846
  • 3
  • 18
  • 44

1 Answers1

0

Assuming you do not actually need persistent sessions, you can fix this by disabling persistent sessions in Tomcat.

You can do this by adding the following to your application's context.xml file (or adding it to the server's context.xml).

<Manager pathname="" />

For example, here is a context.xml file created automatically for a server in Spring Tools Suite:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
        <Manager pathname="" />
        -->
    <!-- Uncomment this to enable Comet connection tacking (provides events
             on session expiration as well as webapp lifecycle) -->
    <!--
        <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
        -->
</Context>
Alan Hay
  • 22,665
  • 4
  • 56
  • 110