users@glassfish.java.net

Re: EJB remote deployed on GF 3.1 behind a NAT unaccessible

From: <forums_at_java.net>
Date: Tue, 30 Oct 2012 12:09:22 -0500 (CDT)

finally i get the InitialCOntext , but when i call the ejb i get another
eception: it seem that the name of interface of myejb it is not bound in the
COntext. But the ejb uit is deployed and the fully nome of interface it is
ok! Name com.edw.facade.ConnectionFacadeRemote is not bound in this Context
javax.naming.NameNotFoundException i post the complet code of my servlet and
the exception; if i make cts.toString() i get
context=javax.naming.InitialContext_at_7a9224 but the call at context it is
without props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.enterprise.naming.SerialInitContextFactory"); if i add the code i
get the excption fot Class not found for
com.sun.enterprise.naming.SerialInitContextFactory the InitialContext it is
from constructor without arguments. --------------------------------------
protected void processRequest(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8"); PrintWriter out =
response.getWriter(); ClassLoader prev =
Thread.currentThread().getContextClassLoader(); ClassLoader dlapplication=
this.getClass().getClassLoader();
Thread.currentThread().setContextClassLoader(dlapplication); try{
System.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
InitialContext ctx = new InitialContext();
ctx.addToEnvironment("org.omg.CORBA.ORBInitialHost", "localhost");
ctx.addToEnvironment("org.omg.CORBA.ORBInitialPort", "3700");
ConnectionFacadeRemote connectionFacadeRemote = (ConnectionFacadeRemote)
ctx.lookup("com.edw.facade.ConnectionFacadeRemote"); String result =
connectionFacadeRemote.sayHello("edwin ") + "\n" + "my age is " +
connectionFacadeRemote.sayAge(12) + " years"; String descrive=ctx.toString();
} } catch (NamingException nex) { out.println("eccezione: " +
nex.getMessage()); nex.printStackTrace(out); } catch (Exception nex) {
out.println("eccezione: " + nex.getMessage()); nex.printStackTrace(out); }
finally { Thread.currentThread().setContextClassLoader(prev); out.close(); }
} eccezione: Name com.edw.facade.ConnectionFacadeRemote is not bound in this
Context javax.naming.NameNotFoundException: Name
com.edw.facade.ConnectionFacadeRemote is not bound in this Context at
org.apache.naming.NamingContext.lookup(NamingContext.java:770) at
org.apache.naming.NamingContext.lookup(NamingContext.java:153) at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:152) at
javax.naming.InitialContext.lookup(InitialContext.java:392) at
test.Uno.processRequest(Uno.java:76) at test.Uno.doGet(Uno.java:152) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at
java.lang.Thread.run(Thread.java:662)
context=javax.naming.InitialContext_at_7a9224

--
[Message sent by forum member 'mauro2011']
View Post: http://forums.java.net/node/891564