Community
Participate
Working Groups
Created attachment 129944 [details] Mavenized project to setup the eclipse project. Build ID: M20090211-1700 Steps To Reproduce: 1.Download the attached zip-file and unpack it to c:\project\ (or change the workspace entry in the outermost pom, then run mvn install eclipse:eclipse eclipse:add-maven-repo 2.Download Eclipse version: 3.4.2, and install plugin JBoss Tools 3.0. 3.Start Eclipse and select the workspace where the arplab project resides. 4.Import the project. Add a JBoss server. 5.Add the project to the server and try to publish. The following error message occur: Could not publish to the server. org.eclipse.jst.j2ee.application.internal.impl.ApplicationImpl cannot be cast to org.eclipse.jst.javaee.application.Application And in the log: 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.internal.archive.JavaEEArchiveUtilities.refineForJavaEE(JavaEEArchiveUtilities.java:334) at org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities.openArchive(JavaEEArchiveUtilities.java:304) at org.eclipse.jst.j2ee.internal.archive.JavaEEArchiveUtilities.openArchive(JavaEEArchiveUtilities.java:143) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper$ArchiveCache.openArchive(JavaEEBinaryComponentHelper.java:471) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.openArchive(JavaEEBinaryComponentHelper.java:343) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.getUniqueArchive(JavaEEBinaryComponentHelper.java:332) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.getArchive(JavaEEBinaryComponentHelper.java:325) at org.eclipse.jst.j2ee.internal.componentcore.JavaEEBinaryComponentHelper.getJavaEEQuickPeek(JavaEEBinaryComponentHelper.java:54) at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.isNestedJ2EEModule(J2EEFlexProjDeployable.java:654) at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.shouldIncludeUtilityComponent(J2EEFlexProjDeployable.java:157) at org.eclipse.wst.web.internal.deployables.ComponentDeployable.addUtilMembers(ComponentDeployable.java:353) at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.members(J2EEFlexProjDeployable.java:263) at org.eclipse.wst.server.core.internal.ModulePublishInfo.fill(ModulePublishInfo.java:398) at org.eclipse.wst.server.core.internal.ServerPublishInfo.fill(ServerPublishInfo.java:361) at org.eclipse.wst.server.core.internal.Server$13.visit(Server.java:2502) at org.eclipse.wst.server.core.internal.Server.visitModule(Server.java:2381) at org.eclipse.wst.server.core.internal.Server.visit(Server.java:2365) at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2499) at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:270) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) My application.xml looks like: <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5"> <display-name>Seam Registration</display-name> <module> <web> <web-uri>webapp-1.0-SNAPSHOT.war</web-uri> <context-root>/arplab</context-root> </web> </module> <module> <ejb>arp-1.0-SNAPSHOT.jar</ejb> </module> <module> <ejb>jboss-seam-2.1.1.CR1.jar</ejb> </module> </application> Note, if a remove the seam module entry it will publish, but then I manually have to add this entry where the file has been published. Any module that has a reference to a jar that is not a part of the project won't work. Version of jst: org.eclipse.jst.j2ee_1.1.206.v200902052030.jar Best regards, Thomas
this is a duplicate of bug 249594 https://bugs.eclipse.org/bugs/show_bug.cgi?id=249594
*** Bug 249594 has been marked as a duplicate of this bug. ***
note that a suggested fix is filed under bug 249594!
3.0.5 is shut down - moving to the next open development stream, which is 3.1.1.
Moving to WTP 3.2, but a lot of work has been done in this area. Is this still a problem?
(In reply to comment #5) > Moving to WTP 3.2, but a lot of work has been done in this area. Is this still > a problem? I'll upgrade and check if it still a problem during the day.
This is still a problem. It occurs if your JEE modules are using descriptors for different JEE versions. This should cause that bug: application.xml <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/application_5.xsd" xmlns="http://java.sun.com/xml/ns/javaee" version="1.5" > ejb-jar.xml <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
I'm assigning this to jsholl as he's much more familiar with the IArchive stuff than I am.
This fell off my radar. This appears to be a simple mismatch of the archive version. The fix should be simple; something along the lines as mentioned in bug 249594. Targeting for WTP 3.2.1
Routing over to you Rob. Seems that this is not reproducible without the JBoss Tools and I'm not sure what the licensing implications are for me to install those. This may have already been fixed in 3.2 with bug 296342
I have elaborated with this bug and I have located and fixed the problem for OUR project setup. The classcastexception is one issue, but fixing this by adding an instanceof check in the if statement only results in that we don't get a classcastexception, the jars still doesn't get published. I looked a bit deeper into it, and to publish our ejb jars that don't is a part of the project I never call the refineForJavaEE method. I no too little to be able to file a proper patch, but if I can help you in any other way, I'm glad to do so.
Rob, since 3.2.2 is declaring, I am retargetting to 3.2.3. Please retarget as appropriate.
Retargeting bugs that won't make it into 3.2 maintenance
Since some people are still experiencing this problem, I thought it'd be a good idea to point out comment 7 still has the relevant information here. This bug is caused when your project's facet version differs from the version specified in the descriptor of your module. So if your module is a web 2.5 project or has the jst.web 2.5 facet, and it has a web.xml that says version="2.4", this bug will occur. As comment 11 stated, the code here is really complicated and the previous master of the responsible code has been mostly re-assigned. This is a hard one to patch, but since there's still a workaround available, this isn't a priority for us to fix unless someone contributes a patch. Even if someone could provide a valid usecase where they require a 2.5 facet and a 2.4-versioned descriptor (doubtful, I believe), I'm afraid this bug probably still won't get resolved without a contributor patch.
Sad to say, but without community assistance or further input, this is being delayed indefinitely.
Same problems here 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.classpathdep.ClasspathDependencyUtil.getPotentialComponentClasspathDependencies(ClasspathDependencyUtil.java:220) at org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator.validateInJob(ClasspathDependencyValidator.java:93) at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:78) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) eclipse.buildId=M20130204-1200 java.version=1.6.0_22 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=it_IT 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