Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl
Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #500671] Fri, 27 November 2009 12:46 Go to next message
Luiz Abrahao is currently offline Luiz AbrahaoFriend
Messages: 3
Registered: November 2009
Junior Member
Hello,

My eclipse throws loads of this exception every time I try to do anything, e.g. If try to click on a project with the right button.

java.lang.ClassCastException: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl cannot be cast to org.eclipse.jst.javaee.application.Application
	at org.eclipse.jst.j2ee.project.EarUtilities.getEARLibDir(EarUtilities.java:363)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.getBaseEARLibRefs(J2EEComponentClasspathContainer.java:321)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.update(J2EEComponentClasspathContainer.java:211)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.install(J2EEComponentClasspathContainer.java:351)
	at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathInitializer.initialize(J2EEComponentClasspathInitializer.java:29)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2608)
	at org.eclipse.jdt.internal.core.JavaModelManager$11.run(JavaModelManager.java:2514)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2554)
	at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1773)
	at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:2652)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2578)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2679)
	at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1866)
	at org.eclipse.jdt.internal.core.JavaProject.isOnClasspath(JavaProject.java:2169)
	at org.eclipse.jdt.internal.ui.BuildpathIndicatorLabelDecorator.getOverlay(BuildpathIndicatorLabelDecorator.java:47)
	at org.eclipse.jdt.internal.ui.BuildpathIndicatorLabelDecorator.decorate(BuildpathIndicatorLabelDecorator.java:34)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:269)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Session Data:
eclipse.buildId=M20090917-0800
java.version=1.6.0_17
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product


It's been impossible to work lately. I downloads a new eclipse and "started over again" but I get the same exceptions. I guess it is something related with my projects.

I'm trying to attach the session's log but the upload feature is not working for me.

Any help is appreciated as I'm stuck and can't work at all.

Regards,
Luiz Abrahao
Re: Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #500688 is a reply to message #500671] Fri, 27 November 2009 14:09 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
Luiza Abrahao a écrit :
> It's been impossible to work lately. I downloads a new eclipse and
> "started over again" but I get the same exceptions. I guess it is
> something related with my projects.
> I'm trying to attach the session's log but the upload feature is not
> working for me.
> Any help is appreciated as I'm stuck and can't work at all.
Open a bug report against WebTools. This is the best way to get this
investigated and fixed.
--
Olivier
Re: Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #500913 is a reply to message #500688] Mon, 30 November 2009 09:48 Go to previous messageGo to next message
Luiz Abrahao is currently offline Luiz AbrahaoFriend
Messages: 3
Registered: November 2009
Junior Member
Thank you for your reply Oliver.

I opened the bug report. I'm afraid nobody will put much (or any) effort on it though.

It's difficult to replicate and as far as I know it's not a problem many people come across.

For me it's critical as I'm not able to work and I ran out of things to do that are not related with eclipse. Now I'm literally stuck watching my deadlines passing by. Sad

