Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb3.proxy erro

 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do anybody has any idea how to get rid of this issue. i tried couple of things including google too but this problem seems to be forever.. thanks in advance

javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb3.JBossProxy (no security manager: RMI class loader disabled)]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:786)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.client.CalculatorClient.main(CalculatorClient.java:31)
Caused by: java.lang.ClassNotFoundException: org.jboss.ejb3.JBossProxy (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.rmi.MarshalledObject.get(Unknown Source)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:710)
... 3 more
-----------------------------------client code-------------------
public static void main(String[] args) {
try {
Context ctx=getInitialContext();

Object ref = ctx.lookup("Calculator/remote");
//Calculator obj = (Calculator)ref;


//Calculator obj=(Calculator)ctx.lookup(Calculator.class.getSimpleName()+"/remote");
//PortableRemoteObject.narrow(obj, Calculator.class);
//System.out.println(obj.add(1, 1));
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


}

public static Context getInitialContext() throws NamingException{
Hashtable env=new Hashtable();
env.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
env.put("java.naming.factory.url.pkgs","=org.jboss.naming rg.jnp.interfaces");
env.put("java.naming.provider.url","localhost");


return new InitialContext(env);
}
--------------------------JBOSS JNDI ENTRY-------------------------

+- Calculator (class: org.jnp.interfaces.NamingContext)
| +- remote (proxy: $Proxy63 implements interface com.pokhriyal.CalculatorRemote,interface org.jboss.ejb3.JBossProxy)
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have jbossall-client.jar in the classpath of your client application which is doing the lookup? You can find that jar in %JBOSS_HOME%\client folder.
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. i do have that file in my classpath.
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to resolve this issue. I am not sure how but i tried almost same code in my laptp and it worked. It looks a like some jar file issue of jbossall-client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic