2012-11-28 7 views
2

웹 서비스에 액세스하기 위해 Lotus Notes 6.5 DB에 JavaAgent를 작성해야했습니다. 이를 위해 Axis Apache API를 사용했습니다. Java 에이전트를 생성하고 프로젝트 편집 버튼을 사용하여 에이전트에 축의 jar 파일을 추가했습니다. 던져진 예외 아래Lotus Notes 6.5의 JavaAgent에서 축 API를 사용하면 예외가 발생합니다. "org.apache.commons.logging.LogFactory에 대한 구현이 정의되지 않았습니다."

import lotus.domino.*; 
import javax.xml.*; 
import org.apache.axis.client.Call; 
import org.apache.axis.client.Service; 
import javax.xml.namespace.QName; 
import java.net.URL; 

public class JavaAgent extends AgentBase { 

    public void NotesMain() { 

     try { 


      Session session = getSession(); 
      AgentContext agentContext = session.getAgentContext(); 

      String endpoint = "http://ws.apache.org:5049/axis/services/echo"; 
      Service service = new Service(); 
      Call  call = (Call) service.createCall(); 
      call.setTargetEndpointAddress(new java.net.URL(endpoint)); 

      call.setOperationName(new QName("http://soapinterop.org/", "echoString")); 
      String ret = (String) call.invoke(new Object[] { "Hello!" }); 
      System.out.println("Sent 'Hello!', got '" + ret + "'"); 

     } catch(Exception e) { 
      e.printStackTrace(); 
     } 
    } 
} 

된다 : : 아래

는 에이전트 코드

java.lang.ExceptionInInitializerError: org.apache.commons.discovery.DiscoveryException: No implementation defined for org.apache.commons.logging.LogFactory 

    at org.apache.commons.discovery.tools.SPInterface.newInstance(SPInterface.java:197) 

    at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579) 

    at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418) 

    at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378) 

    at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:84) 

    at java.security.AccessController.doPrivileged(Native Method) 

    at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:80) 

    at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:72) 

    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.<clinit>(EngineConfigurationFactoryFinder.java:94) 

    at org.apache.axis.client.Service.<init>(Service.java:111) 

    at JavaAgent.NotesMain(JavaAgent.java:17) 

    at lotus.domino.AgentBase.runNotes(Unknown Source) 

    at lotus.domino.NotesThread.run(NotesThread.java:218) 

내가 인터넷과 같은 몇 가지 링크를 따라 thried,하지만 난 정확히 얻을 수 없습니다 그것이 무엇을 요구하고 있는지. 예 : http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/40d033fba3897f4d85256cd30034026a?OpenDocument

도움이 될 것입니다. 내가 원하는 것은 에이전트를 작성하여 w3schools에서 웹 서비스 (예 : 온도 변환 웹 서비스)에 액세스 할 수 있도록하는 것입니다. http://www.w3schools.com/webservices/tempconvert.asmx?op=FahrenheitToCelsius

답변

2

나는 당신의 오류 메시지와 함께 인터넷 검색이 첫 번째 히트 :

http://croarkin.blogspot.fi/2010/08/commons-logging-headaches-with-axis.html

그것은으로 commons-logging.properties에게 파일을 사용하여 제안 :

org.apache.commons.logging.Log = org.apache.commons.logging.impl.Log4JLogger 
org.apache.commons.logging.LogFactory = org.apache.commons.logging.impl.LogFactoryImpl 

또는 퍼팅 이 코드를 코드에 입력하십시오 :

@BeforeClass 
public static void beforeClass() { 
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Log4JLogger"); 
System.setProperty("org.apache.commons.logging.LogFactory", "org.apache.commons.logging.impl.LogFactoryImpl"); 
} 

아마도 Google과의 첫 번째 히트작이기 때문에 이미 시도해 보았을 것입니다.하지만 단지 ...