IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 15 replies
  • Latest Post - ‏2013-12-05T08:26:04Z by i.iliev
iloncar
iloncar
4 Posts

Pinned topic Problem: partial deploy of maven app with WDT 9 beta

‏2013-08-08T08:45:31Z |

Hi!

We have a problem deploying application on WAS 8.5.5 using WDT 9 beta, but this problem happens with other versions of WDT also.

When we deploy applications on a server with publishing option set to Run server with resources within workspace application is partially deployed.

I have checked .metadata\.plugins\org.eclipse.wst.server.core\tmp0\Lynx-Web\WEB-INF\lib contents and some jars are missing, most noteably spring-web-3.2.2.RELEASE.jar - which means that this application will not work.

When we deploy applications with publishing option set to Run server with resources on server application deploys fine. When we build or export EAR the built EAR contains WAR with all libraries specified by maven. 

 

 

I would like to know is this a known problem and is there some workaround.

I would be grateful if someone could give me a hint how to trace cause of this problem.

 

 

One application is multi module maven project that has following structure:

  • parent project
    • ear project
    • web project
    • java project

The other application is not so tightly connected and consists of:

  • ear project
  • war project
  • shared java project

 

 

 

  • StevenHung
    StevenHung
    21 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-08T17:16:03Z  

    Thank you for reporting this problem. We are aware of this issue and we have a defect tracking this problem.

    For workaround, I would recommend using "Run server with resources on server". Alternatively, you could also copy the missing jars into: .metadata\.plugins\org.eclipse.wst.server.core\tmp0\Lynx-Web\WEB-INF\lib

  • iloncar
    iloncar
    4 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-12T15:26:19Z  

    Thank you for reporting this problem. We are aware of this issue and we have a defect tracking this problem.

    For workaround, I would recommend using "Run server with resources on server". Alternatively, you could also copy the missing jars into: .metadata\.plugins\org.eclipse.wst.server.core\tmp0\Lynx-Web\WEB-INF\lib

    Thanks for feedback. Is there a way to track progress on the issue so that we know when it gets fixed?

  • bjezze
    bjezze
    1 Post

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-16T09:09:15Z  

    Thank you for reporting this problem. We are aware of this issue and we have a defect tracking this problem.

    For workaround, I would recommend using "Run server with resources on server". Alternatively, you could also copy the missing jars into: .metadata\.plugins\org.eclipse.wst.server.core\tmp0\Lynx-Web\WEB-INF\lib

    We also have the same problem and it would be great to have som way of tracking the progress! /regards J

  • e_yuen
    e_yuen
    27 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-16T14:47:15Z  
    • bjezze
    • ‏2013-08-16T09:09:15Z

    We also have the same problem and it would be great to have som way of tracking the progress! /regards J

    For tracking the status of individual APAR fixes, please use the formal IBM support channel.

  • iloncar
    iloncar
    4 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-19T05:26:38Z  
    • e_yuen
    • ‏2013-08-16T14:47:15Z

    For tracking the status of individual APAR fixes, please use the formal IBM support channel.

    @e_yuen: this might be official answer but trust me, IBM should revisit it's policies, sometimes people run away when they see answer like this.

    I expected so much more.

     

     

  • e_yuen
    e_yuen
    27 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-19T14:03:57Z  
    • iloncar
    • ‏2013-08-19T05:26:38Z

    @e_yuen: this might be official answer but trust me, IBM should revisit it's policies, sometimes people run away when they see answer like this.

    I expected so much more.

     

     

    I understand that we want information quickly and easily and we are striving for that.  I'd like to shared if there is more that I can.  All I can say is it is on our priority list.  Unfortunately, there are legal implications behind it so we can't discuss on future plans.  I hope you'll understand.

    Elson

  • rsanchezh
    rsanchezh
    26 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-19T21:23:18Z  

    Hello,

    Another work around is to make the web project a single-rooted project. In order to do this, the output folder of the web project should be set to  \src\main\webapp\WEB-INF\classes, instead of  target\classes. The following lines can be added to the pom.xml

    <outputDirectory>${project.basedir}\src\main\webapp\WEB-INF\classes</outputDirectory>

    <testOutputDirectory>${project.basedir}\src\main\webapp\WEB-INF\classes</testOutputDirectory>

    Then you can update your project (Maven > Update project) and the default output folder should change in the java build path.

    If you do not want to change the output folder in your command line build, but only when working in RAD, then you could experiment using profiles and properties: set the output directory to a property, and set the value of that property to \src\main\webapp\WEB-INF\classes if running with a profile that is active only when building from RAD, and set it to \target\classes in other cases, perhaps using the m2e profile, something like this:

    <profile>
       <id>m2e</id>
       <activation>
          <property>
             <name>m2e.version</name>
          </property>
       </activation>
       <properties>
          <radOutputFolder>
    \src\main\webapp\WEB-INF\classes</radOutputFolder>
       </properties>
    </profile>
    

    This is just an idea, I have not tested it.

    Another advantage of making the web project single-rooted is an improved performance of the deploy operation.

    Hope this helps.

  • iloncar
    iloncar
    4 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-27T11:05:36Z  
    • rsanchezh
    • ‏2013-08-19T21:23:18Z

    Hello,

    Another work around is to make the web project a single-rooted project. In order to do this, the output folder of the web project should be set to  \src\main\webapp\WEB-INF\classes, instead of  target\classes. The following lines can be added to the pom.xml

    <outputDirectory>${project.basedir}\src\main\webapp\WEB-INF\classes</outputDirectory>

    <testOutputDirectory>${project.basedir}\src\main\webapp\WEB-INF\classes</testOutputDirectory>

    Then you can update your project (Maven > Update project) and the default output folder should change in the java build path.

    If you do not want to change the output folder in your command line build, but only when working in RAD, then you could experiment using profiles and properties: set the output directory to a property, and set the value of that property to \src\main\webapp\WEB-INF\classes if running with a profile that is active only when building from RAD, and set it to \target\classes in other cases, perhaps using the m2e profile, something like this:

    <pre dir="ltr"><profile> <id>m2e</id> <activation> <property> <name>m2e.version</name> </property> </activation> <properties> <radOutputFolder> \src\main\webapp\WEB-INF\classes</radOutputFolder> </properties> </profile> </pre>

    This is just an idea, I have not tested it.

    Another advantage of making the web project single-rooted is an improved performance of the deploy operation.

    Hope this helps.

    @rsanchezh

    I have tried:

        <profiles>
            <profile>
                <id>m2e</id>
                <activation>
                    <property>
                        <name>m2e.version</name>
                    </property>
                </activation>
                <properties>
                    <build.out>src/main/webapp/WEB-INF/classes</build.out>
                    <build.testout>src/main/webapp/WEB-INF/classes</build.testout>
                </properties>
            </profile>
            <profile>
                <id>normal</id>
                <activation>
                    <property>
                        <name>!m2e.version</name>
                    </property>
                </activation>
                <properties>
                    <build.out>target/classes</build.out>
                    <build.testout>target/test-classes</build.testout>
                </properties>
            </profile>
        </profiles>

        <build>
            <outputDirectory>${project.basedir}/${build.out}</outputDirectory>
            <testOutputDirectory>${project.basedir}/${build.testout}</testOutputDirectory>

     

    yet It doesn't work. I have to run app with resources on server...

  • rsanchezh
    rsanchezh
    26 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-08-27T14:23:36Z  
    • iloncar
    • ‏2013-08-27T11:05:36Z

    @rsanchezh

    I have tried:

        <profiles>
            <profile>
                <id>m2e</id>
                <activation>
                    <property>
                        <name>m2e.version</name>
                    </property>
                </activation>
                <properties>
                    <build.out>src/main/webapp/WEB-INF/classes</build.out>
                    <build.testout>src/main/webapp/WEB-INF/classes</build.testout>
                </properties>
            </profile>
            <profile>
                <id>normal</id>
                <activation>
                    <property>
                        <name>!m2e.version</name>
                    </property>
                </activation>
                <properties>
                    <build.out>target/classes</build.out>
                    <build.testout>target/test-classes</build.testout>
                </properties>
            </profile>
        </profiles>

        <build>
            <outputDirectory>${project.basedir}/${build.out}</outputDirectory>
            <testOutputDirectory>${project.basedir}/${build.testout}</testOutputDirectory>

     

    yet It doesn't work. I have to run app with resources on server...

    If after modifying the pom.xml (and updating the project using Maven > Update project) , you see warnings in the Markers view regarding broken single root rules, then you might need to correct those problems as well. If you are still interested in making the project single root, please share the warnings you see in the markers, view.

  • i.iliev
    i.iliev
    3 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-11-28T08:39:59Z  

    Hi,

    I've just found this topic by coincidence. We had similar problem and we've switched to "Publish with resources on server". This option works well, until we release our project and change the versions (using maven release). After this point we must run "Clean" on the server to get consistent re-deployment of the application. We use the maven names in the artifacts unchanged, means we have in the deployment folder ejb-1.0.0-SNAPSHOT.jar, web-1.0.0-SNAPSHOT.war folder, etc. These will be changed to the corresponding 1.1.0-SNAPSHOT versions after a release. Can you please share, if you experience this issue as well - it will be interesting to find out if this is related to our project only or if this is a general issue. We have the project structure as in your first case, but with many more java util projects.

    TIA

  • StevenHung
    StevenHung
    21 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-11-28T16:44:48Z  
    • iloncar
    • ‏2013-08-12T15:26:19Z

    Thanks for feedback. Is there a way to track progress on the issue so that we know when it gets fixed?

    This problem has now been fixed in WDT 8.5.5.1. You can get this fix by downloading WDT 8.5.5.1 via the Eclipse Marketplace.

    When using "Run server with resources within workspace" on WDT 8.5.5.1 and the single root rule broken (e.g. the Maven case), the server will now have the correct references to these web fragment jars.

    Note: the application will still work despite the web fragment jars not being copied to the metadata directory (e.g. spring-web-3.2.2.RELEASE.jar won't be copied to <workspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\Lynx-Web\WEB-INF\lib)

  • StevenHung
    StevenHung
    21 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-11-28T16:47:27Z  
    • i.iliev
    • ‏2013-11-28T08:39:59Z

    Hi,

    I've just found this topic by coincidence. We had similar problem and we've switched to "Publish with resources on server". This option works well, until we release our project and change the versions (using maven release). After this point we must run "Clean" on the server to get consistent re-deployment of the application. We use the maven names in the artifacts unchanged, means we have in the deployment folder ejb-1.0.0-SNAPSHOT.jar, web-1.0.0-SNAPSHOT.war folder, etc. These will be changed to the corresponding 1.1.0-SNAPSHOT versions after a release. Can you please share, if you experience this issue as well - it will be interesting to find out if this is related to our project only or if this is a general issue. We have the project structure as in your first case, but with many more java util projects.

    TIA

    Can you please install WDT 8.5.5.1 and see if this fixes your problem? You can download WDT 8.5.5.1 via the Eclipse Marketplace.

  • i.iliev
    i.iliev
    3 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-12-03T17:16:48Z  

    Can you please install WDT 8.5.5.1 and see if this fixes your problem? You can download WDT 8.5.5.1 via the Eclipse Marketplace.

    Hi,

    thanks for the info. I've tried it in a clean Kepler SR1 install, fresh maven import and I've switched to "Server with resources in the workspace" - it looks ok now. As pointed already the dependencies in the  <workspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 folder won't be updated, however the latest releases are picked correctly. May be someone can provide an additional info how this works and more important how / where the dependencies in use can be verified.

     

  • StevenHung
    StevenHung
    21 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-12-03T22:51:08Z  
    • i.iliev
    • ‏2013-12-03T17:16:48Z

    Hi,

    thanks for the info. I've tried it in a clean Kepler SR1 install, fresh maven import and I've switched to "Server with resources in the workspace" - it looks ok now. As pointed already the dependencies in the  <workspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 folder won't be updated, however the latest releases are picked correctly. May be someone can provide an additional info how this works and more important how / where the dependencies in use can be verified.

     

    When using the mode "Run server with resources within workspace", WebSphere Application Server (WAS) will look at a file to determine the location of the application in your workspace.

    If you go to your <workspace directory>\.metadata\.plugins\com.ibm.etools.wrd.websphere.v<WAS version>\looseconfigurations\<server name>\<application name>, you will find a file named looseconfig.xmi.

    This file will reference the web fragment jars, so you will know what the server will be looking at (and where these jars are located). Prior to this fix, this file would not reference the web fragment jars, so it would fail.

  • i.iliev
    i.iliev
    3 Posts

    Re: Problem: partial deploy of maven app with WDT 9 beta

    ‏2013-12-05T08:26:04Z  

    When using the mode "Run server with resources within workspace", WebSphere Application Server (WAS) will look at a file to determine the location of the application in your workspace.

    If you go to your <workspace directory>\.metadata\.plugins\com.ibm.etools.wrd.websphere.v<WAS version>\looseconfigurations\<server name>\<application name>, you will find a file named looseconfig.xmi.

    This file will reference the web fragment jars, so you will know what the server will be looking at (and where these jars are located). Prior to this fix, this file would not reference the web fragment jars, so it would fail.

    Hi Steven,

     

    thanks for the info - yes, everything looks correctly updated in the file! So, at least for my project / tests it seems that this is fixed.