Topic
  • 5 replies
  • Latest Post - ‏2014-01-31T16:49:59Z by ErinHarris
GB1S_Edward_Howe
GB1S_Edward_Howe
2 Posts

Pinned topic Liberty: Enterprise applications may only contain web or EJB modules and utility jars.

‏2014-01-16T19:07:21Z |

I'm working on porting our application from WAS 7 to Liberty, using Eclipse Kepler and Liberty 8.5.5.Next Alpha.  This may actually be an eclipse issue, but I thought I'd start here.

I am unable to deploy certain applications via the Add and Remove... dialog, and get the error message "Enterprise applications may only contain web or EJB modules and utility jars."  This appears to be due to certain third-party jars in the application, such as Apache fop 1.0, OWASP antisamy-bin 1.3, and Oracle coherence 3.7.1.6.  If I remove these jars, I can deploy the ear and add them back in afterward, but this is a nuisance.

Has anybody encountered this and found a more simple work-around?

  • rsanchezh
    rsanchezh
    26 Posts

    Re: Liberty: Enterprise applications may only contain web or EJB modules and utility jars.

    ‏2014-01-16T19:19:31Z  

    Is your EAR version 5 or 6? Or previous version? Where are these third-party jars? In the root of the EAR?

    If your EAR is version 5 or 6, and the jars are in the root of the EAR, can you try moving them to the lib folder?

  • GB1S_Edward_Howe
    GB1S_Edward_Howe
    2 Posts

    Re: Liberty: Enterprise applications may only contain web or EJB modules and utility jars.

    ‏2014-01-16T19:43:20Z  
    • rsanchezh
    • ‏2014-01-16T19:19:31Z

    Is your EAR version 5 or 6? Or previous version? Where are these third-party jars? In the root of the EAR?

    If your EAR is version 5 or 6, and the jars are in the root of the EAR, can you try moving them to the lib folder?

    The EAR is version 5.  The jars were in the root, but I moved them into lib with no effect.

  • ErinHarris
    ErinHarris
    7 Posts

    Re: Liberty: Enterprise applications may only contain web or EJB modules and utility jars.

    ‏2014-01-16T20:43:17Z  

    The EAR is version 5.  The jars were in the root, but I moved them into lib with no effect.

    If you import the jars into the EAR as JEE Utility jars then does that help?  Move the jars to another folder.  Right click on the EAR project and select Import -> Java EE Utility Jar, then select "Copy utility JARs into an existing EAR from an external location" and click Next.  Fill in the folder containing the jars and select the jars to import.  Click Finish.

  • Navya_N
    Navya_N
    1 Post

    Re: Liberty: Enterprise applications may only contain web or EJB modules and utility jars.

    ‏2014-01-29T02:44:31Z  

    If you import the jars into the EAR as JEE Utility jars then does that help?  Move the jars to another folder.  Right click on the EAR project and select Import -> Java EE Utility Jar, then select "Copy utility JARs into an existing EAR from an external location" and click Next.  Fill in the folder containing the jars and select the jars to import.  Click Finish.

    Importing Utility JARS has not solved the problem for me. I am still getting the same error when I try to add the EAR to WAS LP server. Is there any other solution ?

  • ErinHarris
    ErinHarris
    7 Posts

    Re: Liberty: Enterprise applications may only contain web or EJB modules and utility jars.

    ‏2014-01-31T16:49:59Z  
    • Navya_N
    • ‏2014-01-29T02:44:31Z

    Importing Utility JARS has not solved the problem for me. I am still getting the same error when I try to add the EAR to WAS LP server. Is there any other solution ?

    I tried to reproduce this but was not able to.  It could be that one of the jars is being recognized as something else instead of a utility jar.  Do you know which jar is causing the problem?  In any case it looks likely to be a bug so the best thing would be to open a pmr so that you can attach your project or the jar(s) that cause the problem.