rmi

java rmi authentication & security. exportObject makes it public?

元气小坏坏 提交于 2019-12-07 20:05:20
问题 The Question: When you UnicastRemoteObject.exportObject(instance) . Does that instance now become publicly available to all clients. Even if a little tricky is required to find its port. This is the situation: I have a java RMI client/server setup and I wanted to add some authentication. Allowing the client to user a user/pass combo before any of the other RPC calls work. I found a simple suggestion online that looked like a good idea at first. interface LoginService implements Remote {

RMI connection refused

回眸只為那壹抹淺笑 提交于 2019-12-07 17:50:49
问题 I am trying to get a rmi connection going. I have ran into many security issues but have been unable to find a way past all this. I execute my jar file with: java -Djava.security.policy=java.security.AllPermission -jar "myjarfile" The code I have been using to create this is: public class server { public static void main(String args[])throws Exception { if (System.getSecurityManager() == null) System.setSecurityManager ( new RMISecurityManager() { public void checkConnect (String host, int

closing rmi registry

微笑、不失礼 提交于 2019-12-07 14:16:44
问题 Using RMI to pass String object from WebAppA to WebAppB.WebAppB is the RMIServer whereas WebAppA is RMIClient.I have added ContextListener in WebAppB, so that the rmi service starts right away when the context is initialized in tomcat.And in the contextDestroyed method of tomcat I am trying to close/shut down rmi using the following statements: unexportObject(remoteObj,true); LocateRegistry.getRegistry(3232).unbind("MessagePath"); //MessagePath - name of the remote reference But even after

security policy files and jar

佐手、 提交于 2019-12-07 07:28:56
问题 I have got RMI application, so I need to use policy files. my policy file is simple (conf.txt): grant { permission java.security.AllPermission; }; I have no problems running my application from eclipse. I've added: -Djava.security.policy=conf.txt to the VM arguments. What I want to do is to build a jar file. I made it as Runnable JAR file from eclipse and I'm having some problems running it. I try to run it like this: java -Djava.security.policy=C:\Users\myuser\proj\conf.txt -jar C:\Users

How do I use Jconsole to connect to EC2?

泪湿孤枕 提交于 2019-12-07 03:19:26
问题 I am running Jconsole on my macbook and trying to connect to a linux terminal on ec2 that does not have graphics(only command line access). I run my code like this: java -jar program.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9005 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.remote.ssl=false I read here that there was a problem with accessing via EC2(after I had problems connecting) and the solution seemed to be ' java.rmi.server.hostname

Which Java RMI/RPC/IPC technology should I use?

人走茶凉 提交于 2019-12-07 03:07:59
问题 I'm developing a Java application that consists of a server and a client (possibly multiple clients in future) which may run on different hosts. For communication between these two I currently use a custom protocol which consists of JSON messages that are sent over network sockets and that are converted back to Java Bean objects on both sides. However the more complex the application gets I notice that this method doesn't meet my standards and is too complex. I'm looking for a well

EJB到底是什么,真的那么神秘吗??

扶醉桌前 提交于 2019-12-06 21:26:40
1. 我们不禁要问,什么是"服务集群"?什么是"企业级开发"? 既然说了EJB 是为了"服务集群"和"企业级开发",那么,总得说说什么是所谓的"服务 集群"和"企业级开发"吧! 这个问题其实挺关键的,因为J2EE 中并没有说明白,也没有具体的指标或者事例告诉 广大程序员什么时候用EJB 什么时候不用。于是大家都产生一些联想,认为EJB"分布式运 算"指得是"负载均衡"提高系统的运行效率。然而,估计很多人都搞错了,这个"服务群集" 和"分布式运算"并没有根本解决运行负载的问题,尤其是针对数据库的应用系统。 为什么? 我们先把EJB 打回原形给大家来慢慢分析。 2. 把EJB 掰开了揉碎了 我们把EJB 的概念好好的分析一下,看看能发现些什么蛛丝马迹。 3.1 EJB 概念的剖析 我们先看一下,EJB 的官方解释: 商务软件的核心部分是它的业务逻辑。业务逻辑抽象了整个商务过程的流程,并使用计 算机语言将他们实现。 …… J2EE 对于这个问题的处理方法是将业务逻辑从客户端软件中抽取出来,封装在一个组 件中。这个组件运行在一个独立的服务器上,客户端软件通过网络调用组件提供的服务以实 现业务逻辑,而客户端软件的功能单纯到只负责发送调用请求和显示处理结果。在J2EE 中, 这个运行在一个独立的服务器上,并封装了业务逻辑的组件就是EJB(Enterprise Java Bean)组件。

RMI exportObject(Remote obj, PORT); createRegistry(PORT);

陌路散爱 提交于 2019-12-06 16:10:49
问题 I'm wondering can both the UnicastRemoteObject.exportObject(Remote,portNo) & LocateRegistry.createRegistry(portNo); porNo be the same? I test it works but I'm worrid if there is any complication? Why does exportObject need to specify an object to work? when I use exportObject(Remote obj) it throws an NullPointerException . 回答1: I'm wondering can both the UnicastRemoteObject.exportObject(Remote,portNo) & LocateRegistry.createRegistry(portNo); portNo be the same? Yes, unless you are using

Spring + Websphere 8.5: Unable to lookup JNDI name [java:comp/websphere/ExtendedJTATransaction]

家住魔仙堡 提交于 2019-12-06 14:26:17
There is a Websphere AS 8.5 where runs XA Datasource. Also there is a Spring application which must work in this environment and connect to the datasource. An application context is loaded by a servlet and the application uses RmiExporters to provide RMI access to some services (which are shared in the separate thread) and all DAOs' methods are marked with @Transactional . If I try to write something to the database from the main thread (e.g. during initialization of any class), it works properly. But if I try to write (or read with HQL SELECT-query) something via RMI invokation I see an

RMI from Tomcat to Weblogic

ぐ巨炮叔叔 提交于 2019-12-06 13:42:22
I have a webapp that is integrating with a RMI interface on a weblogic server. During development I used the wlfullclient.jar and everything was fine. But as I deployed the war on Tomcat I encountered a problem: validateJarFile(.../wlfullclient-10.3.2.jar) - jar not loaded. See Servlet Spec 2.3 ...Offending class: javax/servlet/Servlet.class So wlfullclient.jar has its own implementation of javax.servlet.Servlet and Tomcat doesnt like it. What can I do? Without wlfullclient.jar I get javax.sercurity.auth.login.LoginException: Login failure: all modules ignored I have tried using wlthint3client