|
|
|
Oracle + Spring + Liberty profile
|
|||
|---|---|---|---|
|
#18+
Не могу сохранить блоб в БД. Раньше под томкатом все работало так: <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor" /> <bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler"> <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" /> </bean> <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="DataBase" /> </bean> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <constructor-arg ref="dataSource" /> </bean> после переезда на WAS при сохранении блобов стало падать с ClassNotFoundException - не находился oracla.sql.BLOB. При замене на <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor" /> тоже не работает: [ERROR ] Context initialization failed Error creating bean with name 'clusterizer': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private ru.sbrf.indexer.dao.ClusterizerDao ru.sbrf.indexer.ClusterizerProcessor.clusterizerDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterizerDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.support.lob.LobHandler ru.sbrf.indexer.dao.ClusterizerDao.lobHandler; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandler' defined in ServletContext resource [/WEB-INF/spring/ds.xml]: Cannot resolve reference to bean 'nativeJdbcExtractor' while setting bean property 'nativeJdbcExtractor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nativeJdbcExtractor' defined in ServletContext resource [/WEB-INF/spring/ds.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Could not initialize WebSphereNativeJdbcExtractor because WebSphere API classes are not available: java.lang.ClassNotFoundException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection [ERROR ] SRVE0283E: При инициализации контекста возникла исключительная ситуация: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterizer': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private ru.sbrf.indexer.dao.ClusterizerDao ru.sbrf.indexer.ClusterizerProcessor.clusterizerDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterizerDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jdbc.support.lob.LobHandler ru.sbrf.indexer.dao.ClusterizerDao.lobHandler; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandler' defined in ServletContext resource [/WEB-INF/spring/ds.xml]: Cannot resolve reference to bean 'nativeJdbcExtractor' while setting bean property 'nativeJdbcExtractor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nativeJdbcExtractor' defined in ServletContext resource [/WEB-INF/spring/ds.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Could not initialize WebSphereNativeJdbcExtractor because WebSphere API classes are not available: java.lang.ClassNotFoundException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2223) at [internal classes] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor]: Constructor threw exception; nested exception is java.lang.IllegalStateException: Could not initialize WebSphereNativeJdbcExtractor because WebSphere API classes are not available: java.lang.ClassNotFoundException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1094) ... 51 more Caused by: java.lang.IllegalStateException: Could not initialize WebSphereNativeJdbcExtractor because WebSphere API classes are not available: java.lang.ClassNotFoundException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection at org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor.<init>(WebSphereNativeJdbcExtractor.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ... 53 more Как настроить-то? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.04.2015, 14:48 |
|
||
|
Oracle + Spring + Liberty profile
|
|||
|---|---|---|---|
|
#18+
Саабразим Аль-каши Буханиjava.lang.ClassNotFoundException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.04.2015, 14:50 |
|
||
|
Oracle + Spring + Liberty profile
|
|||
|---|---|---|---|
|
#18+
Blazkowicz, Это я понял, но com.ibm.ws.rsadapter.jdbc.WSJdbcConnection - я не вижу в LP, видимо, это часть WAS. Есть еще варианты, кроме как тащить WSJdbcConnection и все что от него зависит? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.04.2015, 14:56 |
|
||
|
Oracle + Spring + Liberty profile
|
|||
|---|---|---|---|
|
#18+
Виноват, в первом листинге <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc. CommonsDbcpNativeJdbcExtractor " /> <bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler"> <property name="nativeJdbcExtractor" ref="nativeJdbcExtractor" /> </bean> <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="DataBase" /> </bean> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <constructor-arg ref="dataSource" /> </bean> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.04.2015, 15:28 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=38940662&tid=2125523]: |
0ms |
get settings: |
11ms |
get forum list: |
18ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
175ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
48ms |
get tp. blocked users: |
1ms |
| others: | 260ms |
| total: | 531ms |

| 0 / 0 |
