glassfish-4

Glassfish Admin Console throws java.lang.IllegalStateException when creating JDBC Pool

痞子三分冷 提交于 2019-11-27 06:44:55
A week ago I downloaded Glassfish 4.1. Did a zip install. Attempted to use Admin Console to create a JDBC Connection Pool. Received this error message: java.lang.IllegalStateException: getOutputStream() has already been called for this response Lots of references to that error. Lots of people declared it "Asked & Answered". But I can't find a single reference anywhere to that problem, let alone a solution. But if anyone believes it's been answered, please be sure to add a link to the solution to this problem: New installation. Did nothing but open the console and try to create a new JDBC

Java 8 Lambda Expression Within REST Service not working

£可爱£侵袭症+ 提交于 2019-11-27 05:14:27
If I put a Java 8 Lambda expression in a REST service, it crashes. If I remove the lambda expression, it works. It does not matter if I use the lambda expression or not. Just the existence the lambda is enough to crash. Everything else Java 8 related seems to work. Below is my code (simplified): @Path("finance") public class FinanceRest { @GET @Produces("text/plain") public String speak() { return "Hello world."; } private void lambdaFunction(Predicate<Account> predicate) { // Any lambda will cause problems, no matter how simple List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);

cannot get SLF4J working with glassfish 4

一笑奈何 提交于 2019-11-27 01:23:01
问题 I have configured glassfish 3 to use SLF4J in the past by using the SLF4J JUL bridge and it worked fine. The problem I'm having now is that if I use my same setup, SLF4J complains about there being duplicate SLF4J bindings on the classpath and after searching, glassfish itself contains those reference. How do I get SLF4J working? I tried making my dependency upon the SLF4J-API as provided, and then removed LogBack Classic since glassfish already contains some logback code. Doing those things

Right way to configure Glassfish SSL certificate nickname?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 23:32:44
问题 Glassfish lets to set the SSL certificate nickname through its admin console as it is highlighted in the pic below: But almost every tutorials in the web mention that it is necessary to replace all occurrences of the default SSL nickname ( s1as ) with the one will be used(i.e. mydomain.com ) in the domain.xml file. So what is the proper way of setting certificate nickname? 回答1: It is very likely that the admin console is just updating the domain.xml file anyway. In either case, it is good

Is EntityManager really thread-safe?

拈花ヽ惹草 提交于 2019-11-26 21:38:20
问题 I'm talking about the basic usage here: @Stateless public class BookServiceBean implements BookService { @PersistenceContext EntityManager em; public void create(Book book) { this.em.persist(book);} } Googling the above question, StackOverflow says yes, but no - the accepted answer says Yes, but a followup is No; Spring.io says both yes and no, and Adam Bien, who seems to be a Java EE expert, gives an unqualified yes. My own experience with a simple scheduled bean suggests the answer is NO:

File upload doesn&#39;t work with AJAX in PrimeFaces 4.0/JSF 2.2.x - javax.servlet.ServletException: The request content-type is not a multipart/form-data

痴心易碎 提交于 2019-11-26 14:24:31
Important : The issue which is discussed in this thread has been fixed as of PrimeFaces 5.1 final (community release) released on Monday, October 6, 2014 (just a few minutes ago from now). I attempted on JSF 2.2.8-02 (or api , impl ). As such, if you happened to use that version ( or higher, no need to mention ), you would not even need to read this question anymore. I have a web application running on GlassFish 4.0 Mojarra 2.2.4 PrimeFaces 4.0 final Everything except file upload with AJAX works well. The following xhtml file sends multipart contents via an AJAX request triggered by a

Glassfish Admin Console throws java.lang.IllegalStateException when creating JDBC Pool

一世执手 提交于 2019-11-26 12:55:47
问题 A week ago I downloaded Glassfish 4.1. Did a zip install. Attempted to use Admin Console to create a JDBC Connection Pool. Received this error message: java.lang.IllegalStateException: getOutputStream() has already been called for this response Lots of references to that error. Lots of people declared it \"Asked & Answered\". But I can\'t find a single reference anywhere to that problem, let alone a solution. But if anyone believes it\'s been answered, please be sure to add a link to the

Java 8 Lambda Expression Within REST Service not working

早过忘川 提交于 2019-11-26 12:47:04
问题 If I put a Java 8 Lambda expression in a REST service, it crashes. If I remove the lambda expression, it works. It does not matter if I use the lambda expression or not. Just the existence the lambda is enough to crash. Everything else Java 8 related seems to work. Below is my code (simplified): @Path(\"finance\") public class FinanceRest { @GET @Produces(\"text/plain\") public String speak() { return \"Hello world.\"; } private void lambdaFunction(Predicate<Account> predicate) { // Any

How to run glassfish 4 on port 80 instead of 8080? root access is not an issue

时光毁灭记忆、已成空白 提交于 2019-11-26 12:11:34
问题 Did some google on it and the solution was to redirect using iptables or mod in apache? Since my application uses websockets the above solution breaks my websocket connectivity and I again have to connect to my websockets using port 8080. Is there any way that I can run the glassfish itself on port 80 so that my websockets also run on port 80 making easier for users behind corporate firewall to access the app since corparates may block 8080. I have root access as well. 回答1: To run GlassFish

File upload doesn&#39;t work with AJAX in PrimeFaces 4.0/JSF 2.2.x - javax.servlet.ServletException: The request content-type is not a multipart/form-data

社会主义新天地 提交于 2019-11-26 03:53:13
问题 Important : The issue which is discussed in this thread has been fixed as of PrimeFaces 5.1 final (community release) released on Monday, October 6, 2014 (just a few minutes ago from now). I attempted on JSF 2.2.8-02 (or api, impl). As such, if you happened to use that version ( or higher, no need to mention ), you would not even need to read this question anymore. I have a web application running on GlassFish 4.0 Mojarra 2.2.4 PrimeFaces 4.0 final Everything except file upload with AJAX