This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 207094 - @SessionScoped bean must be Serializable
Summary: @SessionScoped bean must be Serializable
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: CDI (show other bugs)
Version: 7.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-10 01:08 UTC by arungupta
Modified: 2012-01-17 16:12 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arungupta 2012-01-10 01:08:30 UTC
A @SessionScoped must be marked serializable otherwise the deployment gives the following error:

 Error occurred during deployment: Exception while loading the app : WELD-000072 Managed bean declaring a passivating scope must be passivation capable.  Bean:  Managed Bean [class org.javaee6.samples.twitter.FormInput] with qualifiers [@Any @Default @Named]. Please see server.log for more details.
The module has not been deployed.
See the server log for details.
	at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:179)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:131)
	at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:211)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

This should be shown as WARNING in the editor.
Comment 1 Denis Anisimov 2012-01-10 07:06:24 UTC
If managed bean is created via wizard with appropriate scope ( JavaServer Faces -> JSF Managed Bean with beans.xml existing ) it implements Serializable.

So this request is about  custom Java class with SessionScoped annotation ( some normal scopes should be also considered as well ).
The Editor warning or error should be attached. 
This is similar to planned enhancements for CDI : http://wiki.netbeans.org/CDIFeatures72. 
I will add it to this list.
Comment 2 Denis Anisimov 2012-01-13 10:03:32 UTC
See related issue #188995 .
So here is exact requirement for the issue :
managed bean declaring a passivating scope must be passivation
capable.

Here is a definition of passivating scope :
Passivating scope is the scope annotated by @NormalScope(passivating=true).
There are two built-in passivating scopes : session and conversation.

The editor mark should be not a WARNING but ERROR.
Comment 3 Denis Anisimov 2012-01-16 13:17:13 UTC
web-main#d45aea65aebf
Comment 4 Quality Engineering 2012-01-17 16:12:25 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/d45aea65aebf
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#207094 - @SessionScoped bean must be Serializable