2015-01-15 3 views
0

배경 나는 (내가 생각 v8.5이)은 WebSphere에서 읽을 넷빈즈를 사용하여 자바 응용 프로그램을 개발 & 프론트 엔드 웹 개발자 JMS 큐 PHP로하고 다음 문제는 스크립트를 적절한 명령을 /서버. 이것은 Java로 약 10 년 동안 처음으로 실행 한 중요한 내용이므로 나와 함께 견뎌주십시오. 내 초기 테스트 응용 프로그램은 jms 대기열을 호스팅하는 서버에서 정상적으로 실행되지만 원격 위치 (현재는 Windows가되지만 결국 Linux가 될 것입니다)에서 연결을 시도 할 때 다른 오류가 발생합니다. 나는 Java에 대한 나의 경험 부족과 항아리 문제점을 진단하고 websphere와 다른 곳에서 필요한 항아리를 찾는 과정을 거치면서 마침내 벽돌 벽에 도달했습니다. "올바른 항아리 파일이 필요합니다."와 같은 문구로 구성된 많은 답변을 보았지만 어떤 파일이 필요한지 또는이 파일이 필요한지는 말하지 않았습니다. 한 개와 모든 항아리가 언급됩니다. 내가해야 할 항아리를 찾는 방법을 모른다. 나는이 과정이 내 라이브러리의 항아리 중 일부에서만 작동해야한다고 말하는 게시물을 읽었습니다. 나는 완전히 붙어 ...스피어 JMS 큐 액세스

오류 내가

을 통해 점점에 운이없는 오전 오류가
javax.naming.NamingException: Failed to initialize the ORB [Root 
exception is org.omg.CORBA.INITIALIZE: can't instantiate default ORB 
implementation com.ibm.CORBA.iiop.ORB 

메시지의 전체 나머지는 내가 어떤이

javax.naming.NamingException: Failed to initialize the ORB [Root exception is 
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation 
com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No] 
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:314)  
javax.naming.NamingException: Failed to initialize the ORB [Root exception is org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation 
com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No] 
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:384) 
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:113)  
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:428) 
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)  
at javax.naming.InitialContext.lookup(InitialContext.java:411) 
at jmstool2.JmsConn.CreateFactCon(JmsConn.java:101)  
at jmstool2.JmsConn.connect(JmsConn.java:56)  
at jmstool2.Jmstool2.main(Jmstool2.java:20) 
Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.ibm.CORBA.iiop.ORB vmcid: 0x0 minor code: 0 completed: No 
at org.omg.CORBA.ORB.create_impl(ORB.java:327) 
at org.omg.CORBA.ORB.init(ORB.java:367)  
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:85) 
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:174)  
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:97)  
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:73)  
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:386) 
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:305) ... 8 more 
Caused by: java.lang.NoSuchFieldError: UNKNOWN 
at com.ibm.rmi.util.RepositoryId.createHashString(RepositoryId.java:738)  
at com.ibm.rmi.util.RepositoryId.<clinit>(RepositoryId.java:254)  
at com.ibm.rmi.iiop.CDROutputStream.<clinit>(CDROutputStream.java:1107)  
at com.ibm.rmi.corba.ORB.<init>(ORB.java:281) at com.ibm.rmi.iiop.ORB.<init>(ORB.java:187) at com.ibm.CORBA.iiop.ORB.<init>(ORB.java:576) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
at java.lang.Class.newInstance(Class.java:374) 
at org.omg.CORBA.ORB.create_impl(ORB.java:325) ... 15 more 

입니다 수행 중 라이브러리에 다음 jar 파일을 추가했습니다.

javax.jms-1.1.jar 
com.ibm.ws.orb_8.5.0.jar 
com.ibm.ws.ejb.thinclient_8.5.0.jar 
com.ibm.was.sib.client.thin.jms_8.5.0.jar 
com.ibm.was.admin.client_8.5.0.jar 
com.ibm.ws.messagingClient.ja 
나는 또한 내가 이런 위치도를 추가 한 나는 또한 당신이 이미 가지고있는 씬 클라이언트가 발생하는 경우, 다음이 필요하지 않은 것을 읽고 있지만 다음 항아리가,

sibc.jms.jar 
sibc.jndi.jar 
sibc.orb.jar 

을 필요로 읽었습니다

.

context factory: com.ibm.websphere.naming.WsnInitialContextFactory 
Provider URL: corbaloc:iiop:192.168.254.202:2809 

컨텍스트 JDK1.7

