ClassNotFound when module A class deserializes class from module B and B depends on A in JBoss EAP 6

Solution Verified - Updated -

Issue

  • We are updating from JBoss EAP 4.x to JBoss EAP 6 and we have a utility jar which was in the JBoss lib directory which takes in a servlet request and deserializes it into an Hashtable. The Hashtable contains an object which exists in the war file, which is calling the utility class in JBoss lib. This is failing in JBoss EAP 6 because the war depends on the utility jar module, but the utility jar module is unable to see the war's module. The custom objects in the Hashtable are different for different wars, so we cannot put the class in the utility jar and cannot put dependencies from the utility jar to all of the wars. Please throw some idea on this context to resolve this issue so that we can upgrade our product to JBoss 6 EAP. The utility class looks like this:
public class Utility {
    private Hashtable hashTable;
    public void loadHashTableFromRequest(HttpServletRequest request) {
        try {
            java.io.ObjectInputStream ois = new java.io.ObjectInputStream(request.getInputStream());           
            hashTable = (java.util.Hashtable) (ois.readObject());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public Object getParameter(String key) {
        return hashTable.get(key);
    }

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In