[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-4817) WTP EAR deployers don't work correctly when using some classpath containers (Maven, for instance)

Rob Stryker (JIRA) jira-events at lists.jboss.org
Mon Aug 24 20:10:23 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBIDE-4817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12482551#action_12482551 ] 

Rob Stryker commented on JBIDE-4817:
------------------------------------

There seemed to be several problems here. After importing the projects, several had problems as they did not have a JRE / JDK on their build path. So none of them new what Object or String were.

The web project's component.xml contained the following text:

<wb-module deploy-name="booking">
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>

Clearly this is wrong.  I am not sure why it was present so often but i suspect m2eclipse is doing something it should not be doing when it's adding a reference. 

Third, the problems view has the following error on the web project:

Cannot nest 'booking/src/main/webapp/WEB-INF/classes' inside 'booking'. To enable the nesting exclude 'src/' from 'booking'

When I deploy, I don't see the web app at all most likely because of this error. 

The Web application seems to be doing many many many odd and bad things. After closing and re-opening the web project, I see this stack trace below. (Only root cause shown)


Caused by: Java Model Exception: Java Model Status [Source folder 'src/main/java' in project 'booking' cannot output to library 'src/main/webapp/WEB-INF/classes']
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:784)
at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2873)
at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2904)
at org.eclipse.jst.j2ee.project.facet.J2EEFacetInstallDelegate.addToClasspath(J2EEFacetInstallDelegate.java:62)
at org.eclipse.jst.j2ee.web.project.facet.WebFacetInstallDelegate.execute(WebFacetInstallDelegate.java:166)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1467)

This implies that the project is attempting to output its class files to somewhere in the src/main folder tree, which is blatently not allowed as it would cause infinite recursion. (Anything in src gets coppied to the build output folder, so if the output folder is also in the source folder, it leads to problems).  What would be better is if your output folder was somewhere else in the project, but your component.xml file linked this build output folder to be in the WEB-INF/classes inside the deployment

As a note, every time i close and re-open the web project, this line is added to the component.xml file. Eventually there are dozens and dozens:

<wb-resource deploy-path="/" source-path="/src/main/webapp"/>



> WTP EAR deployers don't work correctly when using some classpath containers (Maven, for instance)
> -------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-4817
>                 URL: https://jira.jboss.org/jira/browse/JBIDE-4817
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: JBossAS, UpStream
>    Affects Versions: 3.1.0.M2
>            Reporter: Snjezana Peco
>            Assignee: Rob Stryker
>
> Try the example described in https://jira.jboss.org/jira/browse/JBIDE-4736?focusedCommentId=12482337#action_12482337
> If you try to deploy the booking-ear application, libraries in booking/WEB-INF/lib won't be deployed.
> booking/.settings/org.eclipse.wst.common.component contains the following:
> <?xml version="1.0" encoding="UTF-8"?>
> <project-modules id="moduleCoreId" project-version="1.5.0">
>     <wb-module deploy-name="booking">
>         <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
>         <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
>         <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/resources"/>
>         <property name="context-root" value="booking"/>
>         <property name="java-output-path"/>
>     </wb-module>
> </project-modules>
> if you call Maven>Update Project Configuration, booking/.settings/org.eclipse.wst.common.component will look as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <project-modules id="moduleCoreId" project-version="1.5.0">
>     <wb-module deploy-name="booking">
>         <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
>         <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
>         <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/resources"/>
>         <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
>         <property name="context-root" value="booking"/>
>         <property name="java-output-path"/>
>     </wb-module>
> </project-modules>
> the libraries in booking/WEB-INF/lib will be deployed correctly.
> The problem exists when using JBoss Tools servers as well as using JBoss WTP Generic servers.
> The problem doesn't exist when using Export>Java EE>EAR File.
> PS
> The WEB-INF/lib directory and the required libraries are unnecessary added to the EAR's root directory, but this issue is fixed with the patch attached to https://bugs.eclipse.org/bugs/show_bug.cgi?id=247090.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list