0

Используя последнюю бета-версию профиля Websphere Liberty v8.5 У меня есть исключение, когда hibernate пытается получить фабрику по умолчанию Bean Validation. Вот трассировки стека:java.lang.NoClassDefFoundError: javax/validation/groups/Default в профиле свободы Websphere

[ERROR ] Uncaught.init.exception.thrown.by.servlet 
                               CacheInit 
                               thalerngboth 
                               java.lang.ExceptionInInitializerError 
    at com.cwsoft.commons.webapp.servlet.CacheInit.init(CacheInit.java:53) 
    at javax.servlet.GenericServlet.init(GenericServlet.java:161) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:329) 
    at [internal classes] 
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/cwsoft/commons/spring/resource/sessionFactories.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory 
    ... 18 more 
Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory 
    at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127) 
    at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1704) 
    at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1654) 
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1445) 
    at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375) 
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:720) 
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479) 
    ... 16 more 
Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118) 
    ... 24 more 
Caused by: java.lang.NoClassDefFoundError: javax/validation/groups/Default 
    ... 32 more 

[ERROR ] SRVE0266E: Error occured while initializing servlets: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:398) 
    at [internal classes] 
Caused by: java.lang.ExceptionInInitializerError 
    at com.cwsoft.commons.webapp.servlet.CacheInit.init(CacheInit.java:53) 
    at javax.servlet.GenericServlet.init(GenericServlet.java:161) 
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:329) 
    ... 1 more 
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/cwsoft/commons/spring/resource/sessionFactories.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory 
    ... 18 more 
Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory 
    at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127) 
    at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1704) 
    at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1654) 
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1445) 
    at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375) 
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:720) 
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479) 
    ... 16 more 
Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118) 
    ... 24 more 
Caused by: java.lang.NoClassDefFoundError: javax/validation/groups/Default 
    ... 32 more 

Мой server.xml выглядит следующим образом:

<server description="new server"> 

<!-- Enable features --> 
<featureManager> 
    <feature>jsp-2.2</feature> 
    <feature>localConnector-1.0</feature> 
    <feature>ejb-3.2</feature> 
    <feature>servlet-3.1</feature> 
    <feature>jdbc-4.0</feature> 
    <feature>jpa-2.1</feature> 
    <feature>jca-1.6</feature> 
    <feature>beanValidation-1.1</feature> 
</featureManager> 

<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" --> 
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/> 

<library id="oracle-lib"><fileset dir="${server.config.dir}/drivers" includes="ojdbc-6.0.jar"></fileset></library> 

<applicationMonitor updateTrigger="mbean"/> 

<webApplication id="HelloWorldApplication" location="HelloWorldApplication.war" name="HelloWorldApplication"> 
</webApplication> 
<application id="Thaler" location="C:\Users\vroberfroid\Documents\Websphere\WebSphereLibertyProfile\thalerngboth.ear" name="thalerngboth" type="ear"/> 
<dataSource isolationLevel="TRANSACTION_READ_COMMITTED" id="jthaler" jndiName="jdbc/jthaler" type="javax.sql.XADataSource" queryTimeout="200"> 
    <jdbcDriver libraryRef="oracle-lib" javax.sql.XADataSource="oracle.jdbc.xa.client.OracleXADataSource"/> 
    <connectionManager numConnectionsPerThreadLocal="10" minPoolSize="1"></connectionManager> 
    <properties.oracle user="pf2" password="pf2" URL="jdbc:oracle:thin:@sabesdb01:1521:HDEVTH5" /> 
</dataSource> 

<resourceAdapter location="C:\Users\vroberfroid\Documents\Websphere\WebSphereLibertyProfile\tsdjcacci.rar" id="tsdjcacci" ></resourceAdapter> 
</server> 

Заранее спасибо за вашу помощь, Винсент

ответ

0

Это ошибка в бета-версии, и я не думаю, что есть обходной путь. Я сообщал о проблеме внутри IBM. Спасибо за тестирование с помощью бета-версии!

 Смежные вопросы

  • Нет связанных вопросов^_^