사용하고이 생성되고있다. 그러나 큐 팩토리 연결을 만들 수 없습니다. 빠른 테스트 응용 프로그램을 사용하여 IP 주소와 포스트에 대한 소켓을 만들 수 있습니다.

코드 다음은 클래스 파일과 모든 연결 비트입니다. 진행중인 작업입니다.

import java.util.Hashtable; 
import javax.naming.*; 
import javax.jms.*; 
import com.ibm.CORBA.*; 
import com.ibm.ws.*; /* 
/** 

* Connection Factory Notes on IBM Websphere 
* 
* jndi/INConnectionFactory 
* jndi/OUTConnectionFactory 
* 
* jndi/INQueue 
* jndi/OUTQueue 
* 
* jndi/INActivation 
* jndi/OUTActivation 
* 
* websphere server: 192.168.254.202 
* 
* JMS queued port: 5558 unsecured (MQ) and 5578 secure 
* JMS Security Port 5557 
* JMS Direct Port: 5559 
* SOAP: 9976 
* //other ports mentioned: 7276 (unsecured) and 7286 (secured) 
* NOTE: A bootstrap address with no port specification defaults to port 2809 
*/ 
public class JmsConn { 
    /*int jmsQueuedPort = 5558; 
    int jmsSecrityPort = 5557; 
    int jmsDirectPort = 5559; 
    int soapPort  = 9976;*/ 
    int bootstrap  = 2809; //default port 
    int bootstrap10  = 2810; 
    int unSecPort  = 7276; 
    String serverIP  = "192.168.254.202";  
    String scheme  = "corbaloc:iiop:"; //e.g. ws, ldap,iiop, corbaloc:iiop 
    String contextFactory = "com.ibm.websphere.naming.WsnInitialContextFactory"; 
    String queueInName  = "jndi/INQueue"; 
    String queueOutName  = "jndi/OUTQueue"; 
    String outFactory  = "jndi/OUTConnectionFactory"; 
    String inFactory  = "jndi/INConnectionFactory"; 
    InitialContext jndiContext; 
    ConnectionFactory connectionFactory; 
    Connection qConn; 
    String providerUrl = scheme+serverIP+":"+bootstrap; 
    Session qSession; 
    Queue q; 


    public void connect() {   
     this.CreateContext(); 
     this.CreateFactCon(this.outFactory); 
     this.getQueue(this.queueOutName); 

    } 

    public void Lookup(String thingToLookup){ 
     try{ 
      System.out.println("Attempting to lookup "+thingToLookup); 
     }catch(Exception ex){ 
      System.out.println("ERROR: Could not perform lookup of " + thingToLookup +    
       System.lineSeparator() + ex.toString()); 
      // System.out.println("Lookup Result: " + this.jndiContext.lookup); 
      System.exit(3); 
     } 

    } 


    public void CreateContext(){ 
     try{ 
      System.out.println("Attempting to create connection context"); 
      Hashtable env = new Hashtable(); // [jh] in theory this has been superceeded 
       // and should use HashMap 
      env.put(Context.INITIAL_CONTEXT_FACTORY,this.contextFactory); 
      System.out.println("context factory: "+this.contextFactory); 
      System.out.println("Provider URL: "+this.providerUrl); 
      env.put(Context.PROVIDER_URL, providerUrl); //+":"+this.jmsDirectPort 
      try{ 
       this.jndiContext = new InitialContext(env); 
       //this.jndiContext = new InitialContext(); 
      }catch(NamingException e){ 
       System.out.println("ERROR: Could not create JNDI context: " + 
        System.lineSeparator() + e.toString()); 
       System.exit(1); 
      } 

      System.out.println("End of CreateContext."); 

     }catch(Exception exc){ 
      System.out.println("ERROR in CreateContext: "+exc.toString()); 
      System.exit(1); 

     } 
    } 

    public void CreateFactCon(String factory){ 
     try{ 
      System.out.println("Attmepting to create factory lookup:"); 
      this.connectionFactory = (ConnectionFactory)this.jndiContext.lookup(factory); 


     }catch(NamingException e){ 
      System.out.println("ERROR: Could not create factory connection:"); 
      e.printStackTrace(System.err); 
      System.out.println(e.toString()); 
      System.exit(2); 
     } 
     System.out.println("Lookup successfull:"); 

     try{ 
      System.out.println("Attmepting to create connection:"); 
      this.qConn = this.connectionFactory.createConnection(); 
      this.qSession = qConn.createSession(false,Session.AUTO_ACKNOWLEDGE); 
     }catch(Exception e){ 
      e.printStackTrace(System.err); 
      System.out.println(e.toString()); 
      System.exit(4); 
     } 
     System.out.println("Connection successful."); 



     System.out.println("End of CreateFactoryConnection.");    
    } 