Thanks,
Luiz
Re: Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #500981 is a reply to message #500913] Mon, 30 November 2009 14:58 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
Luiz Abrahao a écrit :
> I opened the bug report. I'm afraid nobody will put much (or any) effort
> on it though.
> It's difficult to replicate and as far as I know it's not a problem many
> people come across.
> For me it's critical as I'm not able to work and I ran out of things to
> do that are not related with eclipse. Now I'm literally stuck watching
> my deadlines passing by. :(
Why don't you try to patch it yourself ? This is the magic of open source.
--
Olivier
Re: Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #501016 is a reply to message #500981] Mon, 30 November 2009 17:02 Go to previous messageGo to next message
Luiz Abrahao is currently offline Luiz AbrahaoFriend
Messages: 3
Registered: November 2009
Junior Member
Hi Oliver,

I wish I had the knowledge to do so.

Carl Anderson found the root of the problem.

My EAR module had the EAR 1.3 facet installed when the application descriptor had the version attribute set to 5. So, as far as I understood, if you don't keep the facet and the descriptor in sync this problem happens.

Thanks,
Luiz
Re: Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #515962 is a reply to message #501016] Mon, 22 February 2010 11:11 Go to previous messageGo to next message
BangiMang  is currently offline BangiMang Friend
Messages: 1
Registered: February 2010
Junior Member
I guess you might have found a solution for this problem, I encountered a same problem and fixed it by changing couple of configuration on my eclipse project

<workspace-dir>/<project>/.settings/org.eclipse.wst.common.project.facet.core.xml

should change the following
<installed facet="jst.ear" version="1.4"/>
to
<installed facet="jst.ear" version="5.0"/>


and also in the same folder
there is a file called org.eclipse.wst.common.component
should change the following
<project-modules id="moduleCoreId" project-version="1.4.0">
to
<project-modules id="moduleCoreId" project-version="1.5.0">


Hope it would help.
Cheers
Re: Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #537429 is a reply to message #515962] Wed, 02 June 2010 12:39 Go to previous messageGo to next message
Manogna  is currently offline Manogna Friend
Messages: 1
Registered: June 2010
Junior Member
I got the same problem I changed the facet from 1.4 to 5.0
<installed facet="jst.ear" version="5.0"/>


project-version="1.5.0"> in .XXX.XXX.XXX.common componet file.

The exception is as-
java.lang.ClassCastException: org.eclipse.jst.j2ee.application.internal.impl.ApplicationIm pl cannot be cast to org.eclipse.jst.javaee.application.Application
at org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities .refineForJavaEE(JavaEEArchiveUtilities.java:352)
at org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities .openArchive(JavaEEArchiveUtilities.java:322)
at org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities .openBinaryArchive(JavaEEArchiveUtilities.java:243)
at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComp onentHelper$ArchiveCache.openArchive(JavaEEBinaryComponentHe lper.java:497)
at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComp onentHelper.openArchive(JavaEEBinaryComponentHelper.java:360 )
at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComp onentHelper.getUniqueArchive(JavaEEBinaryComponentHelper.jav a:349)
at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComp onentHelper.getArchive(JavaEEBinaryComponentHelper.java:342)
at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComp onentHelper.getJavaEEQuickPeek(JavaEEBinaryComponentHelper.j ava:54)
at org.eclipse.jst.jee.internal.deployables.JEEFlexProjDeployab le.isNestedJ2EEModule(JEEFlexProjDeployable.java:133)
at org.eclipse.jst.jee.internal.deployables.JEEFlexProjDeployab le.shouldIncludeUtilityComponent(JEEFlexProjDeployable.java: 116)
at org.eclipse.wst.web.internal.deployables.ComponentDeployable .addUtilMembers(ComponentDeployable.java:353)
at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeploy able.members(J2EEFlexProjDeployable.java:256)
at org.eclipse.jst.server.generic.core.internal.publishers.Abst ractModuleAssembler.copyModule(AbstractModuleAssembler.java: 170)
at org.eclipse.jst.server.generic.core.internal.publishers.EarM oduleAssembler.assemble(EarModuleAssembler.java:45)
at org.eclipse.jst.server.generic.core.internal.publishers.AntP ublisher.assembleModule(AntPublisher.java:167)
at org.eclipse.jst.server.generic.core.internal.publishers.AntP ublisher.publish(AntPublisher.java:128)
at org.eclipse.jst.server.generic.core.internal.GenericServerBe haviour.publishModule(GenericServerBehaviour.java:82)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.pu blishModule(ServerBehaviourDelegate.java:949)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.pu blishModules(ServerBehaviourDelegate.java:1039)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.pu blish(ServerBehaviourDelegate.java:872)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.pu blish(ServerBehaviourDelegate.java:708)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Serv er.java:2731)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(S erver.java:278)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: Cast Exception: org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl [message #541239 is a reply to message #515962] Fri, 18 June 2010 20:45 Go to previous message
KK  is currently offline KK Friend
Messages: 1
Registered: June 2010
Junior Member
works great for me, thank you.
Previous Topic:One Bundle that Includes Java EE and Java ME
Next Topic:Type parameter is not within its bound
Goto Forum:
  


Current Time: Wed Apr 24 20:49:57 GMT 2024

Powered by FUDForum. Page generated in 0.03193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top