1

We are using Spring mvc for our project. In Spring.xml we want to use our newly migrated postgres db. But we are not being able to configure the url.

<bean id="jt" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="ds"></property>
</bean>

This gives us an error: [err]

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: Invalid sslmode value: verify-full;sslrootcert=/opt/ibm/wlp/usr/servers/defaultServer/resources/iitStaticContent/root.crt
[err]   at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
[err]   at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:390)
3
  • try reading the error message Invalid sslmode value: verify-full Commented Apr 28, 2021 at 5:55
  • but as far as i understand sslmode=verify-full is a valid option. Commented Apr 28, 2021 at 5:56
  • 1
    Maybe it is what comes next - the format is jdbc:postgresql://<instance_ip>:<instance_port>/<database_name>?sslmode=verify-full&sslrootcert=<ca.pem> Commented Apr 28, 2021 at 6:02

1 Answer 1

2

You use an ampersand (&), not a semicolon (;), to separate options in an URL.

You may need to encode that as &amp; in XML.

Sign up to request clarification or add additional context in comments.

2 Comments

Whenever i use an '&' i am getting a compilation error in eclipse saying Multiple annotations found at this line: - Start tag of element <property> - The reference to entity "sslcert" must end with the ';' delimiter. - End tag of element <property>
Try encoding it, as suggested in my extended answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.