- 浏览: 2290272 次
- 性别:
- 来自: 成都
文章分类
- 全部博客 (357)
- J2EE (49)
- JavaScript (40)
- Spring (19)
- Struts (5)
- CSS (8)
- Hibernate (16)
- Java (67)
- DWR (4)
- JSON (3)
- XFIRE (1)
- Tomcat (1)
- Ant (2)
- 设计模式 (2)
- 经典收藏 (2)
- JSP (10)
- Linux (0)
- WebLogic (11)
- myeclipse (13)
- Buffalo (4)
- 文件上传相关 (1)
- oracle (33)
- html (6)
- JSTL (3)
- SVN (2)
- GIT (1)
- 孙卫琴(Java网络编程精解) (1)
- DOM4J (2)
- Swing (1)
- AJAX (1)
- Eclipse (5)
- 日志组件 (3)
- PowerDesigner (1)
- Jquery (22)
- IT技术开发相关网址 (1)
- Nutz (1)
- 其它 (1)
- Velocity (3)
- WebService (1)
- MySql (2)
- Android (1)
- Maven (2)
- Quartz (11)
- Lucene (1)
- springsource (1)
- Junit (1)
- Activiti (0)
最新评论
-
yzlseu:
拼凑,没有营养
Activiti进阶—分配组任务 -
zhangsenhao:
非常赞!代码很清楚
SpringMVC3.0+MyIbatis3.0(分页示例) -
xiamw2000:
分页写得不对,应该是 : order by ${orderNa ...
SpringMVC3.0+MyIbatis3.0(分页示例) -
sheertewtw:
...
SpringMVC:上传与下载 -
kingtoon:
...
XSS之xssprotect
Spring配置JNDI(WebLogic92)NameNotFoundException: Unable to resolve解决
- 博客分类:
- Spring
请参见:
Struts2.2+Spring3.1+Hibernate3.6整合(登录示例)
http://liuzidong.iteye.com/blog/935493
在这个示例作了修改!
参考资料
1 spring通过weblogic配置的jndi实现数据库操作
http://mariosissy.blogbus.com/logs/48042786.html
2 Spring - Weblogic - Hibernate datasource problem
http://forum.springsource.org/showthread.php?t=37872
一 环境:XP+Myeclipse6.6+WebLogic92+JDK1.5
二 具体步骤如下:
jdbc.properties:注意事项:配置的端口:7002是WEBLOGIC服务器创建域是设置的端口
bean.xml中配置:
web.xml
位置:WEB-INF/weblogic.xml
注意其中的配置很重要!:
<resource-description>
<res-ref-name>s2sh</res-ref-name>
<jndi-name>s2sh</jndi-name>
</resource-description>
不配置会出现错误:
<2011-3-15 下午01时54分31秒 CST> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of resource dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property
'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of resource dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property
'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
Truncated. see log file for complete stacktrace
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property
'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
Truncated. see log file for complete stacktrace
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB
-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-
INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc']; remaining name 'oracle'
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
Truncated. see log file for complete stacktrace
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-
INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc']; remaining name 'oracle'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
Truncated. see log file for complete stacktrace
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at weblogic.jndi.internal.ServerNamingNode_920_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:374)
Truncated. see log file for complete stacktrace
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:178)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
Truncated. see log file for complete stacktrace
>
<2011-3-15 下午01时54分31秒 CST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application '_appsdir_S2SHJNDI_dir'.
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:894)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:336)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
Truncated. see log file for complete stacktrace
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:178)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
Truncated. see log file for complete stacktrace
另外在WebLogic中创建域请参考以下:
图解Weblogic92域创建及与Myeclipse服务配置
http://liuzidong.iteye.com/blog/929740
另外在WEB-INF/lib下加入weblogic.jar文件
以下是各种应用服务器的不同的properties集合:
Struts2.2+Spring3.1+Hibernate3.6整合(登录示例)
http://liuzidong.iteye.com/blog/935493
在这个示例作了修改!
参考资料
1 spring通过weblogic配置的jndi实现数据库操作
http://mariosissy.blogbus.com/logs/48042786.html
2 Spring - Weblogic - Hibernate datasource problem
http://forum.springsource.org/showthread.php?t=37872
一 环境:XP+Myeclipse6.6+WebLogic92+JDK1.5
二 具体步骤如下:
jdbc.properties:注意事项:配置的端口:7002是WEBLOGIC服务器创建域是设置的端口
## JNDI Datasource Context.INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory Context.PROVIDER_URL=t3://127.0.0.1:7002 JNDI=s2sh RESOURCEREF=true #如果你不想使用 'java:comp/env/'前缀的话请设置下面的值为true, 默认值为false #JNDI=java:comp/env/s2sh #RESOURCEREF=false
bean.xml中配置:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>${JNDI}</value> </property> <property name="resourceRef"> <value>${RESOURCEREF}</value> </property> <property name="jndiEnvironment"> <props> <prop key="java.naming.provider.url">${Context.PROVIDER_URL}</prop> <prop key="java.naming.factory.initial">${Context.INITIAL_CONTEXT_FACTORY}</prop> </props> </property> </bean>
web.xml
<resource-ref> <description>s2sh</description> <res-ref-name>s2sh</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
位置:WEB-INF/weblogic.xml
<?xml version='1.0' encoding='utf-8'?> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <container-descriptor> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor> <context-root>/</context-root> <resource-description> <res-ref-name>s2sh</res-ref-name> <jndi-name>s2sh</jndi-name> </resource-description> </weblogic-web-app>
注意其中的配置很重要!:
<resource-description>
<res-ref-name>s2sh</res-ref-name>
<jndi-name>s2sh</jndi-name>
</resource-description>
不配置会出现错误:
<2011-3-15 下午01时54分31秒 CST> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of resource dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property
'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of resource dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property
'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
Truncated. see log file for complete stacktrace
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property
'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL
[file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
Truncated. see log file for complete stacktrace
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB
-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-
INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc']; remaining name 'oracle'
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
Truncated. see log file for complete stacktrace
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/E:/bea/user_projects/domains/s2shdomain/autodeploy/S2SHJNDI/WEB-
INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc']; remaining name 'oracle'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
Truncated. see log file for complete stacktrace
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'];
remaining name 'oracle'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at weblogic.jndi.internal.ServerNamingNode_920_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:374)
Truncated. see log file for complete stacktrace
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:178)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
Truncated. see log file for complete stacktrace
>
<2011-3-15 下午01时54分31秒 CST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application '_appsdir_S2SHJNDI_dir'.
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:894)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:336)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
Truncated. see log file for complete stacktrace
javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracle'. Resolved 'jdbc'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:252)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:178)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
Truncated. see log file for complete stacktrace
另外在WebLogic中创建域请参考以下:
图解Weblogic92域创建及与Myeclipse服务配置
http://liuzidong.iteye.com/blog/929740
另外在WEB-INF/lib下加入weblogic.jar文件
以下是各种应用服务器的不同的properties集合:
websphere: java.naming.provider.url->iiop://websphere.machine.domain.com:900 java.naming.factory.initial ->com.ibm.websphere.naming.WsnInitialContextFactory java.naming.factory.url.pkgs ->com.ibm.ws.naming org.omg.CORBA.ORBClass->com.ibm.rmi.iiop.ORB org.omg.CORBA.ORBSingletonClass->com.ibm.rmi.corba.ORBSingleton javax.rmi.CORBA.UtilClass->com.ibm.rmi.javax.rmi.CORBA.Util javax.rmi.CORBA.StubClass->com.ibm.rmi.javax.rmi.CORBA.StubDelegateImpl javax.rmi.CORBA.PortableRemoteObjectClass->com.ibm.rmi.javax.rmi.PortableRemoteObject weblogic: java.naming.factory.initial -> weblogic.jndi.WLInitialContextFactory java.naming.provider.url -> t3://localhost:7001 jboss: ava.naming.factory.initial ->org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs->org.jboss.naming.client java.naming.provider.url ->jnp://10.0.0.18:1099 sunone IMQ ldap: java.naming.provider.url -> ldap://localhost:389/dc=yusong,dc=com java.naming.factory.initial -> com.sun.jndi.ldap.LdapCtxFactory sunone Application Server: java.naming.provider.url -> iiop://192.168.0.34:3700 java.naming.factory.initial -> com.sun.jndi.cosnaming.CNCtxFactory oracle oc4j: java.naming.factory.initial->com.evermind.server.ApplicationClientInitialContextFactory java.naming.provider.url->ormi://localhost/bmpapp
发表评论
-
Spring Task Schedule
2017-06-24 08:46 801链接:http://docs.spring.io/spring ... -
Spring之JDBC模板(手写)
2011-10-24 14:44 4326一 模板父类: SpringBaseDAO.java im ... -
Sprint之java.util.Time
2011-07-06 16:17 1691参考资料 1 在Spring中使用JDK Timer进行任务调 ... -
java.util.Time结合Spring发送Email
2011-07-06 15:02 2011参考资料 1 Web项目下应用Java Timer定时器 ht ... -
Spring之Email<封装了常用的四种发送Email的方法(TEXT,HTML,IMG,FILE)>
2011-07-05 11:47 29802参考资料 1 Spring邮件发送(可带附件,模板,群发,异 ... -
SpringMVC:生成Excel和PDF
2011-06-07 17:18 25425参考资料 1 用spring MVC 生成Excel和PDF ... -
SpringMVC:整合JQUERY与JSON
2011-06-03 10:45 67808参考资料 1 Spring3 MVC 笔记(二) —json+ ... -
Spring:ContextLoaderListener作用
2011-06-02 10:18 32908参考资料 1 Spring之ContextLoaderList ... -
SpringMVC+JDBC:分页示例
2011-06-01 17:22 22053一 环境:XP3+Oracle10g+MyEclipse6+( ... -
SpringMVC:上传与下载
2011-06-01 16:46 27273参照了网上相关代码 注意事项: 1 springmvc.xm ... -
Spring配置JNDI(Tomcat7)
2011-03-15 13:02 12124请参见: Struts2.2+Spring3.1+Hibern ... -
Struts2.2+Spring3.1+Hibernate3.6整合(登录示例及CRUD操作)
2011-03-01 13:26 20456一 运行环境: XP3+Myeclipse6.6+Tomcat ... -
spring整合hibernate关于 session的管理<三种方式>
2011-02-23 13:22 2440转载:spring整合hibernate关于 session的 ... -
Spring3 MVC Annotaction入门(登录示例)
2011-01-29 16:43 18914浏览资料 1 SpringMVC入门实例及详细讲解 http: ... -
Spring MVC入门(登录示例)
2011-01-26 10:09 17213一 环境: Myeclipse6.6+JDK1.5+Tomca ... -
spring3.0.5启动报错:org.springframework.beans.factory.BeanDefinitionStoreException
2011-01-24 16:33 42383一 开发环境:JDK5+Spring3.0.5+Myeclip ... -
转载:Spring(一)为什么要使用spring
2010-07-30 09:28 1347转载: Spring(一)为什么要使用spring http: ... -
spring的jar包详解
2009-09-19 11:05 1441转载:http://www.blogjava.net/li ...
相关推荐
本文将详细介绍如何在Spring中配置两种不同的方式来获取WebLogic JNDI数据源。 #### 一、本地WebLogic Server获取 这种方式适用于当Spring应用与WebLogic服务器在同一台物理机器上运行时的情况。在这种模式下,...
NULL 博文链接:https://zzy603.iteye.com/blog/1039826
Spring框架作为一个强大的IoC(Inversion of Control)和AOP(Aspect Oriented Programming)容器,提供了多种配置数据源的方式,其中包括通过JNDI(Java Naming and Directory Interface)来查找和配置数据源。JNDI...
nested exception is javax.naming.NameNotFoundException: Unable to resolve 'J2YD' Resolved; remaining name 'J2YD' org.springframework.beans.factory.BeanCreationException: Error creating bean with ...
- 在Java应用服务器(如Tomcat、JBoss、WebLogic等)中,你需要先配置一个JNDI数据源。这通常在服务器的管理控制台或者配置文件(如Tomcat的`context.xml`)中完成。例如,在Tomcat中,可以在`server.xml`或`...
当你在JBoss中配置了一个资源,例如一个数据库连接池,并试图通过JNDI名来访问它,如果找不到对应的配置,就会抛出NameNotFoundException。这个错误可能由于以下原因: 1. **配置错误**:你可能在应用的部署描述符...
自用CVE-2018-3191 weblogic反序列化exp。
然而,有时我们可能希望在非Web环境下或不使用JNDI的情况下配置数据源,这时我们需要在Spring的配置文件中等价地实现JNDI的数据源配置。以下是如何在Spring中进行这种转换的详细步骤和知识点: 1. **理解JNDI配置**...
WebLogic 下配置 JNDI 数据源 WebLogic 是一款功能强大的 Java 应用服务器,提供了强大的集成和管理功能,而 JNDI(Java Naming and Directory Interface)是 Java 中的一种命名和目录接口,用于在 Java 应用程序中...
3. **WebLogic与Spring的集成**:确保Spring应用能够找到WebLogic注册的数据源,需要在`weblogic.xml`配置文件中指定JNDI名称: ```xml <wls:weblogic-web-app xmlns:wls=...
在Weblogic上配置Hibernate为JNDI涉及到的关键技术包括Weblogic服务器、Hibernate持久化框架以及Java Naming and Directory Interface (JNDI)。JNDI是一个Java API,它允许应用程序查找和访问不同类型的命名和目录...
Tomcat6+Spring+JNDI配置数据源说明 本文档主要介绍了Tomcat6+Spring+JNDI配置数据源的详细步骤和原理。数据源是一个池子,里面有若干个数据连接对象,当需要时就从里面拿一个使用,使用完毕就放回去,如果超过最大...
本文将详细介绍在WebLogic 9.1环境下配置JNDI数据源的步骤,并结合实际操作中的常见问题提供解决方案。 #### 二、准备工作 在开始配置之前,需要准备以下几项: 1. **环境搭建**:确保WebLogic 9.1服务器已安装并...
- 在配置JNDI查找时,正确指定JMS资源的JNDI名称,这通常可以在WebLogic控制台的JMS配置中找到。 - 考虑到事务管理,根据业务需求选择合适的事务配置,例如`CLIENT_ACKNOWLEDGE`或`AUTO_ACKNOWLEDGE`等确认模式。 - ...
如何使用Spring从JNDI查找数据源 Server.xml <资源名称=“ jdbc / javatechie”全局=“ jdbc / javatechie” auth =“容器” type =“ javax.sql.DataSource” driverClassName =“ com.mysql.jdbc.Driver” url...
本项目提供的下载资料可能包含Spring配置文件、Java源代码、测试脚本等,可以帮助学习者了解如何在实际项目中使用Spring与WebLogic JMS的集成。通过深入研究这些文件,你可以了解到如何在企业级环境中利用消息队列...
在Spring框架与Tomcat服务器的集成中,配置JNDI数据源是将数据库连接管理交给服务器来处理,提高应用的可移植性和资源利用率。下面将详细解释配置JNDI数据源的相关知识点。 一、JNDI数据源的概念 JNDI数据源是一种...
本篇文章将深入探讨如何在这样的环境下配置JNDI(Java Naming and Directory Interface),以便于应用程序能方便地查找和使用数据库资源。JNDI是Java平台中的一种标准服务,它提供了一个统一的接口来查找和管理各种...