Can I ship GlassFish with my application?

Under the terms of either the CDDL or GPL licenses for GlassFish you are free to redistribute the code as you wish, even embed it in your application. You do need to follow the terms of the license, include the appropriate license headers and attribution clauses in the source code that you need to make available. Now, depending on how GlassFish is used in your application, you may need to contribute your application source code back to the GlassFish community. A simple example: if you just package GlassFish with your application and redistribute without modifying the GlassFish code, then you do not have to contribute anything back to the community because you have made no modifications to the code. However, if say, you modify the GlassFish code to work with your app and then distribute that modified version of GlassFish, then you would need to submit those changes back to the community. And, if you alter GlassFish to embed it into your application then you may have to contribute both back to the community (especially if you use a GPL license). If you are not sure, bring your specific question up in the forums and someone with a deep understanding of the licenses can help you.