Am 22.02.2017 um 16:43 schrieb Sascha Vogt: > Hi M.K. > > Am 19.02.2017 um 18:33 schrieb M.K.: >> >> Class JTDSDataSourceFactory >> <https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-jtds/src/main/java/org/ops4j/pax/jdbc/jtds/impl/JTDSDataSourceFactory.java>doesn't >> work properly when lowercase entries are used in the configuration and I >> think this is a defect. I'm using version 1.0.0 but I double-checked >> that the most recent code in the repository didn't solve this problem. >> >> The class initially builds a connection property map based on the jdbc >> URL provided in the configuration (line 76). Properties not included in >> the URL are still populated in the map with empty values and map keys in >> uppercase. For example 'PASSWORD='. >> >> The configuration properties are then parsed and the related key/pair's >> are added to the map without being uppercase'd, leading to double >> entries in the map for each properties: one in lowercase and one in >> uppercase (loop at line 77). >> >> The properties are then injected in the data source object (loop at line >> 80). Java reflection is being used for this step and it's using a >> case-insensitive logic to select the setter method to be used for >> injecting the property into the data source object (line 113). The >> uppercase and lowercase entries are ultimately overriding each other. >> >> This can be reproduced with a configuration like this: >> >> url=jdbc:jtds:sqlserver://my.server:1433/my-database;integratedSecurity=true;domain=my-domain;useNTLMv2=true >> user=someuser >> password=some-password >> >> As I workaround, I had to uppercase my property keys and this works fine: >> >> USER=someuser >> PASSWORD=some-password >> > > Thanks for the detailed analysis :) Another workaround is to put the url > last in the properties file. That's why I missed the issue (as I have > the password / user in lower case as well)
Hm, no, it's not the order. Not sure yet why it works for me, have not yet debugged the case. Anyway, the properties are now uppercased as well, so the issue should be fixed in the next release. Greetings -Sascha- -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
