내가 하나의 Java/Salesforce tutorial에 있었지만 SoapBindingStub가 가치가 떨어지는 라이브러리를 기반으로하는 쓸모없는 코드 인 것처럼 보이기 때문에 그 코드를 작동시키지 못했습니다. 그래서 나는 코드를 JAX-WS Quick Start에서 코드로 메쉬하려고했지만, 이것도 제대로 작동하지 않았습니다. 결과적으로 샘플 콘솔 애플리케이션은 예외적으로 "웹 서비스 예외 생성 Salesface 포트 : 클래스 javax.xml.ws.WebServiceException의 보안 제한으로 인해 JAXBContext를 만들 수 없습니다.".Java/SalesForce 앱이 보안 제한으로 인해 JAXBContext를 만들 수없는 이유는 무엇입니까?
저는 두 코드를 매시하려고했지만 JAX-WS Quickstart.java를 추상화하는 작업을 진행했습니다. 이제는 와우가 작동하고 다른 응용 프로그램에서 해당 메서드를 다시 사용할 수 있다는 것을 이해할 수 있습니다.
코드를 어떻게 슬라이스하고 다룰지라도 코드는 항상 동일한 오류가있는 동일한 위치에서 멈추게됩니다. (시간적으로)
Running main loop
FOUND enterprise.wsdl!!!
sforceService INITIALIZED. About to get Soap.
Web Service Exception creating salesface port: Unable to create JAXBContext due to the security restriction
on class javax.xml.ws.WebServiceException
javax.xml.ws.WebServiceException: Unable to create JAXBContext due to the security restriction
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:131)
at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:63)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:224)
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:588)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:291)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:274)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:267)
at javax.xml.ws.Service.getPort(Unknown Source)
at com.sforce.soap.enterprise.SforceService.getSoap(SforceService.java:53)
at hu.flux.salesforce.LoginToolkit.initPort(LoginToolkit.java:78)
at hu.flux.salesforce.LoginToolkit.doLogin(LoginToolkit.java:122)
at hu.flux.salesforce.LoginToolkit.<init>(LoginToolkit.java:49)
at hu.flux.salesforce.samples.Quickstart.mainLoop(Quickstart.java:55)
at hu.flux.salesforce.samples.Quickstart.<init>(Quickstart.java:28)
at hu.flux.salesforce.samples.Quickstart.main(Quickstart.java:21)
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
this problem is related to the following location:
at java.lang.StackTraceElement
at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
at java.lang.Throwable
at java.lang.Exception
at com.sforce.ws.ConnectionException
at com.sforce.ws.SoapFaultException
at com.sforce.soap.enterprise.fault.ApiFault
at public javax.xml.bind.JAXBElement com.sforce.soap.enterprise.fault.ObjectFactory.createFault(com.sforce.soap.enterprise.fault.ApiFault)
at com.sforce.soap.enterprise.fault.ObjectFactory
com.sforce.ws.types.Time does not have a no-arg default constructor.
this problem is related to the following location:
at com.sforce.ws.types.Time
at public com.sforce.ws.types.Time com.sforce.soap.enterprise.sobject.BusinessHours.getFridayEndTime()
at com.sforce.soap.enterprise.sobject.BusinessHours
at public com.sforce.soap.enterprise.sobject.BusinessHours com.sforce.soap.enterprise.sobject.ObjectFactory.createBusinessHours()
at com.sforce.soap.enterprise.sobject.ObjectFactory
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:124)
... 14 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
this problem is related to the following location:
at java.lang.StackTraceElement
at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
at java.lang.Throwable
at java.lang.Exception
at com.sforce.ws.ConnectionException
at com.sforce.ws.SoapFaultException
at com.sforce.soap.enterprise.fault.ApiFault
at public javax.xml.bind.JAXBElement com.sforce.soap.enterprise.fault.ObjectFactory.createFault(com.sforce.soap.enterprise.fault.ApiFault)
at com.sforce.soap.enterprise.fault.ObjectFactory
com.sforce.ws.types.Time does not have a no-arg default constructor.
this problem is related to the following location:
at com.sforce.ws.types.Time
at public com.sforce.ws.types.Time com.sforce.soap.enterprise.sobject.BusinessHours.getFridayEndTime()
at com.sforce.soap.enterprise.sobject.BusinessHours
at public com.sforce.soap.enterprise.sobject.BusinessHours com.sforce.soap.enterprise.sobject.ObjectFactory.createBusinessHours()
at com.sforce.soap.enterprise.sobject.ObjectFactory
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:66)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:270)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:103)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:89)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:126)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:125)
... 16 more
1. Login
2. Get Accounts
3. Update Accounts
4. Get Server Timestamp
5. Exit
Enter a menu option:
마지막 라인에 즉시 전후의 출력을 포함하여, 여기
private void initPort()
{
try
{
URL wsdlLocation = this.getClass().getClassLoader().getResource("META-INF/enterprise.wsdl");
if (wsdlLocation == null)
{
WebServiceException webServiceException = new WebServiceException("enterprise.wsdl not found!");
ExceptionToolkit.display("Web Service Exception can't find enterprise.wsdl", webServiceException);
throw webServiceException;
}
else {System.out.println("\nFOUND enterprise.wsdl!!!\n\n");}
QName qName = new QName("urn:enterprise.soap.sforce.com", "SforceService");
SforceService sforceService = new SforceService(wsdlLocation, qName);
System.out.println("\nsforceService INITIALIZED. About to get Soap.\n\n");
Soap soap = (sforceService).getSoap();
System.out.println("\nWe have soap.\n\n");
setPort (soap);
}
catch (WebServiceException webServiceException)
{
ExceptionToolkit.display("Web Service Exception creating salesface port", webServiceException);
return;
}
}
오류이다 : 여기
는 persistantly 실패있어서 현재 코드 스택 내 자신의 코드를 말합니다 :
at hu.flux.salesforce.LoginToolkit.initPort(LoginToolkit.java:78)
System.out.println stat 소스의 ements는 이것이 실행이 끝나는 것임을 확인합니다. 이 줄을 구체적 :이 궁극적으로 JAXBContext에를 만들 수 없습니다 자바를 떠나 보안 제한을 초월 할 수없는 이유
Soap soap = (sforceService).getSoap();
사람은 방법을 알고 나 있는가?
정당한 문제를 downvoting ... 매우 도움이됩니다. : -/ –