[Design of POJO Server] - Re: Missing org.jnp.server.NamingServer_Stub
by adrian@jboss.org
"adrian(a)jboss.org" wrote :
| Can you try getting jboss-4.2.x to ignore stub classes and always use dynamic proxies?
| i.e. start jboss-4.2.x with -Djava.rmi.server.ignoreStubClasses=true
If I do that, then a 5.0.x -> 4.2.x lookup works.
Here's a simple jsp page (you'll need to change the provider url)
| <%@page contentType="text/html"
| import="java.util.Properties,javax.naming.*"
| %>
|
| <%
| Properties props = new Properties();
| props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| props.put("java.naming.provider.url", "127.0.0.1:1099");
| InitialContext ctx = new InitialContext(props);
| Object obj = ctx.lookup("jmx/rmi/RMIAdaptor");
| %>
| <body>
| Got <%= obj %> of type <%= obj.getClass() %>
| <body>
| </body>
| </html>
|
But a 4.2.x -> 5.0.x lookup fails because of the new interface:
| javax.naming.CommunicationException: Failed to connect to server 127.0.0.1:1099 [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingEvents (no security manager: RMI class loader disabled)]
| org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
| org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
| org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
| org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| javax.naming.InitialContext.lookup(InitialContext.java:351)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191244#4191244
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191244
17 years, 4 months
[Design of POJO Server] - Re: Missing org.jnp.server.NamingServer_Stub
by adrian@jboss.org
"adrian(a)jboss.org" wrote :
| Which way around is this test? It's not clear from the above description.
| The old stub should be available in 4.2.x without the new interface methods?
|
I think this is 5.0.x lookup 4.2.x isn't it?
If you look at 4.2.x the server isn't using the dynamic proxy
because the stub exists on the server.
| 2008-11-21 13:16:46,000 DEBUG [org.jboss.naming.Naming] NamingServer stub: NamingServer_Stub[UnicastRef2 [liveRef: [endpoint:[127.0.0.1:1098,org.jboss.net.sockets.Defa
| ultSocketFactory@e048aaa4[bindAddress=/127.0.0.1]](local),objID:[0]]]]
|
So if the server used the stub class then the client must also do the same.
Can you try getting jboss-4.2.x to ignore stub classes and always use dynamic proxies?
i.e. start jboss-4.2.x with -Djava.rmi.server.ignoreStubClasses=true
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191240#4191240
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191240
17 years, 4 months
[Design of POJO Server] - Re: Missing org.jnp.server.NamingServer_Stub
by adrian@jboss.org
It is using the dynamic proxy which you can see from the logging
when it binds the stub:
| 2008-11-21 13:06:31,807 DEBUG [org.jboss.naming.Naming] (main) Creating NamingServer stub, theServer=MBeanProxyExt[jboss:service=NamingBeanImpl],rmiPort=1098,clientSoc
| ketFactory=null,serverSocketFactory=org.jboss.net.sockets.DefaultSocketFactory(a)e048aaa4[bindAddress=/127.0.0.1]
| 2008-11-21 13:06:32,082 DEBUG [org.jboss.naming.Naming] (main) NamingServer stub: Proxy[Naming,RemoteObjectInvocationHandler[UnicastRef2 [liveRef: [endpoint:[127.0.0.1
| :1098,org.jboss.net.sockets.DefaultSocketFactory@e048aaa4[bindAddress=/127.0.0.1]](local),objID:[0]]]]]
|
My guess is that it can't deserialze the proxy because there is a new interface not in 4.2.x
i.e. org.jnp.interfaces.NamingEvents
so it is falling back to trying to use the stub?
Which way around is this test? It's not clear from the above description.
The old stub should be available in 4.2.x without the new interface methods?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191238#4191238
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191238
17 years, 4 months