Guest User

Untitled

a guest
Mar 3rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <bean class="java.net.URI" id="dbUrl">
  2. <constructor-arg value="#{systemEnvironment['DATABASE_URL']}" />
  3. </bean>
  4.  
  5.  
  6. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  7. destroy-method="close" lazy-init="true">
  8. <property name="driverClassName" value="${datasource.driverClassName}" />
  9. <property name="url"
  10. value="#{ 'jdbc:postgresql://' + @dbUrl.getHost() + ':' + @dbUrl.getPort() + @dbUrl.getPath() }" />
  11. <property name="username" value="#{ @dbUrl.getUserInfo().split(':')[0] }" />
  12. <property name="password" value="#{ @dbUrl.getUserInfo().split(':')[1] }" />
  13. <bean/>
  14.  
  15. BeanInstantiationException Could not instantiate bean class java.net.URI Constructor threw exception Illegal character in fragment at index 1: #{systemEnvironment['DATABASE_URL']}
Add Comment
Please, Sign In to add comment