Created
July 6, 2013 00:41
-
-
Save jpgreenwald/5938059 to your computer and use it in GitHub Desktop.
Google Guava does not work well with Java EE 7 containers like glassfish 4. This is a producer hack to allow for deployment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.swsandbox.hack; | |
import com.google.common.collect.ImmutableSet; | |
import com.google.common.util.concurrent.Service; | |
import javax.enterprise.context.ApplicationScoped; | |
import javax.enterprise.inject.Produces; | |
/** | |
* This is included to bypass the Java EE 7 issue with Google Guava and CDI: | |
* Issue 1433: guava 14.0.1 cannot be deployed in a JEE7 Container | |
* https://code.google.com/p/guava-libraries/issues/detail?id=1433 | |
*/ | |
@ApplicationScoped | |
public class GuavaHack | |
{ | |
@Produces | |
java.util.Set<Service> dummyServices() | |
{ | |
return ImmutableSet.of(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment