spring boot application jndi on glassfish/payara container

349 Views Asked by At

I'm tryng to deploy spring boot app on a paraya server. i've configured a connection pool and jndi on admin panel of paraya.. now the problem is to lookup this jndi on my spring boot project.. The projet deploy successfully wihthout the jndi configuration..

but when i try to add jndi configuration the app fall on deploy

here is the configuration code

@Configuration
public class DataSourceConfigurer {
    
    
    //@Value("${qps.app.jndi.name}")
    private final String JNDI = "jdbc/qps_local";

    @Bean(destroyMethod = "")// disable inference of a potential close() method as a destroyer
    public DataSource dataSource() throws DataSourceLookupFailureException, IllegalArgumentException, NamingException {

        JndiDataSourceLookup dataSourceLookup = new JndiDataSourceLookup();

        return dataSourceLookup.getDataSource(JNDI);
               

}

And here is the exception i get when i tried to deploy the war on payara

[2020-09-28T14:14:34.087+0000] [Payara 5.2020.3] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=5137 _ThreadName=admin-thread-pool::admin-listener(54)] [timeMillis: 1601302474087] [levelValue: 1000] [[
  Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'openEntityManagerInViewInterceptorConfigurer' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration$JpaWebConfiguration.class]: Unsatisfied dependency expressed through method 'openEntityManagerInViewInterceptorConfigurer' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openEntityManagerInViewInterceptor' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration$JpaWebConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.optional.MysqlDataSource.isWrapperFor(Ljava/lang/Class;)Z]]
0

There are 0 best solutions below