Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring错误:org.springframework.beans.factory.BeanCreationException_Spring_Web Applications_Websphere_Jndi - Fatal编程技术网

Spring错误:org.springframework.beans.factory.BeanCreationException

Spring错误:org.springframework.beans.factory.BeanCreationException,spring,web-applications,websphere,jndi,Spring,Web Applications,Websphere,Jndi,我有一个web应用程序,我正在将其导出为EAR,并尝试在WebSphere6.1ApplicationServer上部署 部署进展顺利。甚至,索引页面也可以很好地加载,这是一个登录屏幕 但是,在输入凭据并按enter键时,不会加载下一页,并引发HTTP 500内部服务器错误 加载的下一个页面是一个JSP,它有一个国家下拉列表,其值通过hibernate从数据库中获取 我已经在Websphere中创建了包含所有细节的数据源,甚至测试连接成功 但是,我在检查server System.out日志时遇

我有一个web应用程序,我正在将其导出为EAR,并尝试在WebSphere6.1ApplicationServer上部署

部署进展顺利。甚至,索引页面也可以很好地加载,这是一个登录屏幕

但是,在输入凭据并按enter键时,不会加载下一页,并引发HTTP 500内部服务器错误

加载的下一个页面是一个JSP,它有一个国家下拉列表,其值通过hibernate从数据库中获取

我已经在Websphere中创建了包含所有细节的数据源,甚至测试连接成功

但是,我在检查server System.out日志时遇到以下错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ds': 
Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: 
Context: uschwasvmdev04Cell01/clusters/URMDUS, name: jdbc/mydbXA: First component in name 
mydbXA not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: 
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
NameNotFoundException的描述说明如下:

“当名称的组件由于未绑定而无法解析时,将引发此异常。”

my services.xml中的JNDI查找似乎也不错:

<jee:jndi-lookup id="ds" jndi-name="jdbc/mydbXA" resource-ref="true" />

我错过了什么


谢谢你的阅读

您正在使用
resource ref=“true”
。您是否在web.xml中创建了相应的文件


如果将其设置为
false
,则可以执行全局查找。否则您必须对其进行配置。

您正在使用
resource ref=“true”
。您是否在web.xml中创建了相应的文件


如果将其设置为
false
,则可以执行全局查找。否则您必须对其进行配置。

这很有趣,但我做了相反的事情:我创建了资源引用,但忘了告诉Spring使用它

以防万一,在名称空间中,您可以看到上面的操作:
resource ref=“true”

如果您正在手动配置bean:

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="jdbc/database" /> 
      <property name="resourceRef" value="true" /><!-- It's false by default -->
</bean>

这很有趣,但我做了相反的事情:我创建了资源引用,但忘了告诉Spring使用它

以防万一,在名称空间中,您可以看到上面的操作:
resource ref=“true”

如果您正在手动配置bean:

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="jdbc/database" /> 
      <property name="resourceRef" value="true" /><!-- It's false by default -->
</bean>