can not receive email after server running few days - jakarta-mail

I had deployed apache james and a java mail application on business server. It works good about a week, but today, users complained that they can not receive new mail any more. I restart the server(the computer) and all solved.
I don't know what's going on, I doubt that it is the config of james because it gives a lot of Exceptions in logs:
spoolmanager-2012-08-06-11-36.log
06/08/12 11:36:28 INFO spoolmanager: Run JamesSpoolManager: Spool Thread #9
06/08/12 11:36:28 INFO spoolmanager: Spool=$Proxy5
06/08/12 11:36:28 INFO spoolmanager: Spool=$Proxy5
06/08/12 13:56:48 ERROR spoolmanager.transport: Exception calling LocalDelivery:
Exception spooling message: Exception caught while storing mail Container:
javax.mail.MessagingException: Exception spooling message: Exception caught while storing mail Container: ;
nested exception is:
javax.mail.MessagingException: Exception caught while storing mail Container: ;
nested exception is:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was: 127.0.0.1:1521:spmmis
the config file is below:
config.xml

Related

Implement Send Mail Task with multiple tries in case if its failed to send mail

I have implemented a Send Mail Task in my package which sends a mail notification on Success or Failure. The send mail task fails sometimes due to the below error.
Task failed: Send Mail Task with Success
Error Code: -1073548540
ErrorMessage: An error occurred with the following error message: "Failure sending mail.
System.IO.IOException: Unable to read data from the transport connection:
An existing connection was forcibly closed by the remote host.
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host"
I have reported the issue to network admin but they suggested the following.
The errors you are receiving from Mailhub can happen occasionally when trying to open a connection.
The only way to resolve this issue is to force multiple retries. If you can, please try to code in ~3-4 retries in your app.
I am sure that it can be done through a script task. I am not sure whether I can implement the multiple tries in case of failure using send mail task.
I have already implemented 20 plus packages with send mail task. I try to implement this approach with minimal change.
I tried the with SQL Server Agent job step configuration, the user has the option of configuring the Retry attempts and the Retry intervals but it runs the whole package on failure which is not suitable for my scenario.
I have to run only send mail task alone in case if it failed to send email with multiple tries.
You mentioned C# option:
here is the logic you are looking for:
int retryCount = 0;
retry:
try
{
[Build and send your email]
}
catch
{
retryCount++;
if(retryCount<4) goto retry; //will try 4 times no matter what caused it to fall in to the catch
}
To not modify your project much.
Create a new package with a for container where you control the number of repetitions.
Create a variable of type int.
Add a package execution task.
In case of correct execution, assign a value to the variable that breaks the for loop.
In case of error you can register it in database or whatever you want.
The image below is for ssis-2008 but it is the same for ssis-2012

Google App Engine shuts down the instance and returns 500 errors

For no reason known GAE just shut down the instance.
There's the log showing 3 events:
Handling signal: term
Worker existing
Shutting down: Master
I've tried to stop and start a version in GAE but I get an error:
Flex operation
projects/center/regions/europe-west1/operations/7f6-4f6e-a95e-4cad0e9d7307
error [INTERNAL]: An internal error occurred while processing task
/appengine-flex-v1/delete_flex_deployment/flex_delete_resources>2019-03-21T04:06:22.362Z12155.jc.3:
Deployment Manager operation
center/operation-1553141182646-58492dc7a4a74-abbc5c2d-282b2316 errors:
[code: "RESOURCE_ERROR" location:
"/deployments/aef-default-20181116t191408/resources/aef-default-20181116t191408-hcfw"
message:
"{\"ResourceType\":\"compute.v1.firewall\",\"ResourceErrorCode\":\"400\",\"ResourceErrorMessage\":{\"code\":400,\"errors\":[{\"domain\":\"global\",\"message\":\"The
resource \'projects/center/global/networks/default\' is not
ready\",\"reason\":\"resourceNotReady\"}],\"message\":\"The resource
\'projects/center/global/networks/default\' is not
ready\",\"statusMessage\":\"Bad
Request\",\"requestPath\":\"https://www.googleapis.com/compute/v1/projects/center/global/firewalls/aef-default-20181116t191408-hcfw\",\"httpMethod\":\"DELETE\"}}"
]
I don't have much experience with GAE, so kind of lost what should I be doing next. Any ideas are highly appreciated.

CAMEL - Channel Closed exception not caught using onException

I am opening this question as I didn't find any answer to problem in the web.
I have used camel to implement a TCP/IP server and I have defined a route like this:
from("netty4:tcp://0.0.0.0:3510")
.to("file:target/outbox");
and I have a client which sends data to this server. When I disconnect this client I can see in my logs this exception:
[Camel (camel-client) thread #0 - NettyEventExecutorGroup] WARN o.a.c.component.netty4.NettyConsumer - Closing channel as an exception was thrown from Netty. Caused by: [java.io.IOException - an existing connection was forcibly closed by the remote host]
My problem is that I am not able to catch this exception using onException clause.
onException(IOException.class)
.log("Exception: ${body}")
.handled(true)
.process(new ExceptionProcessor());
The program does not stop but I want to catch it to handle when the client is disconnected.
Note that I can catch other exceptions which are thrown inside my route.
You cannot handle it as exception, because exception is already catched in netty and logged. This exception is not propagated from netty to netty component.
The solution is a bit tricky. You can extend SimpleChannelInboundHandler and override method channelInactive as described in How can I detect network disconnection in Apache Camel?.
In this custom handler you can set custom properties on exchange with additional information, which is relevant in your application.

OSB - JMS - Error Handler

I'm having some troubles trying to catch an error on OSB when I put a message on queue and JMS Server is down, I have a proxy service calling a business service that have a jms configured.
My proxy service already have Transaction Required and Same Transaction For Response enabled.
The error on Admin log:
Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available
router to destination
But the exception don't catch on ErrorHandler :(
I found the error, the problem is that I was using Publish instead of Routing, after I changed everything worked.
Yes that correct , Publish thread is like fire and forget(completely asynchronous) while a Route or ServiceCallout will latch on to the exception in ErrorHandler
Publish is fire-and-forget, by default with no wait for an answer. This comes from the fact, that default QualityOfService=BestEffort for publish action. You can change that, by using RoutingOptions block, and setting QualityOfService=ExactlyOnce. OSB will then wait for action to execute, hence will be also able to catch potential errors.

Java Mail API Relaying denied error

I am facing some weird problem, I have installed the SMTP server on my AIX box and I am successful to send email using the following command:
mailx -s "Hola Mundo" email#domain.com < /tmp/test.txt
But when I am sending the email using the javamail api I am getting following exception, could you help me how to resolve that.
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 550 5.7.1 <email#domain.com>... Relaying denied
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:632)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:306)
at SendMailUsage.main(SendMailUsage.java:59)
and I am sure my email address is perfect one.
Check out the RFC 2821 (Simple Mail Transfer Protocol), especially the part about STMP replies: https://www.rfc-editor.org/rfc/rfc2821#section-4.2
Status reply starting with 5xx indicates a permanent error. In your case your SMTP server is not configured to route mails to your given destination address.
Issue has been resolved by modifying the sendMail.cf file on the server side. My aix admin informed me that it was due to some DNS issue, will update the solution as soon as I hear from him

Resources