java - Differences when running Tomcat from within Intellij IDEA? -


i have bizarre problem spring 3.5, webflow 2.2 application, running in tomcat (6.0.32)

part of webflow calls retrieve list of objects. list placed in viewscope object use jsp view. each object in list inherits base class contains common fields.

the webflow forwards jsp view displays contents of list, writing out objects.

when run stand-alone tomcat, fields on base class somehow set null. have debugged , confirmed list built correctly code called webflow . somewhere between putting list webflow view scope, , later being retrieved jsp, base class fields being reset null.

the bizarre part of problem app runs if start , run tomcat within intellij idea. i've tried various jdks , tomcat versions, , have same issue.

it appears webflow problem (improper serialization maybe?) that's sensitive whether tomcat has been started within intellij.

what intellij doing cause java serialization misbehave?

well, haven't found exact underlying cause, have work-around. implemented custom object serialization methods - private void writeobject() , readobject() - on objects being mysteriously not serialized properly, , started working. there couple of simple types (couple of longs , string) in base class, it's nothing complex.

just clarify (in case 1 interessted) - had data object used form in web-app. object contains map of attribute objects, each attribute object based on class hierarchy this:

attribute class -> shared base class -> root base class

all data gets persisted byte-array spring web-flow, un-persisted when web-flow calls view. in case, fields of root base class not being persisted default mechanism.

i still don't know exactly why though. , still don't know why, when started tomcat within intellij, serialization worked expected. strange.


update: found culprit. bad ant build script hiding missing "serializable" interface marker.

the system in question quite large, , has nasty, hard-to-follow ant build script. i'd assumed doing full, proper clean build. in class hierarchy showed above, attribute class , root base class in different jars. , jar containing root base class in fact being cached , not rebuilt properly.

the older (incorrect) version of base class being deployed did not have "serializable" marker interface (the attribute class did). of course, fields not being serialized. when tested within intellij, doing build , deploy directly sources.

i feel dumb now.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -