-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EntityManagerFactory with external properties throws NullPointerException #629
Comments
I don't know if it has support yet in Kundera ? |
Few properties are mandatory. AFAIK But kundera.nodes should definite ly be overridden |
AFAIK It is supported and should work. Kundera team? Sent from Yahoo!7 Mail on Android |
Apparently it works if properties already exist in persistence.xml configuration file and one is willing to override it OR there is an empty persistence-unit. I have a case when some properties can be defined in persistence.xml configuration file and some cannot. |
Hi Ansar, Please provide port along with host in property map. Map<String, Object> test = new HashMap<String, Object>(); Hope it will help you. On Tue, Aug 5, 2014 at 7:48 PM, ansarrafique [email protected]
Thanks and Regards |
NullPointerException have occurred to me as well . I have seen only in case i override "kundera.nodes" only (not "kundera.port"). Other than that it will fetch other parameter property value from persistant.xml. Map<String, String> paramMap = new HashMap<>(); For me,if you override "kundera.nodes" property , then you must override "kundera.port" property. which is not expected. If "kundera.port" is not there in argument map, then it should get it from persistant.xml. |
Keep a dummy value of kundera.nodes and kundera.host in persistence.xml and override as many times as you want. This is an issue or a protocol? Kundera team can decide on it. IMHO, having dummy or fallback configuration in persistence.xml is a better configuration -Vivek |
Hi Kuldeep and Vivek, Thank you for your reply. As I said, there is no problem if dummy properties or even properties with real values are defined in persistence.xml file. The map properties will override it. The only case I see, if node property doesn't exist in persistence.xml and is provided via map. In idea case it should not be an exception, but it's not a big requirement I guess so things are cool so far. Thanks. Ansar |
Kundera team: Do you want me to close this issue ? |
Hi Ansar ... Although not a blocking one, but would suggest you to please keep this defect open. It's a small fix and we would deliver it next release. |
Perfect, also now I can see a scenario when this would be a big plus. Thanks. |
Fixed with Kundera -2.14 Release |
I am using Kundera 2.13. If I want to create entity manager factory with external properties, do I have specify ALL PERSISTENCE UNIT PROPERTIES in map ? I am getting NullPointerException if I specify some properties in persistence unit and some provided in map. Is this supported ?
The text was updated successfully, but these errors were encountered: