rmi

AppContext is null from rmi thread with Java 7 Update 25

假装没事ソ 提交于 2019-11-30 20:47:18
We recently updated to Java 7 Update 25 from Update 21 and are now experiencing a null pointer exception when SwingUtilities.isEventDispatchThread() is called from an rmi thread becuase AppContext.getAppContext() is returning null. java.lang.NullPointerException at sun.awt.SunToolkit.getSystemEventQueueImplPP(Unknown Source) at sun.awt.SunToolkit.getSystemEventQueueImplPP(Unknown Source) at sun.awt.SunToolkit.getSystemEventQueueImpl(Unknown Source) at java.awt.Toolkit.getEventQueue(Unknown Source) at java.awt.EventQueue.isDispatchThread(Unknown Source) at javax.swing.SwingUtilities

EJBCLIENT000025: No EJB receiver available for handling?

落花浮王杯 提交于 2019-11-30 20:44:37
I am trying to connect to a remote EJB on my local JBoss 7.2 from an executable Java application (local not on JBoss). But I get the following error/Exception : java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:xx-xx, moduleName:xx-xx-business-impl, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@14bc02d at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:693) at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116) at org.jboss.ejb

Java RMI - Making the client a server

泪湿孤枕 提交于 2019-11-30 17:56:39
问题 If i want to enable 'two way' communication in my RMI Application (That is, allow the server to invoke methods on the client, as well as the client to invoke methods on the server), is the simplest way to make the client into a Remote class as well? Also if i intend to pass instances of my client to server as a method parameter, am i correct in thinking that there is no need to add the 'client class' to the rmiregistry? And one final question, do all of my classes still need to be compiled in

Determine remote client IP address for Java RMI call

自闭症网瘾萝莉.ら 提交于 2019-11-30 17:14:37
问题 When I implement an RMI server (implement an interface that extends java.rmi.Remote) is there a way to get information about the current RMI request context, specifically the remote client's IP address? public void myMethod() throws RemoteException { log.info("remote IP is "+ RMISomething.getSomething()); } 回答1: See java.rmi.server.RemoteServer#getClientHost 来源: https://stackoverflow.com/questions/590257/determine-remote-client-ip-address-for-java-rmi-call

How do I have to configure a RMI environment so that I'm able to use it in a “real” network?

北城余情 提交于 2019-11-30 17:04:36
Because I didn't want to implement a communication protocol for my client-server based application, I implemented a RMI client and a RMI server on both sides for the information exchange between the two components. If I try to use my application by starting the two components on the same machine, everything is working fine. But if I split the components to two different computers (Kubuntu 9.04 within as a virtual machine within an Windows 7 RC environment with disabled firewall and a native Ubuntu 9.04 environment), it seems like the RMI client is not able to execute the methods which are

Using single RMI Registry

泄露秘密 提交于 2019-11-30 13:40:57
I've been using RMI for a project I am currently working on and I want to bind from multiple hosts to a single RMI registry. However when I attempt to do so I get an error saying java.rmi.AccessException: Registry.Registry.bind disallowed; origin / 192.168.0.9 is non-local host I did so googling and it seems that RMI stops remote hosts from binding by default, what I want to know is there some way of overriding or bypassing this? If anyone any suggestions on how to get past this issue they would be highly appreciated, i've tried using different policy files and overriding the security manger

JNDI注入与反序列化学习总结

余生颓废 提交于 2019-11-30 12:10:40
0x01.java RMI RMI(Remote Method Invocation)是专为Java环境设计的远程方法调用机制,远程服务器实现具体的Java方法并提供接口,客户端本地仅需根据接口类的定义,提供相应的参数即可调用远程方法。RMI依赖的通信协议为JRMP(Java Remote Message Protocol ,Java 远程消息交换协议),该协议为Java定制,要求服务端与客户端都为Java编写。这个协议就像HTTP协议一样,规定了客户端和服务端通信要满足的规范。在RMI中对象是通过序列化方式进行编码传输的。 如上图所示,在JVM之间通信时,客户端要调用远程服务器上的对象时,并不是直接将远程对象拷贝到本地,而是通过传递一个stub。 其中stub就包含了远程服务器的地址和端口等信息,可以看作是远程对象的引用,客户端可以通过调用stub中的方法来对远程对象进行使用,也就是上图所说的逻辑上的调用,而非直接调用,即真实的数据是从客户端到服务端远程对象的stub(存根)到服务器的skeleton(骨架)之间的socket通信。 实际上client并不知道远程服务器的通信地址和端口,但是服务器对象存根(stub)中有这些信息,那么客户端只要拿到stub,通过调用stub上的方法,然后stub再连接到远程服务器的具体端口,服务器执行client所请求的具体方法

what is stub on the “server” and what does skeleton mean?

ぃ、小莉子 提交于 2019-11-30 11:00:39
What does stub do on the server side ? And what is a skeleton ? This is a diagram from wikipedia. I installed stub both on the server machine and the client machine. I understand that stub helps in the networking on the client side but what does stub do on the server side ? Also in the above figure what does skeleton mean ? aMooly look at the followed picture: To be short, stub and skeleton are counterparts in a web service setup. Skeleton belongs to service provider side and stub belongs to receiver side . At lower level stub and skeleton communicate with each other. From client side the

Java性能之优化RPC网络通信

痴心易碎 提交于 2019-11-30 10:57:10
服务框架的核心 大型服务框架的核心:RPC通信 微服务的核心是远程通信和服务治理 远程通信提供了服务之间通信的桥梁,服务治理提供了服务的后勤保障 服务的拆分增加了通信的成本,因此远程通信很容易成为系统瓶颈 在满足一定的服务治理需求的前提下,对远程通信的性能需求是技术选型的主要影响因素 很多微服务框架中的服务通信是基于RPC通信实现的 在没有进行组件扩展的前提下,Spring Cloud是基于Feign组件实现RPC通信(基于HTTP+JSON序列化) Dubbo是基于SPI扩展了很多RPC通信框架,包括RMI、Dubbo、Hessian等(默认为Dubbo+Hessian序列化) 性能测试 基于Dubbo:2.6.4,单一TCP长连接+Protobuf(响应时间和吞吐量更优),短连接的HTTP+JSON序列化 RPC通信 架构演化 无论是微服务、SOA、还是RPC架构,都是分布式服务架构,都需要实现服务之间的互相通信,通常把这种通信统称为RPC通信 概念 RPC:Remote Process Call,远程服务调用,通过网络请求远程计算机程序服务的通信技术 RPC框架封装了底层网络通信和序列化等技术 只需要在项目中引入各个服务的接口包,就可以在代码中调用RPC服务(如同调用本地方法一样) RMI RMI:Remote Method Invocation

java rmi -Djava.rmi.server.hostname=localhost still opens a socket listening on 0.0.0.0

若如初见. 提交于 2019-11-30 09:15:17
I use the -Djava.rmi.server.hostname=localhost option to make rmi listen on localhost only, but netstat shows the socket is listening on 0.0.0.0 . The strange thing is that the RMI RenewClean thread shows its using localhost. E.g. RMI RenewClean-[localhost:59357] I assumed that if I set -Djava.rmi.server.hostname=localhost it should only be listening on 127.0.0.1 Am I misunderstanding what java.rmi.server.hostname controls? I assumed that if I set -Djava.rmi.server.hostname=localhost it should only be listening on 127.0.0.1 No. Am I misunderstanding what java.rmi.server.hostname controls? Yes.