In ATG i got below exception, when this.getSmtpEmailSender().sendEmailMessage(msg) method called. But same code working fine with different environment. May be it configuration issue. what i need to check.
/com/ncr/base/common/services/EmailService
java.lang.Exception: The final format argument for a vlog call is a throwable, but is not referenced. The throwable will be logged, but please use an explicit Throwable argument before the format string to eliminate ambiguity.
**** Warning Fri Dec 21 02:49:02 -05:00 2018 1545378542129 /com/ncr/base/common/services/EmailService at atg.nucleus.logging.VariableArgumentApplicationLoggingUtil.getUnreferencedThrowable(VariableArgumentApplicationLoggingUtil.java:744)
**** Warning Fri Dec 21 02:49:02 -05:00 2018 1545378542129 /com/ncr/base/common/services/EmailService at atg.nucleus.logging.VariableArgumentApplicationLoggingUtil.vlogError(VariableArgumentApplicationLoggingUtil.java:344)
/com/ncr/base/common/services/EmailService nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 501 5.1.7 Invalid address
My guess is one of your email addresses is not valid in either the To or From fields.
ATG allows you to configure defaults for the /atg/dynamo/service/SMTPEmail/ components and I think that you are missing a configuration for the environment in question. I would recommend you open dyn/admin and compare the configuration for SMTP email for environments which are working vs ones which are not.
Related
I'm trying to write a Java application for digitally signing documents using a bit4Id miniLector token.
I'm in a Linux development environment.
The token is correctly installed, I can sign my documents also with the app downloaded from the manufacturer, but I have to write a new one for other purposes. The driver used is located at
/usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
I'm stuck with this error:
/usr/lib/jvm/jdk1.8.0_111/bin/java ...
Exception in thread "main" java.security.ProviderException: Initialization failed
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:376)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)
at com.itextpdf.samples.signatures.chapter02.C2_01_SignHelloWorld.main
(C2_01_SignHelloWorld.java:83)
Caused by: java.io.IOException: ERROR: C_GetFunctionList == NULL
at sun.security.pkcs11.wrapper.PKCS11.connect(Native Method)
at sun.security.pkcs11.wrapper.PKCS11.<init>(PKCS11.java:138)
at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:151)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:313)
... 2 more
The provider is listed in $JAVA_HOME/jre/lib/security/java.security file as:
security.provider.10=sun.security.pkcs11.SunPKCS11
The code behaving this way is this:
String configFile = "/opt/bar/cfg/pkcs11.cfg";
Provider provider = new sun.security.pkcs11.SunPKCS11(configFile); <-- line 83
The needed libraries are all imported by my IDE and I have no compile/link errors.
I didn't find this exact type of error in hours of googling.
If you need any further information let me know, any kind help is very appreciated, thanks.
For visual clarity I add all missing information with respect to the original question here below
Updates
Content of the pkcs11.cfg file:
$ cat /opt/bar/cfg/pkcs11.cfg
name="bit4id miniLector-EVO"
library=/usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
Ok, I got it.
The problem is the driver.
Replacing
/usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
with
/opt/Firma4NG/System/Firma4NG_Linux/Firma4/drivers/mu-x64/libbit4xpki.so
that is one of the manufacturer's driver, now I can go further and, for example, dumping all info about the card:
Information for provider SunPKCS11-bit4id miniLector-EVO
Library info:
cryptokiVersion: 2.20
manufacturerID: bit4id srl
flags: 0
libraryDescription: bit4id PKCS#11
libraryVersion: 1.02
...
This question can be closed.
I'm trying to select a record from particular view in Airtable using the Java library
So far i have set break points to check if everything is initialised and it seems be okay. My api key is correct and the Airtable instance is setup correctly.
Airtable airtable = new Airtable().configure(AIRTABLE_API_KEY);
Base basebase = airtable.base("my-airtable-base");
This is my error:
Nov 12, 2020 5:53:08 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: brw=brwkel6HWNoWVEl49; path=/; expires=Fri, 12 Nov 2021 17:53:08 GMT; domain=.airtable.com; samesite=none; secure; httponly". Invalid 'expires' attribute: Fri, 12 Nov 2021 17:53:08 GMT
Exception in thread "main" com.sybit.airtable.exception.AirtableException: {"error":"NOT_FOUND"} (UNDEFINED_ERROR) [Http code 404]
at com.sybit.airtable.exception.HttpResponseExceptionHandler.onResponse(HttpResponseExceptionHandler.java:29)
at com.sybit.airtable.Table.select(Table.java:206)
at com.sybit.airtable.Table.select(Table.java:327)
at com.hived.AirtableInstance.selectTableView(AirtableInstance.java:43)
at com.hived.Main.main(Main.java:25)
This is the function that is causing the error:
public void selectTableView() throws AirtableException, HttpResponseException {
List<Bus> stops = base.table("Bus").select("Stops");
}
I was expecting it to pass all stops from the bus table into the stops list.
I'm not sure what I'm doing wrong, so any help would be much appreciated.
Turns out you need to do a few things.
Add log4j to your project
Add slf4j-simple to your project
Once those dependencies are added. You should now see there is no warning anymore.
Now to remove the error. It turns out instead of referencing the base name, you need to call the base id instead.
base = airtable.base("applJilugnJCtDRdh");
Thats it! Hope this helps anyone else.
In Java API, No Exception is thrown, albeit erroneous transaction:
try {
…………………………………
logger.info("Delete Document " + uri);
docMgr.delete("rocky-mountains");
System.out.println("Deleted");
} catch (Exception e) {
logger.error("Exception : " + e.toString() );
}
Document rocky-mountains doesn’t exist, however, the API happily declares Deleted:
Jul 05, 2020 9:35:04 PM com.fc.allegro.DeleteDocument deleteDocument
INFO: Delete Document rocky-mountains
Jul 05, 2020 9:35:04 PM com.marklogic.client.impl.DocumentManagerImpl delete
INFO: Deleting rocky-mountains
Deleted
In Query Console, eval detects and throws error:
[1.0-ml] XDMP-DOCNOTFOUND: xdmp:document-delete("rocky-mountains") -- Document not found
As the lesser of two evils, DMSDK implies no document deleted but still doesn’t throw exception:
QueryBatcher batcher = dmManager.newQueryBatcher(new StructuredQueryBuilder().document("rocky-mountains"));
batcher.onUrisReady(new DeleteListener())
.onQueryFailure( exception -> exception.printStackTrace() );
Result:
Jul 05, 2020 9:52:07 PM com.marklogic.client.datamovement.impl.QueryBatcherImpl withForestConfig
INFO: (withForestConfig) Using forests on [localhost] hosts for "allegro"
Batch Deleted
INFO: Job complete, jobBatchNumber=1, jobResultsSoFar=0
I tried checked and unchecked exceptions, but to no avail.
Which MarkLogic Class and Method does enforce throwing exceptions and mitigate risk?
A query transaction via Java API:
Failure:
Success:
There is an important difference between running xdmp:document-delete and using Java API to delete a document. The Java API is a wrapper for the MarkLogic REST-API, which follows the rules for a RESTful API. One important rule of a RESTful API is that calls are expected to be idempotent. In short that means that you should be able to run the call twice and get same reply both times. That is why calls to insert, update, and delete don't throw errors if the document does or does not exist.
See also for instance: https://restfulapi.net/http-methods/#delete
I'd recommend using Data Services, or custom REST extensions if you want your app to be more strict.
HTH!
I'm building a web service in java, deploying it under Jboss-as-7.1.1.Final, based on org.apache.cxf.
I need to expose a web method that takes in input a date field that can reach many centuries in the past.
At the moment I'm using java.util.Date.
So, my web method is
public UpdatePersonResponse updatePerson(UpdatePersonRequest request) {
...
}
the request bean UpdatePersonRequest has:
...
private Date birthday;
...
In the soap request that I'm testing I put:
<!--Optional:-->
<birthday>1452-04-15</birthday>
The apache cxf logs show:
16:07:36,568 INFO [org.apache.cxf.interceptor.LoggingInInterceptor] ... Inbound Message
[...]
<birthday>1452-04-15</birthday>
(this is correct)
A custom log I added into the set method of the request bean shows:
16:07:36,843 DEBUG com.xxx.xxx.service.request.UpdatePersonRequest ... called setBirthday with argument [06/04/52 0.00]
(this is wrong)
Then the request bean is valorized as follows:
UpdatePersonRequest [... birthday=Thu Apr 06 00:00:00 CET 1452, ...]
(this is wrong)
So I obtain 1452 April 06, and not 1452 April 15.
I tried with different dates, for example,
soap:
<birthday>1452-04-30</birthday>
custom log:
21:11:51,607 DEBUG [com.xxx.xxx.service.request.UpdatePersonRequest] ... called setBirthday with argument [21/04/52 0.00]
(wrong)
The bean is:
UpdatePersonRequest [... birthday=Fri Apr 21 00:00:00 CET 1452 ...]
(again wrong)
I obtain April 21 and not April 30.
I tried with several dates and noticed that the issue occurs for dates prior then 15 Oct 1582. For more recent dates all works fine and the request bean is correctly valorized.
Is there some java.util.Date limitation that I'm not considering?
Should I use another java Type to represent these kind of dates, and what?
Thank you very much.
EDIT
The effect is that the date I entered into the soap request is converted in Julian date and then the Date I persist on the database will be this converted date.
But I'd like to write on DB the exact date I enter in the request and not a corrected one, in other words I want the caller to deal with the right date system to use, and not any conversion be made automatically by the system.
How can I obtain this?
You are encountering the switch from the Julian to the Gregorian calendar. This is a historical event, not a feature of Java. Googling "Gregorian calendar" will tell you more.
I'm trying to use javamail to download a mailbox of 1000 messages of hotmail.
The problem is after an hour or so, I get a Pop Session timeout exception, and I can't fetch messages anymore.
C: TOP 3210 0
S: +OK 1444 byte(s)
X-Message-Delivery: Vj0zLjQuMDt1cz0wO2k9MDtsPTA7YT0x
X-Message-Status: n:0
X-SID-PRA: Super Wall <apps+ocdlfcez#facebookmail.com>
X-SID-Result: Pass
X-Message-Info: R00BdL5giqoqgO8FeGWl8Lch6n3is6BT1wNitKPj0Jb+fghk1p9MsC+MFGyB2nflerotq/xZ5r8LiguM+3GjEOSj3umkoXeU
Received: from mx-out.facebook.com ([204.15.20.140]) by bay0-mc7-f15.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668);
Tue, 8 Apr 2008 15:14:55 -0700
Received: from api.facebook.com (intlb01-mip1.sctm.tfbnw.net [10.1.240.6])
by mx-out.facebook.com [email018.sctm.facebook.com] (8.13.6/8.13.6) with ESMTP id m38MEtOg030239
for <xgameprogrammer#hotmail.com>; Tue, 8 Apr 2008 15:14:55 -0700
X-Facebook: from zuckmail ([168.143.164.188])
by api.facebook.com with HTTP (ZuckMail);
Date: Tue, 8 Apr 2008 15:14:55 -0700
To: Ahmed Saleh <xgameprogrammer#hotmail.com>
From: Super Wall <apps+ocdlfcez#facebookmail.com>
Reply-to: Facebook <apps+ocdlfcez#facebookmail.com>
Subject: You just received a new photo from Lejla Boric
Message-ID: <03df95f3306af0a88432e7fcca22f7ac#api.facebook.com>
X-Priority: 3
X-Mailer: ZuckMail [version 1.00]
X-Facebook-Notify: platform_email
Errors-To: apps+ocdlfcez#facebookmail.com
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_03df95f3306af0a88432e7fcca22f7ac"
Return-Path: apps+ocdlfcez#facebookmail.com
X-OriginalArrivalTime: 08 Apr 2008 22:14:55.0926 (UTC) FILETIME=[F9D6A560:01C899C5]
.
C: RETR 3210
S: -ERR POP3 session timed out
javax.mail.MessagingException: No inputstream from datasource;
SentDate : Wed Apr 09 01:14:55 AST 2008
nested exception is:
As I said in my comment, this is just a simple case of the session timing out. Like anything, the mail server will have a time limit to prevent excessive access, which is how would describe downloading emails for over an hour!
There is nothing wrong with your code, your just asking too much of hotmail / the mail server!
Though, just some friendly advice: the next time you ask a question here on SO, please don't post irrelevant information like you have done here. In cases like yours, it is helpful to see atleast a snippet of the code that is responsible for that part of the application that is functioning incorrectly and any exceptions - we'd also need to see the line(s) of code mentioned in the stack trace... However, a start would be to actually ask a question instead of this stating a fact, like you have done here!