    public void getQueue(String queueName){ 
     try{ 
      this.q = (Queue)this.jndiContext.lookup(queueName); 
     }catch(Exception e){ 
      System.out.println("ERROR: Could not get Queue:"); 
      e.printStackTrace(System.err); 
      System.out.println(e.toString()); 
      System.exit(2); 
     } 
    } 
    } 

UPDATE

com.ibm.ws.orb_8.5.0.jar com.ibm.ws.wjb.thingclient_8.5.0.jar 닷컴에 jar 파일을 다시 절단 후. 다음과 같은 오류가

javax.naming.NamingException: Error getting WsnNameService properties [Root exception is org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: 0x4942f000 minor code: 3591 completed: No] 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1552) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1042) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614) 
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128) 
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765) 
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164) 
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179) 
    at javax.naming.InitialContext.lookup(InitialContext.java:411) 
    at jmstool2.JmsConn.CreateFactCon(JmsConn.java:104) 
    at jmstool2.JmsConn.connect(JmsConn.java:59) 
    at jmstool2.Jmstool2.main(Jmstool2.java:20) 
Caused by: org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: 0x4942f000 minor code: 3591 completed: No 
    at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1250) 
    at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1321) 
    at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1146) 
    at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1287) 
    at com.ibm.rmi.corba.ClientDelegate.request(ClientDelegate.java:1853) 
    at com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1243) 
    at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:449) 
    at com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38) 
    at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1549) 
    ... 11 more 
Java Result: 2 
,536,913

을 발생합니다 ibm.ws.sib.client.thin.jms_8.5.0.jar

+0

을,하지만 난이 SRC 넷빈즈에 관련하는 방법에 관해서는 확실하지 않다 : HTTP : // veithen.github.io/2013/11/11/servicemix-websphere-ejb-thinclient.html 페이지에서 찾기 : org.omg.CORBA.INITIALIZE : 기본 ORB 구현 com.ibm.CORBA.iiop을 인스턴스화 할 수 없습니다. ORB –

답변

1

체크 - Installing and configuring the Thin Client for JMS with WebSphere Application Server.당신이 지금 필요로한다

유일한 항아리은 다음과 같습니다

com.ibm.ws.orb_8.5.0.jar 
com.ibm.was.sib.client.thin.jms_8.5.0.jar 
com.ibm.ws.ejb.thinclient_8.5.0.jar 

그래서 클래스 패스에서 다른 모든를 제거하십시오. 그리고 빌드 할 때뿐만 아니라 실행중인 클래스 패스에도이 jar 파일이 있는지 확인하십시오. 초기 컨텍스트에 대한

다음과 같은 시도 : 나는 실제로 가까운 일치하는이 발견

Hastable env = new Hastable(); 
env.put(Context.PROVIDER_URL,"iiop://localhost:2809"); // if using default ports 
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); 
InitialContext ctx = new InitialContext(env); 
+0

안녕하세요 가스 - 어제 내 게시물에 답변 한 것처럼이 주제에 대한 답을하는 사람인 것처럼 보입니다. 로컬 호스트가 JMS 대기열 (코드의 IP 주소는 서버가있는 서버)이 아니기 때문에 라이브러리 목록에서 다른 것들을 제거하고 변경을 시도 했으므로이를 그대로두고 iiop 및 corbaloc을 사용하지 않도록 설정했습니다. : iiop. 반환 된 오류 : WsnNameService 속성 가져 오는 중 오류 [루트 예외 org.omg.CORBA.TRANSIENT : 초기 및 전달 된 IOR 액세스 할 수없는 vmcid : 0x4942f000 마이너 코드 : 3591 –

+0

시스템 관련 일종의 성가신입니다 실제로는 "프로그래밍 비트"를 수행하는 것보다 항상 걸립니다. –

+0

이전에 해당 링크를 읽었으며 "클라이언트에 대한 클래스 경로에 적절한 jar 파일을 포함하십시오"라는 줄과 함께 저주를 받았습니다. 응용 프로그램 : " 나는 뭔가를 놓치지 않는 한 거기에 언급 된 것을하고있는 것처럼 보입니다. 내 netbeans 프로젝트 내 라이브러리에 jar 파일을 추가하면 클래스 패스에 효과적으로 추가됩니다. 내 가정은 –

관련 문제