我有一个有趣的问题,在运行时没有找到org.apache.log4j.Logger类.我正在尝试获得授权,这就是它失败的地方:
OAuthAuthorizer oauthAuthorizer = new OAuthAuthorizer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, SAML_PROVIDER_ID, userId);
我正在使用JDeveloper 11.1.1.6.这就是我所知道的:
我查看了我的UI.war/WEB-INF/lib目录,我看到了log4j-1.2.17.jar.
抱怨它的类是org.opensaml.xml.XMLConfigurator
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at org.opensaml.xml.XMLConfigurator.<clinit>(XMLConfigurator.java:60)
at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:195)
at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:91)
at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.getSAMLBuilder(SAML2AssertionGenerator.java:156)
at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.createSubject(SAML2AssertionGenerator.java:187)
at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.buildAssertion(SAML2AssertionGenerator.java:114)
at com.intuit.ipp.aggcat.util.SAML2AssertionGenerator.generateSignedAssertion(SAML2AssertionGenerator.java:83)
at com.intuit.ipp.aggcat.util.SamlUtil.createSignedSAMLPayload(SamlUtil.java:156)
at com.intuit.ipp.aggcat.util.OAuthUtil.getOAuthTokens(OAuthUtil.java:60)
at com.intuit.ipp.aggcat.core.OAuthAuthorizer.<init>(OAuthAuthorizer.java:85)
at com.incomemax.view.intuit.WebUtil.getAggCatService(WebUtil.java:91)
Run Code Online (Sandbox Code Playgroud)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
... 64 more
Run Code Online (Sandbox Code Playgroud)我解压缩了XMLConfigurator,奇怪的是它没有导入org.apache.log4j.Logger它使用org.slf4j.Logger,它也在我的jars目录中(slf4j-api-1.7.5.jar).同样有趣的是,第60行(参见堆栈跟踪)是我的反编译中的空行.
当然,如果我在设计时添加Logger.xxxxx,它会发现它很好.
我直接从示例java代码中使用代码/ jar,但导入到我现有的应用程序中.
我一直在网上寻找答案,我相信我已经检查了所有我能想到的领域.我也引用了这个非常好的页面:http://myarch.com/classnotfound/
鉴于授权是使用Intuit Developer API的第1步,我有点卡住了.
从@jhadesdev建议中添加输出:
所有版本的log4j Logger:
从OAuthAuthorizer类的类加载器可以看到所有版本的log4j:
所有版本的XMLConfigurator:
罐子:文件:/ …
我在这里需要一些指导.我正在为我的客户创建一个在线预订系统,它在内部网络上与QuickBooks连接(桌面QuickBooks,而不是在线).
我是否需要完整的"发布应用"路线?我不希望在市场上出售这个应用程序.这仅仅是由客户设计和支付的定制预订系统.似乎我需要在市场上"发布"应用程序,以便他们能够使用它.
有办法解决这个问题吗?
我可以查询SalesReceipt对象:
public bool GetSalesReceipt(string sRefNum, string sAccount, out ISalesReceiptRet ret)
{
ret = null;
IMsgSetRequest msr = sm.CreateMsgSetRequest("US", 4, 0);
msr.Attributes.OnError = ENRqOnError.roeStop;
ISalesReceiptQuery q = msr.AppendSalesReceiptQueryRq();
q.metaData.SetValue(ENmetaData.mdMetaDataAndResponseData);
q.ORTxnQuery.TxnFilter.ORRefNumberFilter.RefNumberFilter.RefNumber.SetValue(sRefNum);
q.ORTxnQuery.TxnFilter.ORRefNumberFilter.RefNumberFilter.MatchCriterion.SetValue(ENMatchCriterion.mcContains);
q.ORTxnQuery.TxnFilter.AccountFilter.ORAccountFilter.FullNameList.Add(sAccount);
q.IncludeLineItems.SetValue(true);
IMsgSetResponse resp = sm.DoRequests(msr);
if (resp.ResponseList.Count == 0)
return false;
IResponseList rl = resp.ResponseList;
if (rl.Count == 1)
{
IResponse r = rl.GetAt(0);
if (r.Detail == null)
return false;
if (r.StatusCode != 0)
return false;
if (r.Type.GetValue() == (short)ENResponseType.rtSalesReceiptQueryRs)
{
ISalesReceiptRetList crl = (ISalesReceiptRetList)r.Detail;
if (crl.Count == 1) …Run Code Online (Sandbox Code Playgroud) 当我想更新发票中的余额时,下面的代码正常运行而没有任何错误,但余额不会改变,为什么?
var queryService = new QueryService<Intuit.Ipp.Data.Invoice>(context);
IList<Intuit.Ipp.Data.Invoice> list = queryService.Where(p => true).ToList();
foreach (var invoice in list)
{
if (invoice.Id == order.Accounting.QBOID)
{
if (invoice.Balance != order.Accounting.SurveyAmount)
{
Invoice invo = new Invoice();
invo.Id = invoice.Id;
invo = commonService.FindById(invo);
invo.Balance = order.Accounting.SurveyAmount.HasValue ? order.Accounting.SurveyAmount.Value : 0;
invo.sparse = true;
commonService.Update(invo);
}
}
Run Code Online (Sandbox Code Playgroud) .net quickbooks invoice quickbooks-online intuit-partner-platform
I'm using a Mac for browsing and trying to access QuickBooks OSR. Its not happening. It is quite simply the worst web layout I've ever used. Not one Mac browser can display it correctly, meaning you cannot reference anything. On the PC side it is pretty much the same, ridiculously bad. Unless you want to use an old version of IE, which is not an option for me.
http://dev.developer.intuit.com/qbSDK-current/Common/newOSR/index.html
Seeing as this is the key area third party developers using …
我已成功使用POST和Content-Type application/xml创建对象
我也成功使用Content-Type application/x-www-form-urlencoded查询了一个空白请求体,它根据我指定的URI返回所有对象类型.
我也可以在请求体中使用像PageNum = 1和ResultsPerPage = 1这样的东西,并且我已经想出如何将其合并到签名中以便得到有效的响应.
然而,无论我如何格式化,当我尝试使用过滤器时,我都无法获得除401响应之外的任何内容(像Filter = FAMILYNAME:EQUALS:Doe这样的基本内容).我已经阅读了关于如何使用[RFC3986]百分比编码转义所有参数名称和值的OAuth Core 1.0 Revision A规范.但是我觉得我错过了一个步骤或格式错误.我在Intuit的论坛中看到了关于正确格式究竟是什么的不一致信息.
任何有关这方面的帮助将不胜感激.我现在一直在努力工作一周.
尝试使用过滤器时得到的响应是:HTTP状态401 - 消息=异常验证OAuth; 错误码= 003200; 的StatusCode = 401
---- ----更新
当我尝试使用新的IPP开发人员工具 - IPP API Explorer时,我看到同样的错误.我正在使用IDS V2 QBO API Explorer.我能够使用该工具检索所有Post并且响应显示我的所有客户,但是当我尝试使用过滤器时,我得到:服务器错误401 - 未经授权:由于凭据无效而拒绝访问.您无权使用您提供的凭据查看此目录或页面.
有任何想法吗?如果我从API Explorer工具中得到相同的错误,它会让我觉得问题完全不同.
----最后更新----
我终于有了过滤器的成功,我相信我已经弄明白我的问题是什么.我总是怀疑我能得到的查询中包含"页次= 1&ResultsPerPage = 1"工作分页,但无法得到的东西,如"过滤器= FAMILYNAME:等于:李四".我怀疑问题在于过滤格式中的空白区域.是什么让我无法跟踪此问题,因为我无法让过滤器在IDS V2 QBO API Explorer中运行.这让我怀疑还有其他事情发生了.我决定一起忽略API Explorer,并专注于为什么我可以让它以单向工作而不是另一种方式工作.
我相信我的问题归结为签名中过滤器值的不正确编码.这解释了我得到的401无效签名错误.
归一化后,"过滤器=名称:EQUALS:Doe"变为"过滤器=名称%20%3AEQUALS%20%3ADoe".
百分比编码应该给出"Filter%3DName%2520%253AEQUALS%2520%253ADoe".
实质上,你必须"双"编码空格和冒号,但不是等号.我尝试了许多编码的排列,但我相信我的错误是我不是"双重"编码,或者当我进行双重编码时,我包含了'='符号.无论哪种方式打破你的签名.感谢大家的投入.
我的QBWC应用程序一直运行良好,但我今天早上得到通知,说它突然停止了工作.具体来说,它无法进行身份验证.我检查了QWCLog.txt并找到了这个
20130510.14:25:19 UTC:QBWebConnector.SOAPWebService.do_authenticate():QBWC1012:由于以下错误消息,身份验证失败.SOAP-ERROR:解析WSDL:无法从' http://developer.intuit.com/uploadedFiles/Support/QBWebConnectorSvc.wsdl '加载:无法加载外部实体" http://developer.intuit.com/uploadedFiles/支持/ QBWebConnectorSvc.wsdl "
这是一个新的(我已经扩展了错误登录,所以我可以看到完整的调用).所以我去了WSDL文件,发现......它是404?!
我甚至试过我的一个AWS实例来确保它不仅仅是我
wget http://developer.intuit.com/uploadedFiles/Support/QBWebConnectorSvc.wsdl --2013-05-10 15:10:50-- http://developer.intuit.com/uploadedFiles/Support/QBWebConnectorSvc.wsdl 解析developer.intuit.com(developer.intuit.com)... 206.108.40.170连接到developer.intuit.com(developer.intuit.com)| 206.108.40.170 |:80 ...已连接.发送HTTP请求,等待响应... 404 Not Found 2013-05-10 15:10:51 ERROR 404:Not Found.
其他人得到这个吗?是否有我不知道的新网址?我只需要重新开始工作.
我刚刚开始开发Intuit应用程序,并且真正开始与QuickBooks Desktop集成.然后今天我登录继续工作,并在Intuit的IPP网站上看到几个缺失的页面,并显示"已弃用QBO V2和QBD V2,V3"的链接.唯一似乎不被弃用的API是QBO V3.
我找不到Intuit关于任何即将发布的弃用的任何声明.有没有人知道我是否可以安全地继续开发我的应用程序以连接到QBD,或者我是否需要与我们的会计师交谈以转移到QBO?
编辑:我已将Jarred的答案标记为已接受的答案,因为他与Intuit联系并回答了我的具体情况.另请查看Charlie的答案,了解特定于其他方案的其他详细信息.
这是关于进行JavaScript调用的最佳实践的问题,该调用生成标准的"连接到QuickBooks"按钮(用于通过Intuit的v3 REST API建立与QuickBooks Harmony的连接).
如果我按照Intuit的例子,我会:
......有效(对于许多"作品"的价值),但感觉非常脆弱:
为了使这一切更具弹性,我将对intuit.ipp.anywhere.js的引用和对intuit.ipp.anywhere.setup()的调用组合成一个JQuery .ajax()调用:
$.ajax({
url: 'https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere.js',
type: 'GET',
dataType: 'script',
timeout: 4000,
success: function(response) {
if (typeof intuit !== 'undefined') {
intuit.ipp.anywhere.setup({
menuProxy: 'MYMENUPROXYURL.aspx',
grantUrl: 'MYGRANTURL.aspx'
});
}
},
error: function(x, t, m) {
// show some friendly error message about Intuit downtime
}
});
Run Code Online (Sandbox Code Playgroud)
......也有效(对于"作品"的更多价值):
有没有其他人采取不同的方法?
Intuit重新上线了吗?
我遇到了一些.NET SDK限制的问题,因此我想发出自己的API调用并解析JSON结果.我坚持打造概括的授权头参数oauth_signature 这里.
对于此参数,它指出: Contains the value generated by running all other request parameters and two secret values through a signing algorithm
到目前为止我有什么.
public static string GetOAuthAuthorization(string oauthToken, string oauthSecret, string consumerKey, string consumerSecret)
{
string oauth_token = oauthToken;
string oauth_nonce = Guid.NewGuid().ToString();
string oauth_consumer_key = consumerKey;
string oauth_signature_method = "HMAC-SHA1";
int oauth_timestamp = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
string oauth_version="1.0";
string dataString = oauth_token + oauth_nonce + oauth_consumer_key + oauth_timestamp;
//TODO: use following to …Run Code Online (Sandbox Code Playgroud) quickbooks ×8
api ×2
c# ×2
intuit ×2
sdk ×2
.net ×1
classloader ×1
classpath ×1
deprecated ×1
invoice ×1
java ×1
logging ×1
oauth ×1
qbwc ×1