getting this exception

Confluence User - 10 May, 2023

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productSessionFactory' defined in class path resource [pluginBaseApplicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/activation/DataSource


followed the steps from this page → Using Hibernate Entity and Dao in Plugin

hibernate;forms

2


16 May, 2023
confluenceUser
confluenceUser

Hi, please provide more information and steps. When are you encountering that error? The error says "java.lang.NoClassDefFoundError: javax/activation/DataSource" so it appears to be missing that class.

17 May, 2023
confluenceUser
confluenceUser

context : My Objective is to create  two custom tables that will be added or created in the joget database when my custom plugin is installed 

the exception is thrown from this line → 
ProductsDao productdao = (ProductsDao) AppContext.getInstance().getAppContext().getBean("productsDao");

and in productsApplicationContext.xml 
the datasource property is referring to a bean called setupDataSource which is not found at runtime , which is why i think its throwing this exception .  

<bean id="productSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource" ref="setupDataSource"/>
        <property name="mappingResources">
            <list>
                <value>/org/joget/sample/products/model/Products.hbm.xml</value>
             </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
                <prop key="hibernate.show_sql">false</prop>
                <prop key="hibernate.format_sql">false</prop>
            </props>
        </property>
    </bean>


RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print