Deparis Momo

Greenhorn
+ Follow
since Dec 05, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Deparis Momo

Ok I resolved the problem. Firstly I removed @EnableWebMvc and WebMvcConfigurationSupport, then I noted that there was an issue in the url. I put :



Instead of:



As I am a Windows user.

Thanks
4 years ago
Here is my WelcomeController Class:



And my spring security Class:

4 years ago
I have created a spring boot application and I am trying to get images from external folder on disk, here is my code:



But when I launch the application, I got this error message:

> o.s.web.servlet.PageNotFound: No mapping for GET /myapp/index
> o.s.b.w.servlet.support.ErrorPageFilter  : Cannot forward to error
> page for request [/] as the response has already been committed.



Even if I remove @EnableWebMvc and I extend WebMvcConfigurationSupport directly, I am getting the same issue.

 1.  Why am I getting this issue?

 2. Is it possible to get images from external resources without using @EnableWebMvc or WebMvcConfigurationSupport?

Thanks
4 years ago
Ok now I understand. Thank you to all.

Regards
8 years ago
Find in this link an example of what I want to do. There is an form which an user can fill and send his message:

Example of sending an email from the website

Thanks
8 years ago
Yes,I know how to send an email with the JavaMail API:



This code send the message from my SMTP server to the user address mail for example, but I want to do the opposite i.e sending the message from the user to my SMTP srver.
8 years ago
Hi

I created and hosted a JEE application and I have a jsp page named contact.jsp from which a user can send me an email. I can use "mailto" link for that but I want to send the mail from my jsp page.

Thanks
8 years ago
I already used a connection pool. Here is my code:

In fact in the index.jsp (which is the welcome page), there is a filter which connect to my database, collect and list data from the database. So I have no connection issue. But in the server I am located, my hoster setted the timeout value to 10 minutes. That's why after 10 minutes of inactitity, the mysql connections timed out.
Hi

There's no compilation error but my mySQL connections are still timing out after 10 minutes and I am getting this error message above.

Can someone help me please?
It's ok now, I forgot to add the "?" in the url string. The correct url is:

Hi

I hosted my first JEE web site but my mySQL connections are timing out after few minutes and I am getting this error message:

HTTP Status 500 - com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

type Exception report

message com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

description The server encountered an internal error that prevented it from fulfilling this request.

exception

dao.DAOException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.
dao.OffreDaoImpl.lister(OffreDaoImpl.java:95)
filters.PrechargementFilter.doFilter(PrechargementFilter.java:96)
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)

root cause

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.
sun.reflect.GeneratedConstructorAccessor28.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:525)
com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2985)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2871)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3414)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
com.jolbox.bonecp.PreparedStatementHandle.executeQuery(PreparedStatementHandle.java:172)
dao.OffreDaoImpl.lister(OffreDaoImpl.java:90)
filters.PrechargementFilter.doFilter(PrechargementFilter.java:96)
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)

root cause

java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2431)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2882)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2871)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3414)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
com.jolbox.bonecp.PreparedStatementHandle.executeQuery(PreparedStatementHandle.java:172)
dao.OffreDaoImpl.lister(OffreDaoImpl.java:90)
filters.PrechargementFilter.doFilter(PrechargementFilter.java:96)
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)



I asked my hoster to increase the timeout value and here is his response:

Please accept our sincerest apologizes for misunderstanding.
Unfortunately due to shared hosting environment your request could not be accomplished - it will affect other customers, that share server resources for you. (10 min is max value for this parameter).
Since you strongly need some features - we can only suggest you considering to move to VPS or dedicated server where you will have full admin privileges and can do whatever you want without affecting of another customers.

As a solution, we would like to suggest you to add in your jdbc connection string following command:
&autoReconnect=true&failOverReadOnly=false&maxReconnects=10

In this case, after timeout, you will be reconnected again.



So I edited my config.properties file:



But when I launched my application i got this error message:

INFO [org.netbeans.modules.tomcat5.TomcatManagerImpl]: TomcatManagerImpl connecting to: http://localhost:8084/manager/text/deploy?config=file%3A%2FC%3A%2FUsers%2FMo%2FAppData%2FLocal%2FTemp%2Fcontext138676520858696842.xml&path=/MonSite
INFO [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: Cannot incrementally deploy to more than one target
INFO [org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment]
The module has not been deployed.
See the server log for details.
[catch] at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:111)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:283)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:541)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)



What can I do?

Thanks
Hello

I just hosted my first JEE web site and i am facing a strange issue. I have two pages "example1.jsp" and "example2.jsp" and the urls leading to these pages are "http://mydomainname.com/pages/offers/alltest/example1.jsp" and "http://mydomainname.com/pages/offers/alltest/example2.jsp". These 2 urls contain 57 characters.

But only 55 characters are displayed:

"http://mydomainname.com/pages/offers/alltest/example1.j" for the first url

and "http://mydomainname.com/pages/offers/alltest/example2.j" for the second.

Therefore my two pages are not found.

Note that locally I have never faced such issue.

Thanks & Regards
9 years ago
Hi Tim

The problem is resolved. In fact, there was an error message below in the log file:

Caused by: java.sql.SQLException: Access denied for user 'xxxxxxxx'@'localhost' (using password: YES)



When I was creating the database, I forgot to allow all privileges to the user "xxxxxxxxx".

Now all is ok, there is no issue.

Thanks al lot Tim.
9 years ago
Hi

I bought a domain name and I am trying to host my J2EE application. I created the war file and I renamed it to ROOT.war. Then I uploaded it into "/home/%username%/tomcat/webapps/%domainname%/" directory.

But when I access to the site, the welcome page was blank.

Here is a part of my server.xml file:



I don't know what to do.

Thanks
9 years ago