RMi client dont lookup!
hello
I write easy RMI server and client... Every things seems look well but client dont catch reference to remote object or I dont know what...
I see "Lookuje" on console but "done" dont show...
try{
System.out.println("Lookuje");
TeleBook w = (TeleBook)Naming.lookup("rmi//loaclhost/magazine");
System.out.println("Done");
} catch(Exception e) {
e.toString();
}I have all "stub" in directory and policy, rmiregister run, please help i dont know what to do... Next step will be write all again
All source: http://ekontra.com/sadu/DEMO/RMI.rar
As your catch block has suppressed all the relevant information it is impossible to say what the problem is. Try printing something out ...
Similar Messages
-
How do I make a RMI client running in Bea find a remote, non Bea, RMI server?
On my stand alone test system I run a RMI server in one JVM,
registry.exe and a RMI client in its own JVM. The client uses
java.rmi.Naming.lookup() to find the RMI server, and this works fine.
If I run the same RMI client class within Bea the naming lookup fails! I
guess this is due to Bea using it own RMI registry rather than the
registry.exe I started separately(?)
QUESTION: How do I make a RMI client running in Bea find a remote,
non-Bea, RMI server?
Of course, in the final environment the server will run on a system
remote from Bea.
The RMI client calls are done from a servlet, not from a EJB.
The doumentation about using RMI with Bea is focused on running the RMI
server within Bea. This might be the "normal" thing to do, but in our
case Bea is the client, not the server. Do I still need to use
weblogic.rmi.*....? If so, where?
Grateful for any tip.
Göran HagnellOn my stand alone test system I run a RMI server in one JVM,
registry.exe and a RMI client in its own JVM. The client uses
java.rmi.Naming.lookup() to find the RMI server, and this works fine.
If I run the same RMI client class within Bea the naming lookup fails! I
guess this is due to Bea using it own RMI registry rather than the
registry.exe I started separately(?)
QUESTION: How do I make a RMI client running in Bea find a remote,
non-Bea, RMI server?
Of course, in the final environment the server will run on a system
remote from Bea.
The RMI client calls are done from a servlet, not from a EJB.
The doumentation about using RMI with Bea is focused on running the RMI
server within Bea. This might be the "normal" thing to do, but in our
case Bea is the client, not the server. Do I still need to use
weblogic.rmi.*....? If so, where?
Grateful for any tip.
Göran Hagnell -
RMI Client UnmarshalException with UNC paths
I have a 'none' Java application, that has an embedded JVM which is being used as an RMI server to allow communication to the application from a browser. The applet detects the presence of the RMI server and if not detected, will start the application, which in turns starts the RMI server. Once the RMI server is started the Client then invokes the method on the server, and hence into the application.
If the executable for this application is pathed to either a local or mapped drive then everything works as expected, if I then try to use a UNC path, once the RMI server is started, the client returns an UnmarshalException:
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
java.io.EOFException
at java.io.DataInputStream.readByte(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
I guess that the problem is that the serialization process has been started, and as the client starts reading from the datastream the UNC paths cause the EOF Exception. any help on how to get round this problem would be gratefully received. Unfortunately using a mapped drive is not a solution to this problem due to the way the application is being served.Hi all,
It turns out that when the java.policy file is being read, it ignores the servername on the UNC path and therefore looks for a directory of the remaining data of the UNC path for the file. I guess it is now a task of figuring out why this is... -
Running applet as RMI client from remote computer
Hi,
I am doing this project that requires that i run an applet (which is an RMI client) from a computer different than the one that has the RMI server running.
Right now, i can run my server and applet on the same computer and it all works fine. But i don't know how to make the applet communicate with an RMI server that resides on another computer. Does this has anything to do with TOMCAT.
I was wondering if this is possible.
Thank you in advance.Do This
RemoteInterfaceName server = (RemoteInterfaceName) Namin.lookup("rmi://yourserver/server/YourServerName");
server.methodName(args);
suppose you have your server in the dir path
c:\prj\server
then set your webserver's root dir to c:\prj\server how this is done will be in the web server's documentation
Try It otherwise we'll see it again
Bye !!! -
Rmi client throws Connection Refused exception
My Rmi client throws a Connection Refused exception when i try to run it on remote machine (in this case i run it on my virtualbox macine).
The virtualbox machine network is in NAT mode (host machine ip should be 10.0.2.2).
When rmi client starts get registry instance and print in standar output:
RegistryImpl_Stub[UnicastRef2 [liveRef: [endpoint:[//10.0.2.2/:1099,util,RmiInstances$1@1275d39](remote),objId:[0:0:0, 0]]]]But when rmi client trys to use any of remote methods it throws Connection Refused, but it's to strange because the Connection Refused has 127.0.1.1 as ip.
java.rmi.ConnectException: Connection refused to host: 127.0.1.1; ....In client RmiInstances code (this class contains all remote implementations) is:
public class RmiInstances {
private static RmiInstances instance;
private IUserManage userManage;
private IAnalysis analysis;
private IPacientManage pacientManage;
private IInsuranceManage insuranceManage;
private Config config;
private RmiInstances()
throws RemoteException, NotBoundException, IOException {
this.config = Config.getInstance();
Registry registry = LocateRegistry.getRegistry(config.getServerUrl()+"/",
1099, new RMIClientSocketFactory() {
@Override
public Socket createSocket(String host, int port) throws IOException {
try {
URI uri = new URI(config.getServerUrl()+
":"+config.getServerPort());
return new Socket(uri.getHost(), uri.getPort());
} catch (URISyntaxException ex) {
ex.printStackTrace();
return null;
System.out.println(registry);
userManage = (IUserManage)registry.lookup("RUserManage");
analysis = (IAnalysis)registry.lookup("RAnalysis");
pacientManage = (IPacientManage)registry.lookup("RPacientManage");
insuranceManage = (IInsuranceManage)registry.lookup("RInsuranceManage");
...And server code is the next:
public static void main(String[] args) {
System.out.println("GNULab Server " + VERSION + " starting...");
System.setProperty("java.rmi.server.codebase",
"file:/home/zarovich/workspace/labserver/bin");
try {
// Loading config
System.out.println("Loading config...");
Config config = Config.getInstance();
// inicializando rmi registry
Registry registry;
if (config.isSsl()) {
registry = LocateRegistry.createRegistry(
config.getServerPort(), new RmiSSLClient(),
new RmiSSLServer());
} else
registry = LocateRegistry
.createRegistry(config.getServerPort());
// instanciando implementaciones
RAnalysis rAnalysis = new RAnalysis();
RInsuranceManage rInsuranceManage = new RInsuranceManage();
RPacientManage rPacientManage = new RPacientManage();
RUserManage rUserManage = new RUserManage();
// registrando interfaz rmi
registry.rebind("RAnalysis", (IAnalysis) UnicastRemoteObject.exportObject(rAnalysis, 0));
registry.rebind("RInsuranceManage", (IInsuranceManage) UnicastRemoteObject.exportObject(rInsuranceManage, 0));
registry.rebind("RPacientManage", (IPacientManage) UnicastRemoteObject.exportObject(rPacientManage, 0));
registry.rebind("RUserManage", (IUserManage) UnicastRemoteObject.exportObject(rUserManage, 0));
System.out.println("GNULab Server " + VERSION + " listening ...");
System.out.println("Registry instance: " + registry.toString());
} catch (RemoteException e) {
e.printStackTrace();
* catch (MalformedURLException e) { e.printStackTrace(); }
*/catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JDOMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
...I'm solved my problem.
I just need run my server with -Djava.rmi.serverhost=10.0.2.2 and my client running on my virtualbox machine works! -
10.1.3.1 and standalone RMI client
I'm migrating our J2EE applications from 10.1.2.0.1 to 10.1.3.1.0. I also have a custom JAAS login module that is used by our applications. I have the login module working successfully and web applications that can call EJBs.
But I am unable to get a simple RMI client to call the EJBs. I can see from the server logs that the JAAS module executes successfully, but then I get a ClassNotFoundException (seems to be from the server) when the client tries to access the JNDI tree (see stack below on the client; I can't find any log relating to this event on the server).
I had real problems with RMI access in 10.1.2, seems that Oracle AS isn't really thought through with respect to simple RMI client access. In the system-jazn-data.xml file I have granted my custom principals the RMI login permission. I tried to raise a TAR but it's been rejected because 10.1.3.1.0 is a "preview" version. (Don't you guys want to know about bugs before a release goes into production?)
Any ideas?
27-Sep-2006 14:50:46 oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_R
EMOTE_SERVER
WARNING: Exception returned by remote server: {0}
java.lang.ClassNotFoundException: com/evermind/server/ejb/EJBHomeObjectInfo
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoader
ObjectInputStream.java:33)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:153
8)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1628)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at java.util.HashMap.readObject(HashMap.java:1013)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at com.evermind.server.rmi.RMIClientConnection.handleListContextResponse
(RMIClientConnection.java:768)
at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse
(RMIClientConnection.java:242)
at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClien
tConnection.java:205)
at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RM
IClientConnection.java:187)
at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.jav
a:152)
at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnec
tion.java:127)
at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
utor.java:814)
at java.lang.Thread.run(Thread.java:595)
javax.naming.NamingException: com/evermind/server/ejb/EJBHomeObjectInfo [Root ex
ception is java.lang.ClassNotFoundException: com/evermind/server/ejb/EJBHomeObje
ctInfo]
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:1
00)
at com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMICl
ientConnection.java:334)
at com.evermind.server.rmi.RMIClientConnection.list(RMIClientConnection.
java:293)
at com.evermind.server.rmi.RMIClient.list(RMIClient.java:392)
at com.evermind.server.rmi.RMIClientContext.getListValues(RMIClientConte
xt.java:95)
at com.evermind.server.rmi.RMIContext.listBindings(RMIContext.java:444)
at com.evermind.naming.FilterContext.listBindings(FilterContext.java:91)
at com.evermind.server.ApplicationClientContext.listBindings(Application
ClientContext.java:127)
at javax.naming.InitialContext.listBindings(InitialContext.java:406)
at com.axiomsystems.common.tools.test.APITester.getEJBs(APITester.java:2
06)
at com.axiomsystems.common.tools.test.APITester.<init>(APITester.java:17
3)
at com.axiomsystems.common.tools.test.APITester.main(APITester.java:68)
Caused by: java.lang.ClassNotFoundException: com/evermind/server/ejb/EJBHomeObje
ctInfo
at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_
SERVER(RMICall.java:109)
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:9
1)
... 11 moreHi Debu,
I have found the problem and a workaround in my code.
I obtained the initial context ctx with the following properties set:
Context.INITIAL_CONTEXT_FACTORY (= oracle.j2ee.naming.ApplicationClientInitialContextFactory)
Context.PROVIDER_URL (= opmn:ormi://myHost:myPort:myOC4J/myApp)
Context.SECURITY_PRINCIPAL (= my username)
Context.SECURITY_CREDENTIAL (= my password)
then I did
NamingEnumeration en = ctx.listBindings("ejb/myJndiName")
which resulted in the exception.
Changing this to
Context ctx2 = (Context)ctx.lookup("ejb/myJndiName");
NamingEnumeration en = ctx2.listBindings("");
has resolved the problem. I'm not sure why this behaves differently, I suppose it may have something to do with the fact that ctx2 is not an InitialContext object. It is an adequate workaround for my application.
Once I have an EJB reference, invoking methods over RMI works as expected.
Thanks,
Keith -
No security manager: RMI class loader disabled Error at RMI client programm
Got following error on invoking remote method from RMI client,
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: com.rmi.RmiImpl_Stub (no security manager: RMI class loader disabled)
Please let me know solution.Hello JAAZ,
I got the same error yesterday. I was a little frustrated, because the day before everything was fine...
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: uk.co.it.ete.server.ETE_Server (no security manager: RMI class loader disabled)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)The solution was, that I did some refactoring and some of the classes were now in different packages. I updated the system on the client-side and now everything works again.
I think debugging RMI-applications is not as easy as "normal" applications ..
maybe this helps..
Regards
tk -
RMI client running from different machine giving error
HI all
I am trying to run the sample application getStart hello world.
I am able to run the java applet from the same machine ....
but i am get error when i am trying run client applet from the different machine .
(HelloApplet exception: access denied (java.net.SocketPermission)
client applet on machine1 and server and registory on machine2 in same lan .
i copied the Helloapplet.class and Helloclient.html to machine1.
appletviewer Helloclient.html
but the java version is different in both machines.......
can any one give some idea ....
the errror i am geting is :
HelloApplet exception: access denied (java.net.SocketPermission Neind-ws-003 res
olve)
java.security.AccessControlException: access denied (java.net.SocketPermission N
eind-ws-003 resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:272)
at java.security.AccessController.checkPermission(AccessController.java:
399)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1042)
at java.net.InetAddress.getAllByName0(InetAddress.java:559)
at java.net.InetAddress.getAllByName0(InetAddress.java:540)
at java.net.InetAddress.getByName(InetAddress.java:449)
at java.net.Socket.<init>(Socket.java:100)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:25)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:120)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at examples.hello.HelloApplet.init(HelloApplet.java:23)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484)
The helloapplet.java code is :
package examples.hello;
import java.applet.Applet;
import java.awt.Graphics;
import java.rmi.Naming;
import java.rmi.RemoteException;
public class HelloApplet extends Applet {
String message = "blank";
// "obj" is the identifier that we'll use to refer
// to the remote object that implements the "Hello"
// interface
Hello obj = null;
public void init() {
try {
System.out.println("Path looking: " +getCodeBase().getHost());
//obj = (Hello)Naming.lookup("//" +
// getCodeBase().getHost() + "/HelloServer");
obj = (Hello)Naming.lookup("//Neind-ws-003/HelloServer");
message = obj.sayHello();
} catch (Exception e) {
System.out.println("HelloApplet exception: " +
e.getMessage());
e.printStackTrace();
public void paint(Graphics g) {
g.drawString(message, 25, 50);
The helloclient.html code:
<HTML>
<title>Hello World</title>
<center> <h1>Hello World</h1> </center>
The message from the HelloServer is:
<p>
<applet
code="examples.hello.HelloApplet"
width=500 height=120>
</applet>
</HTML>Your problem is at the following line.
obj = (Hello)Naming.lookup("//Neind-ws-003/HelloServer");
The line you had commented beforehand is
//obj = (Hello)Naming.lookup("//" +
// getCodeBase().getHost() + "/HelloServer");
This worked because the applet was being retreived from the same server where the RMI server exists.
Remember, applets can only connect themselfs to the same host they are stored in and retreived from. This is because of VM, the sandbox does not allow you to connect to other machines other than the server where it resides on. If you use a applet viewer it might work if you loosen the security features. On a browser i do not belive it can be done. Maybe if you modify your security options for the VM you are able to achieve something, but personally i'm going for the "It cannot be done " answer because of what I said before.
Hope this helps
If any trouble then reply and I'll answer later.
Rui P. -
Servlet acts as an RMI client to get the current time of day
my application is servlet acts as an RMI client to get the current time of day from the DaytimeServlet RMI server so iam not getting the correctime....
import java.io.*;
import java.rmi.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DaytimeClientServlet extends
HttpServlet
DaytimeServer daytime;
protected DaytimeServer getDaytimeServer() {
DaytimeServer stub.
if (System.getSecurityManager() == null) {
System.setSecurityManager(new
RMISecurityManager());
try {
Registry registry =
LocateRegistry.getRegistry(getRegistryHost(),
getRegistryPort());
return
(DaytimeServer)registry.lookup(getRegistryName());
catch (Exception e) {
getServletContext().log(e, "Problem getting
DaytimeServer reference");
return null;
private String getRegistryName() {
String name = getInitParameter("registryName");
return (name == null ? "DaytimeServlet" : name);
private String getRegistryHost() {
return getInitParameter("registryHost");
private int getRegistryPort() {
try { return
Integer.parseInt(getInitParameter("registryPort");
catch (NumberFormatException e) { return
Registry.REGISTRY_PORT; }
public void doGet(HttpServletRequest req,
HttpServletResponse res)
throws
ServletException, IOException {
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
if (daytime == null) {
daytime = getDaytimeserver();
if (daytime == null) {
throw new UnavailableException(this, "Could
not locate daytime");
out.println(daytime.getDate().toString());
please help me outHi lucentb,
what i observed from your code is some simple coding faults are there.. so i am giving you some test code..
i hope this will help you out.
import java.io.*;
import java.rmi.*;
import java.rmi.registry.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DaytimeClientServlet extends HttpServlet
DaytimeServer daytime;
protected DaytimeServer getDaytimeServer()
if (System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());
try {
Registry registry = LocateRegistry.getRegistry(getRegistryHost(),
getRegistryPort());
return
(DaytimeServer)registry.lookup(getRegistryName());
catch (Exception e) {
getServletContext().log(e, "Problem getting DaytimeServer reference");
return null;
private String getRegistryName()
String name = getInitParameter("registryName");
return (name == null ? "DaytimeServlet" : name);
private String getRegistryHost() {
return getInitParameter("registryHost");
private int getRegistryPort()
try
return
Integer.parseInt(getInitParameter("registryPort")); }
catch (NumberFormatException e)
return
Registry.REGISTRY_PORT;
public void doGet(HttpServletRequest req,
HttpServletResponse res)
throws
ServletException, IOException {
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
if (daytime == null) {
daytime = getDaytimeServer();
if (daytime == null) {
// Couldn't get it, so report we're
unavailable.
throw new UnavailableException(this, "Could
not locate daytime");
out.println(daytime.getDate().toString());
If you have any problem after this please send me the exceptions and problem situations with deatils codes..
Regards,
TirumalaRao
Developer Technical Support,
Sun Microsystems, India. -
Using an RMI Client to connect to a Server.
I am using an RMI Client on my PC (using Eclipse 3.2) to connect to a Server on a Linux System.
The Server is up and running and from the client side,I am reading all the server configuration into a variable and passing this variable into Naming,lookup.
String lookUp = "//" + prop.getProperty("rmi.hostName") +
":" + prop.getProperty("rmi.appPort") +
"/" + prop.getProperty("rmi.appName);
System.out.println(lookUp) // Value://17.10.222.80:40009/RMIAPP
Application a = (Application)Naming.lookup(lookUp) It is unable to connect to the Server.
Am I missing anything? Have I overlooked any point?
Thankshttp://java.sun.com/docs/books/tutorial/rmi/index.html
-
HELP! Having trouble connecting to EJB with RMI client
I've got a simple stateless session EJB deployed and I'm trying to connect
to it using a standalone
RMI client. I'm getting the following error back when I first do a
context.lookup("ejb/beanname"):
org.omg.CORBA.COMM_FAILURE: minor code: 1 completed: Maybe
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at java.lang.RuntimeException.<init>(RuntimeException.java:47)
at org.omg.CORBA.SystemException.<init>(SystemException.java:49)
at org.omg.CORBA.COMM_FAILURE.<init>(COMM_FAILURE.java:77)
at org.omg.CORBA.COMM_FAILURE.<init>(COMM_FAILURE.java:63)
at
com.sun.corba.ee.internal.iiop.IIOPConnection.purge_calls(Compiled Code)
at com.sun.corba.ee.internal.iiop.ReaderThread.run(Compiled Code)
Any troubleshooting advice would be greatly appreciated.
BTW: After this error, iPlanet's cxs process seems to die! Until I restart
cxs I get no connection failures
of the form:
javax.naming.CommunicationException:
Cannot connect to ORB. Root exception is org.omg.CORBA.COMM_FAILURE:
minor code: 1398079490 completed: No
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(RuntimeException.java:47)
at org.omg.CORBA.SystemException.<init>(SystemException.java:49)
at org.omg.CORBA.COMM_FAILURE.<init>(Compiled Code)
at org.omg.CORBA.COMM_FAILURE.<init>(Compiled Code)
at com.sun.corba.ee.internal.iiop.IIOPConnection.writeLock(Compiled
Code)
at com.sun.corba.ee.internal.iiop.IIOPConnection.send(Compiled Code)
at com.sun.corba.ee.internal.iiop.IIOPOutputStream.invoke(Compiled
Code)
at
com.sun.corba.ee.internal.iiop.ClientRequestImpl.invoke(ClientRequestImpl.ja
va:74)
at
com.sun.corba.ee.internal.corba.ClientDelegate.invoke(ClientDelegate.java:16
0)
at
com.sun.corba.ee.internal.corba.InitialNamingClient.resolve(InitialNamingCli
ent.java:199)
at
com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialReferences(
InitialNamingClient.java:278)
at
com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_referenc
es(InitialNamingClient.java:187)
at
com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.java:1422
at
com.sun.corba.ee.internal.POA.POAORB.resolve_initial_references(POAORB.java:
541)
at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:252)
at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(Compiled Code)
at
com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:185)
at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:72)
.... stuff deleted....
Is RMI client support in iPlanet 6.0 truly this buggy or am I missing
something?
Jack Profit
[email protected]Make sure to review the Converter sample and employ all of the workarounds
listed there.
David
Jack Profit wrote:
I've got a simple stateless session EJB deployed and I'm trying to connect
to it using a standalone
RMI client. I'm getting the following error back when I first do a
context.lookup("ejb/beanname"): -
RMI client-side - how to encrypt,decrypt in client-side
I write javacard RMI style. My problem is...
Source code below is work when it write in applet (card - side)
but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. Did I misunderstand?
if it make for use in applet only, how is possible to do like this " card use privatekey to sign message and send to reader , reader use card's publickey to verify that card sign this signature or not."
or
"card use reader's publickey to encrypt message and send to reader, then reader use privatekey to decrypt message (reader authencate itself) "
because I can't do any of cipher , keybuilder in RMI-client side(reader)
Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
it will throw nullPointerException
and if (change false to true)
Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
after that I swap this line with
pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
since it will do this first (i swap the line already) it also throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
also be the same result with swap
kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
to a first line
it throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
Please help me
RSAPrivateKey pri_key;
RSAPublicKey pub_key;
KeyPair kp;
Cipher RSAcipher;
RSAcipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
pub_key =(RSAPublicKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PUBLIC,KeyBuilder.LENGTH_RSA_512, false);
kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
kp.genKeyPair();
pri_key = (RSAPrivateKey) kp.getPrivate();
pub_key = (RSAPublicKey) kp.getPublic();
//ENCRYPT
RSAcipher.init(pri_key, Cipher.MODE_ENCRYPT);
t_cipherLengthRSA = RSAcipher.doFinal(plaintxt,(short)0, (short)plaintxt.length, t_cipherText, (short)0);
//DECRYPT
RSAcipher.init(pub_key, Cipher.MODE_DECRYPT);
RSAcipher.doFinal(ciphertxt,(short)0,(short) t_cipherLengthRSA, temp1, (short)0);I write javacard RMI style. My problem is...
Source code below is work when it write in applet (card - side)
but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw
exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHMYou can not share code between card and client. On the card use the classes of javacardx.crypto and on the client side those of javax.crypto and java.security.
It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. That is right.
if it make for use in applet only, how is possible to
do like this " card use privatekey to sign message
and send to reader , reader use card's publickey to
verify that card sign this signature or not." or
"card use reader's publickey to encrypt message and
send to reader, then reader use privatekey to decrypt
message (reader authencate itself) "On each platform you have classes that provide the same cryptographic operations but the interface of these classes is different (because of the limitations of the java card platform).
because I can't do any of cipher , keybuilder in
RMI-client side(reader)Use the java.security.KeyFactory instead.
Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
it will throw nullPointerException
and if (change false to true)
Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
throw exception 0x3 -
javacard.security.CryptoException.NO_SUCH_ALGORITHMCryptographic support on java cards is optional. Not every card supports every algorithm. Try to use another algo.
Jan -
RMI server object lookup in a session bean
Hi all,
I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
bean. Following is the code and exception. Please note that I am using java.rmi
package instead of weblogic.rmi and that both the session bean and RMI server
object (a startup class) is deployed on the same machine.
Thanks for your help in advance.
// a simple, replica-aware session bean method
// some code here
try {
MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
catch (Exception e) {
// log the exception
The exception:
java.rmi.MarshalException: Error marshaling transport header; nested exception
i
s:
java.io.EOFException
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:224)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
a:88)
at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
a:28)
at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
di8yo_EOImpl.java:46)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
e)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:762)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:295)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)Hi Pyung,
How about trying this instead:
InitialContext ctx = new InitialContext();
MediatorInterface mediator = (MediatorInterface) ctx.lookup("TestMediator");
This assumes your startup class binds the Mediator to the JNDI name "TestMediator".
- Matt
Pyung Yoon wrote:
Hi all,
I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
bean. Following is the code and exception. Please note that I am using java.rmi
package instead of weblogic.rmi and that both the session bean and RMI server
object (a startup class) is deployed on the same machine.
Thanks for your help in advance.
// a simple, replica-aware session bean method
// some code here
try {
MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
catch (Exception e) {
// log the exception
The exception:
java.rmi.MarshalException: Error marshaling transport header; nested exception
i
s:
java.io.EOFException
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:224)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
a:88)
at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
a:28)
at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
di8yo_EOImpl.java:46)
at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
e)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:114)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:762)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:295)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133) -
RMI Client on Linux issue.
I am facing Java RMI problem on Suse Linux.
RMI server running on solaris and RMI client running on Solaris ---> works fine
RMI server running on solaris and RMI client running on Linux ---> gives error
Pls note that RMI server running fine. When invoking remote method from RMI client on Suse Linux, I get following error.
Java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: RemoteVtskImpl_Stub
Any help/pointers will be useful.Even we tried setting the CLASSPATH to point to those jar files. But still the problem persist.
At run time is there any way to see what all the _stub files are downloaded in the JVM at the client machine (linux machine in our case) from the server machine (solaris machine in our case). -
Hi,
I am trying to use a jApplet as an rmi client. However, either creating a new instance of the class i created, that extends jApplet, in the rmi client class i created or creating a new instance of the rmi client in the class that extends jApplet results in error.
What is the correct way to go about doing this? I developed the jApplet thinking it could be simply used with the rmi client.
instanciating the rmi client in the jApplet class gives :
java.lang.OutOfMemory Error
instanciating the jApplet class in the rmi client class gives other errors I am unable to reproduce at the moment :(
thanks for any help
-Paulo Murphy de FreitasHi,
I am trying to use a jApplet as an rmi client. However, either creating a new instance of the class i created, that extends jApplet, in the rmi client class i created or creating a new instance of the rmi client in the class that extends jApplet results in error.
What is the correct way to go about doing this? I developed the jApplet thinking it could be simply used with the rmi client.
instanciating the rmi client in the jApplet class gives :
java.lang.OutOfMemory Error
instanciating the jApplet class in the rmi client class gives other errors I am unable to reproduce at the moment :(
thanks for any help
-Paulo Murphy de Freitas
Maybe you are looking for
-
Count MySQL rows based off Value in Dynamic Table
Greetings all. I have 2 MySQL tables; 1 that contains the names of my classes.(Class A, Class, B, etc.) and 1 table that contains the names of students in each Class (for example Class A: John Doe; Class A: Susie Smith.; Class B: Jane Doe). In the 2n
-
Hi all, Is there any Standard Batch/ input recording program or BAPI or IDOC is available for PK01. please reply if anyone have idea. Thanks Gaurav
-
Image won't display at top of page: Firefox, Opera
http://www.mariagrist.net/dev/TCT/ It's the logo at the top left I am looking at. The image is inside a td which has a valign=top attribute. Image correctly displays flush to top of page in Internet Explorer, but there is a white gap in both IE and O
-
itms9000 No .app bundles found in the package at "software assets/softwareasset (MZitmsSoftwareAssetpackage)"
-
I am testing out several raw image converter programs (trial versions). Just noticed that the new iPhoto has added photo editing capability over my version. Does anyone have experience with these features enough to compare them with the corresponding