JBoss java.io.InvalidClassException: org.jboss.security.auth.callback.SecurityAssociationHandler; class invalid for deserialization

Just in case someone got this error:

class invalid for deserialization
(Line breaks added for readability).

I got this when deploying an EJB3 application that uses Hibernate 3 to JBoss Application Server version 5.1.0.GA. It also said:

Exception in thread "main"
failed on MarshalledValue
(Line breaks added for readability).

Semi-useful, if you're in a mood for euphemisms.

The problem

Image unrelated

JBossSX (which is a security framework) is a dependency coming from my jboss-as-ejb3 dependency (it's a Maven project that I'm creating).

jboss-as-ejb3 mixes up its jbosssx dependencies - it asks for 3 different versions (2.0.2.SP1, 2.0.2.SP2, 2.0.3.SP1). The earlier versions are known to have caused problems.

The fix

Therefore I decided to overwrite those Maven dependencies with my own. In other words, in my pom.xml, I added this:


It is explicitly provided by me and overrules the other ones. Fixed!

JBoss 5, EJB3 + Hibernate Maven pom.xml

That's the entire pom.xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0"
    <name>ejb Maven Webapp</name>

I hope this helps if someone is in need.

I am studying Hibernate using this book: Java Persistence with Hibernate
It helps me run this website if you purchase this book using this link. Thanks!


  1. Great Article android based projects

    Java Training in Chennai

    Project Center in Chennai

    Java Training in Chennai

    projects for cse

    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. Hello people! Professional college essay writers from https://essaysrescue.com/samedayessay-review/ will always provide you with high-quality support from the best authors you will find on the Internet. They work closely with you to provide the highest quality that includes all of the following