Is there a way to hide Grizzly server version when displaying error pages? - grizzly

Is there a way to hide Grizzly server version when displaying error pages for security reasons. Also could you point me document for configuring Grizzly server. Not able to find from https://grizzly.java.net.
Grizzly server version: 2.3.16.
thanks in advance.

please do the following:
httpServer.getServerConfiguration().setHttpServerVersion("");

Related

j_spring_security_check not invoked in tomcat

I'm using Tomcat 8.5.4 with myfaces 2.2.10 and primefaces 5.3. My local server works fine (tried to run it both standalone and eclipse) when I open the login screen and press the login button the following is visible in the logs:
...web.controller.LoginController] - <Validating login>
...AntPathRequestMatcher] - <Checking match of request : '/j_spring_security_check'; against '/external/**'>
After this a transaction started and the user is validated against the database as expected.
However when I copied the whole Tomcat distribution to a remote server and deployed the same application, j_spring_security_check is not executed anymore:
[org.springframework.faces.support.RequestLoggingPhaseListener] -
<Entering JSF Phase: RESTORE_VIEW(1)>
[org.springframework.faces.support.RequestLoggingPhaseListener] -
<Entering JSF Phase: RENDER_RESPONSE(6)>
[...web.controller.LoginController] - <No error messages during validation>
And after this the login screen is reloaded.
Can anyone help me why there is a difference in the behavior of the same servers and same applications? Any idea is appreciated!
I'm pretty sure that it does not have anything to do with myfaces or primefaces versions and I tried different versions but the behavior is the same...
for those who have the same issue I post my solution.
Of course there can be millions of reasons to cause this behavior but in my case it was the tomcat configuration... in Connector config in server.xml I've set
maxPostSize="0"
by mistake which I tought means no limit, however I should have set
maxPostSize="-1"
This resulted in the server cutting the post payload from the request... and causing me a lot of headache :)

Want to create custom error page for Grizzly server

We want custom error pages has to be served whenever there is an error, because default error page provides too much information which we don't want. Please provide document for the same, if any.
Grizzly server version: 2.3.16
thanks in advance
Please use the following:
server.getServerConfiguration().setDefaultErrorPageGenerator(...);
Note that in order to get the ErrorPageGenerator working, you need to attach it to the server configuration before Grizzly server is started.
So you should be doing something like that:
HttpServer httpServer = GrizzlyHttpServerFactory.createHttpServer(
baseUri,
resourceConfig,
false // so Grizzly won't start automatically
);
httpServer.getServerConfiguration().setDefaultErrorPageGenerator(...);
httpServer.start();

Wildfly Undertow HTTP Response 200 but no content

I am developing a simple web service using Eclipse Java EE IDE for Web Developers : Version: Kepler Service Release 2 Build id: 20140224-0627 and Wildfly-8.2.0.Final. I chose wildfly-javaee7-webapp-blank-archetype using Maven and started development. Firstly, there was no problem, I could add some simple jsp pages and also a simple html page with some images and javascript inclusion then I could deployed, launched and accessed those pages by browser. But all of a sudden, Wildfly (I guess Undertow maybe?) started to response with HTTP response 200 with no content... I really don't get what is going on. I also did rollback my sources to the very early simple pages only. But still the symptoms are the same. Also I have tried to use newer version of Wildfly-9.0.1.Final and deployed manually but I haven't seen any difference.
ex1) this is ok. (Of course browsers take care of this...)
ex2) this kind of contents won't be loaded and sent back as content 0...
I doubted local path issue but I haven't changed anything and it was loaded earlier.
It would be really appreciated if somebody could give me a solution.
Finally I have solved this problem. I have found a problem on a servlet I have added at last. Actually I was trying to migrate my web service running on glassfish and did migrate files one by one. I specified a URL to be handled by the servlet in Web.xml when it run on glassfish. But somehow, it's not working on Wildfly which means all URL request are unexpectedly handled by the servlet... Since I have no idea to specify url to be handled by the specific servlet in Web.xml for Wildfly, I decided to filter request URL in the servlet code. So it is working now. Thank you guys trying to help me...

usergrid 2.0 database setup error

I am trying to get usergrid 2.0 running.
I built the sources and deployed to tomcat. the status shows usergrid is running
when i try to setup database (http://localhost:8080/system/database/setup) it results in an error. "Error migrating Core Persistence"
Error:
{"error":"runtime","timestamp":1234567890,"duration":0,"error_description":"Error migrating Core Persistence","exception":"java.lang.RuntimeException"}
How to resolve this ?
you must be running cassandra 1.2.1* and Elastic Search current version. Also you cannot upgrade from a 1.0 cluster.
There could be a variety of things wrong. Maybe your Cassandra and ElasticSearch instances are not available, maybe you have specified the wrong hostnames/ports for them in your usergrid-deployment.properties file, maybe your properties file is not in the Tomcat classpath (or maybe there you are hitting a bug in Usergrid).
Since you see a RuntimeException, there is probably a stack trace in Tomcat's catalina.out log file that could provide information to help you diagnose the problem.

What does it means that the partial response writer is not integrated with PPRResponseWriter?

I'm trying to develop an application using JSF, primefaces, Tomcat7.
When I execute an ajax event, I get this warning:
17-ott-2012 9.26.04 org.apache.myfaces.trinidadinternal.context.PartialViewContextImpl getPartialResponseWriter
AVVERTENZA: getPartialResponseWriter() called during render_reponse. The returned writer is not integrated with PPRResponseWriter
What does it means? What do I have to do to integrate it?
In my server log, on startup, I find some messages about some web context parameters not found. May it be related to the previous warning?
Thanks for your help!!
This class is specific to MyFaces Trinidad. Apparently you're mixing Trinidad with PrimeFaces and it's not working very well. Since you didn't mention anything about Trinidad in your question, it's perhaps a leftover of previous experiments to play around with several component libraries. You might want to remove it before using PrimeFaces.

Resources