2014-12-08 4 views
0

GateKepper라는 비 상태 세션빈이있는 레거시 JBoss 응용 프로그램에 .ear을 배포해야합니다. 나는이 응용 프로그램의 로컬 복사본에서이를 테스트하고 있는데,이 버전은 프로덕션 버전과 거의 동일합니다. gatekeeperBeanName I가 아래 제시 원격 및 로컬 인터페이스, 정규화 된 클래스 이름 인 "com.xxxxx.mercury.GateKeeper"및 속성이다JBoss 4에서 예상대로 JNDI가 작동하지 않습니다.

protected GateKeeper lookupGateKeeper() { 
     String gateKeeperBeanName = null; 
     try { 
      Properties p = getClasspathProperties(); 
      InitialContext ctx = new InitialContext(p); 
      gateKeeperBeanName = p.getProperty("gatekeeper.name"); 
      return (GateKeeper) ctx.lookup(gateKeeperBeanName); 
     } 
     catch (IOException e) { 
      throw new GateKeeperLookupException("Gatekeeper [" + gateKeeperBeanName + "] not found.", e); 
     } catch (NamingException e) { 
      throw new GateKeeperLookupException("Gatekeeper [" + gateKeeperBeanName + "] not found.", e); 
     } 
    } 

: I 함께 룩업을 수행

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory 
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces 
java.naming.provider.url=jnp://localhost:1099 

키퍼 인터페이스에 주석 (com.xxxxx.mercury.GateKeeper)

@Remote 
@Local 
public interface GateKeeper { 
    public String processRequest(String request); 
} 

이고 D : I 인서트에는 java.naming되는 것을 표준 applicaiton의 uring 시작은, 다음이 기록됩니다

2014-12-08 15:30:53,648 DEBUG [org.jboss.naming.NamingService] (main) !Starting jboss:service=Naming 
2014-12-08 15:30:53,648 DEBUG [org.jboss.naming.NamingService] (main) !System.setProperty, key=java.naming.factory.initial, value=org.jnp.interfaces.NamingContextFactory 
2014-12-08 15:30:53,648 DEBUG [org.jboss.naming.NamingService] (main) !System.setProperty, key=java.naming.factory.url.pkgs, value=org.jboss.naming:org.jnp.interfaces 
2014-12-08 15:30:53,655 DEBUG [org.jboss.naming.NamingService] (main) !Creating NamingServer stub, [email protected],rmiPort=1098,clientSocketFactory=null,[email protected]d093076 
2014-12-08 15:30:53,711 DEBUG [org.jboss.naming.NamingService] (main) !NamingServer stub: NamingServer_Stub[UnicastRef2 [liveRef: [endpoint:[192.168.1.109:1098,[email protected]](local),objID:[36e9dd2d:14a282a12d7:-7fff, 5578168918392374819]]]] 
2014-12-08 15:30:53,716 DEBUG [org.jboss.naming.NamingService] (main) !Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server [email protected]6 
2014-12-08 15:30:53,720 DEBUG [org.jboss.naming.NamingService] (main) !InitialContext Environment: 
2014-12-08 15:30:53,720 DEBUG [org.jboss.naming.NamingService] (main) !key=java.naming.factory.initial, value=org.jnp.interfaces.NamingContextFactory 
2014-12-08 15:30:53,720 DEBUG [org.jboss.naming.NamingService] (main) !key=java.naming.factory.url.pkgs, value=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces 
2014-12-08 15:30:53,722 DEBUG [org.jboss.naming.NamingService] (main) !Listening on port 1099 
2014-12-08 15:30:53,724 DEBUG [org.jboss.naming.NamingService] (main) !Started jboss:service=Naming 

그래서 정말 네이밍 서비스가 시작처럼 보인다 나는 게이트 키퍼에게

를 조회하려고 할 때 그것을 왜 그래서 얻을 :

com.xxxxxcorp.vas.txws.web.GateKeeperLookupException: Gatekeeper [com.xxxxx.mercury.GateKeeper] not found. 

com.xxxxxcorp.vas.txws.web.TxnServlet.lookupGateKeeper(TxnServlet.java:134) 
com.xxxxxcorp.vas.txws.web.TxnServlet.getGateKeeper(TxnServlet.java:119) 
com.xxxxxcorp.vas.txws.web.TxnServlet.get(TxnServlet.java:66) 
com.xxxxxcorp.vas.txws.web.TxnServlet.doGet(TxnServlet.java:58) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:697) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:810) 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75) 

분명히 IOException 또는 NamingException이 발생했습니다. 누군가가 문제 해결의 이름 지정을 받고 실행 중이라면 누구나 내가 잘못하고있는 것을 발견 할 수 있습니까?

<mbean code="org.jboss.naming.NamingService" 
     name="jboss:service=Naming" 
     xmbean-dd="resource:xmdesc/NamingService-xmbean.xml"> 
     <!-- The call by value mode. true if all lookups are unmarshalled using 
     the caller's TCL, false if in VM lookups return the value by reference. 
     --> 
     <attribute name="CallByValue">false</attribute> 
     <!-- The listening port for the bootstrap JNP service. Set this to -1 
     to run the NamingService without the JNP invoker listening port. 
     --> 
     <attribute name="Port">1099</attribute> 
     <!-- The bootstrap JNP server bind address. This also sets the default 
     RMI service bind address. Empty == all addresses 
     --> 
     <attribute name="BindAddress">${jboss.bind.address}</attribute> 
     <!-- The port of the RMI naming service, 0 == anonymous --> 
     <attribute name="RmiPort">1098</attribute> 
     <!-- The RMI service bind address. Empty == all addresses 
     --> 
     <attribute name="RmiBindAddress">${jboss.bind.address}</attribute> 
     <!-- The thread pool service used to control the bootstrap lookups --> 
     <depends optional-attribute-name="LookupPool" 
     proxy-type="attribute">jboss.system:service=ThreadPool</depends> 
    </mbean> 

    <mbean code="org.jboss.naming.JNDIView" 
     name="jboss:service=JNDIView" 
     xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml"> 
    </mbean> 

답변

0

나는 완전한 인터페이스 이름을 사용하여 생각하지 않는으로 작동이 어떤 식 으로든 중요한 제이 보스-service.xml 인 경우 편집이 NamingService에 대한 대답이있다

jndi 문자열 .. 귀하의 경우에는 earName/GateKeeperImpl/local 또는 GateKeeperImpl/local 같은 것이어야합니다.

또한 @Local 및 @Remote와 동일한 인터페이스에 주석을 달지 않습니다. 문제가 발생할 수 있다고 생각합니다.

도움이되기를 바랍니다.

관련 문제