I am facing a terrible problem with java Netbeans.
Each time I run my sendmail function used for registration successfully, which means that
1. my database is successfully updated with the new user;
2. email is successfully sent to designated recipent,
I will need to restart my glassfish after each run before I could do another registration with the function of sendmail.
If I don't restart my glassfish and do another registration, everything goes fine with the database (updated with no issues), however the mail does not get sent at all.
So in short, my sendmail could only work once, and would require restarting glassfish before another sendmail can be done.
Any java/netbeans gurus can help? Greatly appreciate!
http://www.vipan.com/htdocs/javamail.html
Perhaps you can run in debugging mode and post your log entries. Need more information on what happens after your first email is sent.
Related
There is an application on Angular, the backend is an application on Java-Spring.
Both of them are running on a server in a shared network, on a Windows OC machine in VirtualBox (Linux).
The essence of the problem is that when you try to open a web application in a browser, it runs completely on one computer out of five with Windows OC and on one of one on Linux OC.
The browser is everywhere Chrome, only in Linux Mozilla
The application itself is launched, but it does not receive data from the backend at startup.
At the same time I get an error
Failed to load resource:
http://10.151.78.6:5003/es-serv/api/v1/get-data/sh1 net::ERR_CONNECTION_RESET
Here is the controller method that receives requests, there is no call to it in the logs
#GetMapping("/get-data/" + RestApiConstants.VARIABLE_NAME)
public ResponseEntity<ListResponse<DataDto>> getData(
#PathVariable(RestApiConstants.PARAM_NAME_WORD) String name) {
log.info("getData -> start");
return converterDtoService.converterDataDto(name);
}
Moreover, if you just try to open the link in the browser bar
http://10.151.78.6:5003/es-serv/api/v1/get-data/sh1
Then I get the data every time, I have never noticed any failures.
Very similar to the problem with CORS, but then the browser gives a specific error to all requests. Yes, and cors is disabled in the Java application. And even then it is not clear why it still works on some browsers.
It doesn't look like a timeout problem either, because I get an error instantly, and when the server doesn't respond, some time passes and it's noticeable.
And another such moment, I added a forced data reading button to the application. And after 20-30 attempts to read the data, the answer may still come to those computers that did not receive them.
If it was a problem with the network, then it is unclear why on the same computer from the same browser, the GET request typed in the browser line gets answers all the time, without a single pass.
Tell me where to look to understand the reason?
The problem was solved by updating the browsers to the latest version. And before that, the browser version was not very old. I don't understand how this could affect the transmission of the GET request over the network?
When I post a form with an image taken from my phone I reserve the error "413 request entity too large" I realize that an image included in the form taken by the phone camera is too large, and the server rejects the request... but how can I fix this issue, I'm using Java Spring framework, and MySQL database, all of this handled with Amazon aws services.
You have to modify your .platform as shown in the docs.
For example, you could have the following .platform/nginx/conf.d/myconfig.conf with content:
client_max_body_size 20M;
I struggled with this for so long until I came across this post:
https://medium.com/#robin.srimal/how-to-fix-a-413-request-entity-too-large-error-on-aws-elastic-beanstalk-ac2bb15f244d
Couple things to watch out for here, if your server is restarted or you deploy a new version etc, then your nginx server will also reset and you will need to perform these changes again. Also periodically, AWS seems to reset your EC2 instance address, not sure why, but you need to perform these changes again afterwards. There must be a way of making these changes permanent but I haven't figured that part out yet.
I find the solution thanks for helping...
1-I connect to my EC2 instance throw the "connect" button, a terminal appears.
2-I edit this file: etc/nginx/nginx.conf
3- Add this line:client_max_body_size 10M;
and it works fine.
thank you all ;
I'm working on a project I'm Java with regards to outlook.
Here I'm able to do all the functions like Read a mail, write a mail, reply to a mail etc...
But now we've been thinking of taking it to the next level.
Our plan is as below.
We have an email address like info#myDomain.com, when ever an email is sent to this address, I need to reply them. Here basically customers send an email asking for some data, and we've the data available in our portal, and we just need to send it.
The response would be Like thank you for contacting us, we will get back to you soon. Mean while please look into this {URL}.
And this has to be done automatically when ever there is an email hit to this particular email address.
Couple of questions:
- should my machine be on the whole day to get this thing done.
- is there a way that a Java application can automatically monitor my inbox to see for this case match.
- Also, can I have this running in the bg.
Can someone please point me into the right direction/approach where can I can start working on this task.
Thanks
when ever an email is sent to this address, I need to reply them.
For this you need to monitor your email account fro incoming emails. Here is one of the way to do this
The response would be Like thank you for contacting us, we will get back to you soon. Mean while please look into this {URL}.
Once you receive an email (using above email monitoring approach), you need to call a method that sends the reply with above format
And this has to be done automatically when ever there is an email hit to this particular email address.
Above two steps accomplishes this task.
should my machine be on the whole day to get this thing done
Basically, you will need an application server (like tomcat) where your above java program is deployed. So, yes this server needs to be running and available all the time.
is there a way that a Java application can automatically monitor my inbox to see for this case match
Check point 1
Also, can I have this running in the bg
You can run tomcat as a service in windows (more info). It has many advantages, automatic startup on boot being the one. Similar implementations are also available for other OS.
So, in short, this can be accomplished. It is bit complex but not much difficult. Cheers
I was wondering if someone could help me out with an issue I'm having. I'm using a Jetty server and using XAMPP to connect to a MySQL server, which I'm accessing through PHPMyAdmin.
I have a class that essentially is meant to drop all the tables in a database and then add some more, with data.
The first time I ran it, it worked fine, and did what it's meant to do, but the next time, I'm getting errors like the ones below. If I try it with a different database on the same host, again, it works fine first time, but any additional attempts will not work.
Can anyone shed some light please?
It seems that your Jetty instance is already running. Try to stop it and then run your test again.
If I try it with a different database on the same host, again, it works fine first time, but any additional attempts will not work.
This is happening because, I suppose, you are trying to start the server every time you start a test, but not closing after the test is done.
You can now either stop your Jetty instance manually, using Task Manager, restarting your machine in order to be able to run tests again
You've probably ran Jetty server twice or port 8444 is being 'listened' by another application.
Fire that command and find out which service is using that port
netstat -aon | find /i "listening"
I am facing a problem that is burning my brain. I have an amazon ec2 instance that runs Linux AMI, I installed tomcat7 and I am deploying my webservice in it. This webservice connects itself with an amazon RDS instance where I have my mysql (that I use to validate user and password). When I start my tomcat7 service everything works great, after one hour I can't log in into my system.
If i restart the tomcat7 service, everything works again. But why?
I really don't know where is the problem. I can connect to my database directly from my project in eclipse, and via command line.
I don't know why if I restart the service, my webservice works again. I know that the service hasn't stoped, because I can access the login page of my webapp.
I really appreciate any kind of help,
Rodrigo Araujo.
ps: Last week, everything was working just fine.
I've seen such behavior before, it is probably tomcat and not ec2. Check the following:
1- Your threading configuration (maxThreads and acceptCount). I've seen this behavior using the blocking connector when currentThreadsBusy > maxThreads. Check that you have enough threads or use the non-blocking (nio) connector.
2- Check that your connection pool can reconnect lost connections automatically (autoReconnect=true in the jdbc url), your threads might be waiting db io on lost connections.
Anyway, your ec2 instance is probably still working...