Troubleshooting
Problem
IBM Rational Application Developer for WebSphere Software reports ClassCastExceptions in a popup window at startup, or in the Error log when trying to perform Java EE related tasks, such as adding modules to an EAR, configuring Utility modules or setting Module Dependencies. These errors prevent you from compiling or building your projects.
Symptom
Java EE related tasks fail, and error messages similar to the following are seen in the workspace and or Error logs:
java.lang.ClassCastException: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl cannot be cast to org.eclipse.jst.javaee.application.Application
If you are using Maven to import projects, the error message may look like this:
!ENTRY org.eclipse.core.jobs
!MESSAGE An internal error occurred during: "Updating Maven Configuration".
!STACK 0
java.lang.ClassCastException: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl incompatible with org.eclipse.jst.javaee.application.Application
at org.maven.ide.eclipse.wtp.EarProjectConfiguratorDelegate.updateLibDir(Unknown Source)
at
org.maven.ide.eclipse.wtp.EarProjectConfiguratorDelegate.setModuleDependencies(Unknown Source)
Cause
The problem is caused if there is a mismatch between the EAR version configuration, and the EAR facet version installed in the project. This can happen if you use automated tasks to create and/or configure your projects.
Diagnosing The Problem
- Click on "View Menu" in the Enterprise explorer and select "Filters". Uncheck ".* resources" and press OK
- Open the files
org.eclipse.wst.common.project.facet.core.xml
andorg.eclipse.wst.common.component
in the .settings folder of your EAR project. - Compare this line in
org.eclipse.wst.common.project.facet.core.xml
:<installed facet="jst.ear" version="5.0"/>
with this line in
org.eclipse.wst.common.component
:<project-modules id="moduleCoreId" project-version="1.5.0">
Resolving The Problem
Ensure that the Installed Facet version compares to the Project Version.
Review the following table for reference.
To change the installed facet:
- Right-click on your EAR project
- Select Properties > Project Facets
- Change the EAR version number by using the drop down menu.
org.eclipse.wst.common.project.facet.core.xml | org.eclipse.wst.common.component |
<installed facet="jst.ear" version="6.0"/> | <project-modules id="moduleCoreId" project-version="1.6.0"> |
<installed facet="jst.ear" version="5.0"/> | <project-modules id="moduleCoreId" project-version="1.5.0"> |
<installed facet="jst.ear" version="1.4"/> | <project-modules id="moduleCoreId" project-version="1.4.0"> |
<installed facet="jst.ear" version="1.3"/> | <project-modules id="moduleCoreId" project-version="1.3.0"> |
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21474288