Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.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 boot 我应该使用什么JNDI名称来查找使用SpringBoot部署在websphere中的远程接口?_Spring Boot_Ejb_Websphere_Spring Remoting - Fatal编程技术网

Spring boot 我应该使用什么JNDI名称来查找使用SpringBoot部署在websphere中的远程接口?

Spring boot 我应该使用什么JNDI名称来查找使用SpringBoot部署在websphere中的远程接口?,spring-boot,ejb,websphere,spring-remoting,Spring Boot,Ejb,Websphere,Spring Remoting,我在WebSphere8.5.5中部署了一个远程接口,我想在SpringBoot应用程序中查找这个接口。我在spring boot中制作了类似的接口,作为公共接口RMI我也使用了SimpleRemoteStatesessionProxyFactoryBean,但返回的代理是null,它在proxy.invokeMethod()中抛出null指针 @配置 公共类配置{ 私有静态最终字符串INITIAL\u CONTEXT\u FACTORY=“com.ibm.websphere.naming.Ws

我在WebSphere8.5.5中部署了一个远程接口,我想在SpringBoot应用程序中查找这个接口。我在spring boot中制作了类似的接口,作为公共接口
RMI
我也使用了
SimpleRemoteStatesessionProxyFactoryBean
,但返回的代理是
null
,它在
proxy.invokeMethod()中抛出
null
指针

@配置
公共类配置{
私有静态最终字符串INITIAL\u CONTEXT\u FACTORY=“com.ibm.websphere.naming.WsnInitialContextFactory”;
私有静态最终字符串提供程序\u URL=“corbaname:iiop:localhost:2809/NameServiceServerRoot”;
@初级的
@豆子
公共静态AdminService AdminService(){
Properties jndiProps=新属性();
属性=新属性();
properties.put(Context.INITIAL\u Context\u工厂,INITIAL\u Context\u工厂);
properties.put(Context.PROVIDER\u URL,PROVIDER\u URL);
SimpleRemoteStatesessionProxyFactoryBean工厂=新的SimpleRemoteStatesessionProxyFactoryBean();
工厂环境(jndiProps);
setJndiName(“java:global/[AppName]/[ModuleName]/ejb/[BeanName]![RemoteInterface]”;
setBusinessInterface(AdminService.class);
factory.setResourceRef(true);
AdminService代理=(AdminService)factory.getObject();
试一试{
proxy.invokeMethod();
}捕获(远程异常){
e、 printStackTrace();
}
返回代理;
}
}
现在它抛出了这个错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AdminService' defined in class path resource [...Config.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [...AdminService]: Factory method 'adminEJBService' threw exception; nested exception is javax.naming.NameNotFoundException: Name [global/[AppName]/[ModuleName]/ejb/[BeanName]![RemoteInterface] is not bound in this Context. Unable to find [global].

您必须用实际名称替换
[]
中的所有内容,因此不是
[AppName]
,而是
MyApp
,等等。如果不确定,您可以通过在WebSphere 8.5.5服务器的
SystemOut.log
文件中查找消息
CNTR0167I
来确定确切的查找字符串。例如,实际消息如下所示:

CNTR0167I: The server is binding the javax.management.j2ee.ManagementHome interface of the Management enterprise bean in the mejb.jar module of the ManagementEJB application.  The binding location is: java:global/ManagementEJB/mejb/Management!javax.management.j2ee.ManagementHome

我确信
[]
中的所有内容都应该被实际值替换。我只是在做这个,因为我不想公开这些信息。此外,我非常确定所有这些名称都是正确的,因为我是从部署在Websphere上的应用程序获取它们的@特雷西