Reputation: 61
I cloned a new site that was created in an older version (3.0.x) but there are errors in instantiating a bean from a constructor.
I am not able to view or build the application context because of the error.
Heres's the runtime exception:
Caused by: java.lang.RuntimeException: No suitable ClassLoader found for grab
Snippet of the jdbc class:
@Grab(group='org.springframework', module = 'spring-jdbc', version = '4.1.9.RELEASE')
@Grab(group='commons-dbcp', module='commons-dbcp', version='1.2.2')
@Grab(group='com.sap.cloud.db.jdbc', module='ngdbc', version='2.2.16')
import org.apache.commons.dbcp.BasicDataSource
import org.springframework.jdbc.core.JdbcTemplate
class SAPJdbcTemplate extends JdbcTemplate {
def SAPJdbcTemplate(BasicDataSource rq1DataSource, global) {
super()
rq1DataSource.setDriverClassName(global.getProperty("studio.db.driverClassName"))
rq1DataSource.setUrl(global.getProperty("studio.db.url"))
rq1DataSource.setUsername(global.getProperty("studio.db.username"))
rq1DataSource.setPassword(global.getProperty("studio.db.password"))
this.setDataSource(rq1DataSource)
}
}
Bean from application-context.xml
<bean id="SAPJdbcTemplate" class="com.troo.services.SAPJdbcTemplate">
<constructor-arg index="0" ref="rq1DataSource"/>
<constructor-arg index="1" ref="crafter.propertyResolver"/>
</bean>
Upvotes: 0
Views: 91
Reputation: 1446
Please review this article
Crafter CMS has a Groovy security sandbox that you need to consider.
Upvotes: 1