javaAgent代理中java.lang.ExceptionInInitializerError的问题
这是相关的代码TranstDocument.java
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import java.io.File;
public class TransDocument
{
//引用类所需参数
private final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
private final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
public void toTranst()
{
java.lang.Object _resp = null;
try
{
org.w3c.dom.Document doc = this.getDocumentFromFile("C:" + "\\" + "document.xml");
String url="http://127.0.0.1:7001/ams/services/urn:FileDataGatherService";
org.apache.axis.client.Service service=new org.apache.axis.client.Service();//后台就是报告这一句出错!
/*
org.apache.axis.client.Call call = (org.apache.axis.client.Call)service.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(new javax.xml.namespace.QName("urn:DataGatherService", "InputDataToFile"));
_resp = call.invoke(new java.lang.Object[] {doc});
*/
}
catch (Throwable t)
{
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");
//System.out.println(t.getMessage());
t.printStackTrace();
//System.out.println((String)_resp);
}
//System.out.println("发送xml文件成功");
}
public org.w3c.dom.Document getDocumentFromFile(String filename)
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
try{
DocumentBuilder builder = factory.newDocumentBuilder();
org.w3c.dom.Document doc = builder.parse(new File(filename));
//normalize text representation
doc.getDocumentElement().normalize ();
//System.out.println ("Root element of the doc is " +doc.getDocumentElement().getNodeName());
//System.out.println (doc.getDocumentElement().getAttribute("dg:unitname"));
return doc;
}
catch (Exception errE)
{
//errE.printStackTrace();
return null;
}
}
public static void main(String args[])
{
System.out.println("开始执行 !!!");
TransDocument td = new TransDocument();
td.toTranst();
}
}
后台抱告以下错误:
2008-04-10 22:39:57 HTTP JVM: java.lang.ExceptionInInitializerError:
2008-04-10 22:39:57 HTTP JVM: org.apache.commons.discovery.DiscoveryException: Unable to instantiate implementation cl
at java.lang.SecurityManager.checkPermission(SecurityManager.java:565)a:413)ava:286)ader)
2008-04-10 22:39:57 HTTP JVM: at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.j
ava:426)
2008-04-10 22:39:57 HTTP JVM: at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.j
ava:378)
2008-04-10 22:39:57 HTTP JVM: at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
2008-04-10 22:39:57 HTTP JVM: at java.security.AccessController.doPrivileged(Native Method)
2008-04-10 22:39:57 HTTP JVM: at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41
)
2008-04-10 22:39:57 HTTP JVM: at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
2008-04-10 22:39:57 HTTP JVM: at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43)
2008-04-10 22:39:57 HTTP JVM: at org.apache.axis.client.Service.getAxisClient(Service.java:104)
2008-04-10 22:39:57 HTTP JVM: at org.apache.axis.client.Service.<init>(Service.java:113)
2008-04-10 22:39:57 HTTP JVM: at TransDocument.toTranst(TransDocument.java:26)
2008-04-10 22:39:57 HTTP JVM: at IntefaceJavaAgent.NotesMain(IntefaceJavaAgent.java:105)
2008-04-10 22:39:57 HTTP JVM: at lotus.domino.AgentBase.runNotes(Unknown Source)
2008-04-10 22:39:57 HTTP JVM: at lotus.domino.NotesThread.run(NotesThread.java:218)
2008-04-10 22:39:57 HTTP JVM: Error cleaning up agent threads
关于java.lang.ExceptionInInitializerError错误的出现原因究竟是为什么?请高手指点,谢谢!
--------------------编程问答-------------------- 补充一点:
同样的程序在eclipse环境下做测试是正常的! --------------------编程问答-------------------- 请高手帮帮忙啊?没有人能解决吗? --------------------编程问答-------------------- --------------------编程问答-------------------- 请高手帮帮忙吧!好几天了,这么个问题解决不了!
这里先谢过了! --------------------编程问答-------------------- 好像没有用! --------------------编程问答-------------------- 好像没有用! --------------------编程问答-------------------- 看样子像是java的策略文件中的安全设置,java.lang.SecurityManager.checkPermission(SecurityManager.java,我在domino中引入hibernate中遇到了类似的问题,因为hibernate用到了java的反射机制,domino的jvm设置默认是不允许的 --------------------编程问答-------------------- 另外java代理中的安全级别至少设置为2吧 --------------------编程问答-------------------- 代理的安全级别问题,设置成2 --------------------编程问答-------------------- 如何设置domino的java的策略文件中的安全设置
补充:企业软件 , Lotus