Question

Recently a co-worker and I started to experience a problem with our WebLogic development environments. Suddenly we can no longer deploy our project.

The application builds in Eclipse, but when we deploy to our local WebLogic instance we receive an IllegalArgumentException

SEVERE: Critical error during deployment: 
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
Caused by: javax.faces.FacesException: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
Caused by: java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalArgumentException: You have attempted to set a value of type class ca.<orgdomain>.domain.FolderTransactionType for parameter 1 with expected type of class ca.<orgdomain>.domain.FolderTransactionType from query string select result from TransactionFee result where result.folderTransactionType = ?1 .
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameterInternal(EJBQueryImpl.java:1202)

The key confusion point for me is that the "attemped" type and the "expected" type are identical.

(Possible Red-Herring)I'm not sure if it is relevant, but both of the affected systems are on different development branches (we forked a week ago), but we both started experiencing the problem today. Another developer on the same branch as me is not experiencing the problem.

Was it helpful?

Solution

As @kocko suggests, this is most likely a classloader issue.

The true runtime identity of an object type depends on the class, and the classloader that loaded it.

If your runtime framework has multiple (unrelated) classloaders, and you load the same class in two or more of them, then the end result is different classes that have the same name. Even if the code of the two "versions" of the class is identical.

Note that different "webapps" in the same JVM could well have different classloaders. If you have a situation where objects are being created by one webapp and passed to another, you can have problems with the types being incompatible.


Can you point me at some resources on how to track something like this down?

Here are some tips:

  • Get hold of the Class objects involved in the comparison, and confirm whether they are equal. If not check what their respective class names and classloaders are.

  • Examine all of the JAR files to see if the offending class is in multiple JARs.

  • Read the Weblogic documentation to see how it manages the classloaders. Then check the way that you have configured them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top