Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7009853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:54:56+00:00 2026-05-27T21:54:56+00:00

I get an NotSerializableException when shutting down Glassfish (3.1), due to an HtmlSelectOneMenu .

  • 0

I get an NotSerializableException when shutting down Glassfish (3.1), due to an HtmlSelectOneMenu. I use HtmlSelectOneMenu in other controller beans, but they are not bound to the backing bean as this one. This happens only if there are sessions active on the server of course.

How can I avoid exception when starting/stopping Glassfish for the bounded JSF component ?

Controller Class

@ManagedBean
@SessionScoped
...

public class ActivityController implements Serializable {
    ..
    private DataModel<MyObjcet> items = null;
    private HtmlSelectOneMenu myMenu;
    ...

Exception

INFO: PWC2785: Cannot serialize session attribute activityController for session a4591e053e65effc743dade67eef
java.io.NotSerializableException: javax.faces.component.html.HtmlSelectOneMenu
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:2067)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
    at org.apache.catalina.session.StandardManager.writeSessions(StandardManager.java:699)
    at org.apache.catalina.session.StandardManager.doUnloadToFile(StandardManager.java:618)
    at org.apache.catalina.session.StandardManager.unload(StandardManager.java:589)
    at org.apache.catalina.session.StandardManager.stop(StandardManager.java:879)
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5509)
    at com.sun.enterprise.web.WebModule.stop(WebModule.java:529)
    at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1049)
    at com.sun.enterprise.web.WebContainer.unloadWebModule(WebContainer.java:2191)
    at com.sun.enterprise.web.WebContainer.unloadWebModule(WebContainer.java:2146)
    at com.sun.enterprise.web.WebApplication.stop(WebApplication.java:151)
    at org.glassfish.internal.data.EngineRef.stop(EngineRef.java:169)
    at org.glassfish.internal.data.ModuleInfo.stop(ModuleInfo.java:302)
    at org.glassfish.internal.data.ApplicationInfo.stop(ApplicationInfo.java:314)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:997)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.disable(ApplicationLifecycle.java:1952)
    at com.sun.enterprise.v3.server.ApplicationLoaderService.stopApplication(ApplicationLoaderService.java:443)
    at com.sun.enterprise.v3.server.ApplicationLoaderService.preDestroy(ApplicationLoaderService.java:411)
    at com.sun.hk2.component.AbstractCreatorInhabitantImpl.dispose(AbstractCreatorInhabitantImpl.java:83)
    at com.sun.hk2.component.SingletonInhabitant.release(SingletonInhabitant.java:81)
    at com.sun.hk2.component.EventPublishingInhabitant.release(EventPublishingInhabitant.java:108)
    at com.sun.hk2.component.LazyInhabitant.release(LazyInhabitant.java:133)
    at com.sun.enterprise.v3.server.AppServerStartup.stop(AppServerStartup.java:415)
    at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.stop(GlassFishImpl.java:88)
    at com.sun.enterprise.v3.admin.StopServer.doExecute(StopServer.java:70)
    at com.sun.enterprise.v3.admin.StopDomainCommand.execute(StopDomainCommand.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.run(CommandRunnerImpl.java:383)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:54:56+00:00Added an answer on May 27, 2026 at 9:54 pm

    Make it transient.

    private transient HtmlSelectOneMenu myMenu;
    

    This way the field will be skipped on (de)serialization. By the way, the DataModel is also not serializable.

    On the other hand, binding components directly to the backing bean is in most cases a smell. You should consider looking (or asking) for an alternative approach which does not require binding components to the bean.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If not, maybe you could tell me why. I get NotSerializableException when my class
.get() converts a jQuery object to a DOM element that Javascript can use without
Get error 'ClassLibrary3.Class1.a' is a 'property' but is used like a 'type' when i
Get a problem when installing java application as service in windows environment(Win 7). use
In Java all collections are serializable, but somehow I always get an exception when
I am trying to serialize an ArrayList of JSONObjects. But I get the error:
We get the following error; The request was aborted: Could not create SSL/TLS secure
I get an Access is Denied error message when I use the strong name
When I access a specific page of my Wicket application, I get a NotSerializableException:
//get var of posted info so user does not //have to reinsert if if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.