Topic
13 replies Latest Post - ‏2012-10-29T03:04:01Z by SystemAdmin
SystemAdmin
SystemAdmin
590 Posts
ACCEPTED ANSWER

Pinned topic Maven structured webapps cannot run directly with Liberty Profile

‏2012-08-08T18:16:05Z |
The Liberty Profile config page in eclipse contains a "Run applications directly from the workspace" checkbox. This works fine with a simple Dynamic Web Project. However, if you create a Maven web project and import it into your workspace using the m2e plugin, you cannot run that application directly from the workspace. When you do so, publishing fails with the stack trace below. This is easy to reproduce using the attached project and the steps below. Is this a known issue and are there plans to fix it?

Details:
eclipse Indigo
m2e - Maven Integration for Eclipse 1.1.0.20120530-0009
Maven Integration for WTP 0.15.2.20120306-2040
liberty profile: wlp-developers-8.5.0.0.jar

Steps:
Import the sample maven web project below (use 7zip to extract)
Add the web project to your liberty profile server
Select the option to "Run applications directly from the workspace"
publishing fails

Workaround:
Uncheck the Run applications directly from the workspace checkbox. The app will be copied to the server instead of served directly.

Publish failure:
java.lang.NullPointerException
at com.ibm.ws.st.core.internal.looseconfig.LooseArchive.process(LooseArchive.java:139)
at com.ibm.ws.st.core.internal.looseconfig.LooseArchive.<init>(LooseArchive.java:67)
at com.ibm.ws.st.core.internal.looseconfig.LooseconfigXMLGenerator.fillLooseContent(LooseconfigXMLGenerator.java:55)
at com.ibm.ws.st.core.internal.looseconfig.LooseconfigXMLGenerator.generateRepository(LooseconfigXMLGenerator.java:48)
at com.ibm.ws.st.core.internal.ApplicationPublisher.handleAppLooseConfigXML(ApplicationPublisher.java:189)
at com.ibm.ws.st.core.internal.ApplicationPublisher.postPublishApplication(ApplicationPublisher.java:230)
at com.ibm.ws.st.jee.core.internal.JEEPublisher.postPublishApplication(JEEPublisher.java:347)
at com.ibm.ws.st.core.internal.ServerExtensionWrapper.postPublishApplication(ServerExtensionWrapper.java:324)
at com.ibm.ws.st.core.internal.WebSphereServerBehaviour.publishApplication(WebSphereServerBehaviour.java:844)
at com.ibm.ws.st.core.internal.WebSphereServerBehaviour.publishModules(WebSphereServerBehaviour.java:748)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:955)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3087)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
  • ErinHarris
    ErinHarris
    7 Posts
    ACCEPTED ANSWER

    Re: Maven structured webapps cannot run directly with Liberty Profile

    ‏2012-08-10T12:55:53Z  in response to SystemAdmin
    This is a known problem that we are looking into. Thanks for reporting it, and thanks for all of the detail making it easy to identify.
    • bwa
      bwa
      47 Posts
      ACCEPTED ANSWER

      Re: Maven structured webapps cannot run directly with Liberty Profile

      ‏2012-09-20T08:42:03Z  in response to ErinHarris
      Any news on this progress ? There is a lot of maven use, also among IBM customers ...
      • SystemAdmin
        SystemAdmin
        590 Posts
        ACCEPTED ANSWER

        Re: Maven structured webapps cannot run directly with Liberty Profile

        ‏2012-09-20T13:53:32Z  in response to bwa
        You can try using the following steps to workaround the problem for the time being:
        1. Remove the application from the server and publish.
        2. Open the server editor and deselect the option "Run application directly from the workspace". Save and close the editor.
        3. Add the application to the server and publish again.
        • Elson
        • bwa
          bwa
          47 Posts
          ACCEPTED ANSWER

          Re: Maven structured webapps cannot run directly with Liberty Profile

          ‏2012-09-20T13:59:21Z  in response to SystemAdmin
          I know about that workaround, but want to also be able to "Run application directly from the workspace" ...
          • SystemAdmin
            SystemAdmin
            590 Posts
            ACCEPTED ANSWER

            Re: Maven structured webapps cannot run directly with Liberty Profile

            ‏2012-10-15T13:48:50Z  in response to bwa
            This problem should be resolved in latest IBM WebSphere Application Server Developer Tools for Eclipse (WDT) V.Next Alpha (https://www.ibm.com/developerworks/mydeveloperworks/blogs/wasdev/entry/download_wdt_alpha?lang=en).

            Thanks for reporting the problem.

            Elson
            • bwa
              bwa
              47 Posts
              ACCEPTED ANSWER

              Re: Maven structured webapps cannot run directly with Liberty Profile

              ‏2012-10-15T14:08:35Z  in response to SystemAdmin
              Elson, are you attending Tim and Ian's presentation in Berlin, now ???

              /bwa
              • SystemAdmin
                SystemAdmin
                590 Posts
                ACCEPTED ANSWER

                Re: Maven structured webapps cannot run directly with Liberty Profile

                ‏2012-10-15T15:33:45Z  in response to bwa
                No, I am not.

                Elson
                • bwa
                  bwa
                  47 Posts
                  ACCEPTED ANSWER

                  Re: Maven structured webapps cannot run directly with Liberty Profile

                  ‏2012-10-17T20:34:23Z  in response to SystemAdmin
                  Well, I have downloaded the Alpha version, and tried som maven project (from RAD 8.5 with m2e 1.2.0)

                  Doesn't seem to be fixed.

                  Here is the context of the publishing failed message :

                  Publishing failed
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  OK
                  Publish autostart-ear failed.
                  java.lang.NullPointerException
                  Publish of application autostart-ear failed.
                  Unchecking the 'Run application directly from the workspace' does not fail publishing
                  • SystemAdmin
                    SystemAdmin
                    590 Posts
                    ACCEPTED ANSWER

                    Re: Maven structured webapps cannot run directly with Liberty Profile

                    ‏2012-10-17T20:45:24Z  in response to bwa
                    I am sorry to heard that you are still seeing problem in this area. Can you post the stacktrace of the NPE (if it is different from the original one)?
                    • bwa
                      bwa
                      47 Posts
                      ACCEPTED ANSWER

                      Re: Maven structured webapps cannot run directly with Liberty Profile

                      ‏2012-10-19T08:55:01Z  in response to SystemAdmin
                      I did a mistanke on this, so my problem is not a Liberty Profile Next Alpha problem. I misunderstood how it works and only updated the Liberty Runtime with the new Alpha. You also need to install the WDT Alpha as well. I did not do that, and probably a lot of other people will also do this error, so remember to also INSTALL THE WDT AND THE RUNTIME.

                      /bwa
                      • SystemAdmin
                        SystemAdmin
                        590 Posts
                        ACCEPTED ANSWER

                        Re: Maven structured webapps cannot run directly with Liberty Profile

                        ‏2012-10-29T03:04:01Z  in response to bwa
                        This issue has been fixed in my testing, thank you.

                        Using Juno SR1 I installed:

                        1) M2E 1.2
                        m2e - Maven Integration for Eclipse 1.2.0.20120903-1050 org.eclipse.m2e.feature.feature.group Eclipse.org - m2e

                        2) maven Integration for WTP
                        m2e connector for mavenarchiver pom properties 0.15.0.201207090125-signed-201209140800 org.sonatype.m2e.mavenarchiver.feature.feature.group Sonatype, Inc.
                        m2e-wtp - Maven Integration for WTP (Incubation) 0.16.0.20120914-0945 org.eclipse.m2e.wtp.feature.feature.group Eclipse.org - m2e-wtp

                        3) WDT Next Alpha using the link above from Elson
                        Web Development Tools 8.6.0.v20120926_1934 com.ibm.wdt.webtools.top.feature.feature.group IBM
                        WebSphere® Application Server V8.5 Tools - Liberty Profile 8.6.0.v20120919_2125 com.ibm.websphere.wdt.server.tools.feature.group IBM

                        With these plugins installed, and using the Libery Profile 8.5 Alpha (wlp-developers-8.5.next.alpha.jar), I can now run my Maven web app from the workspace without publishing. This really makes the profile usable for a large web app, it should be a huge time saver compared to publishing, thanks.
  • SUP3_Tim_De_Vos
    SUP3_Tim_De_Vos
    16 Posts
    ACCEPTED ANSWER

    Re: Maven structured webapps cannot run directly with Liberty Profile

    ‏2012-09-05T06:56:02Z  in response to SystemAdmin
    Hi,

    The same problems exists in the non liberty profile. Maybe this information can be helpfull for the developers.

    Tim
    • SystemAdmin
      SystemAdmin
      590 Posts
      ACCEPTED ANSWER

      Re: Maven structured webapps cannot run directly with Liberty Profile

      ‏2012-09-05T14:33:05Z  in response to SUP3_Tim_De_Vos
      The mentioned problem on the original description only applies to the Liberty profile support. If you are using the full profile, there are some settings required to follow. See this document for details:
      https://www.ibm.com/developerworks/wikis/download/attachments/113607155/RAD_m2e-Nov.pdf?version=1