glassfish-4

java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape () pattern

折月煮酒 提交于 2019-11-29 14:34:50
I have a URL like, http://localhost:8080/Project-war/utility/Login.jsf?fallback=%2FProject-war%2Fpublic_resources%2FShowDetails.jsf%3Fid%3D9 This URL is formed, when a login page is requested. The return URL to which the request is to be redirected after successful login is appended as a query-string parameter to the URL. If this URL is deliberately changed by a user like so, http://localhost:8080/Project-war/utility/Login.jsf?fallback=%2FProject-war%2Fpublic_resources%2FShowDetails.jsf%3Fid% A few trailing characters have been removed. It is a mal-formed URL. In this case, it causes the

Custom bean validation does not `@inject` CDI beans and does not interpolate message?

谁都会走 提交于 2019-11-29 13:09:06
I am using GF4 with bean validation. I am trying to @Inject a service bean in my custom validator but I get a null value. public class TestValidator implements ConstraintValidator<>{ @Inject Service myService; } Isn't this suppose to be working with JEE7? Also, I am trying to find built-in dynamic message interpolation (Without writing my own MessageInterpolator ). I did see some examples but they are not very clear. What I am looking for is to pass dynamic parameters from the ConstraintValidator.isValid . For example: Message_test={value} is not valid And somehow weave this, in the same way

Configure Jackson as JSON Provider in JAX-RS 2.0

北战南征 提交于 2019-11-29 11:56:16
问题 I want to use Jackson as JSON provider for my JAX-RS 2.0 webservice. For JAX-RS I use Jersey 2.0 in GlassFish 4. With JAX-RS 1.x I can add <init-param> <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> <param-value>true</param-value> </init-param> in my web.xml . How can i do this in Jax-RS 2.0 with Jersey 2.0? I implement a application class like this public class MyRESTExampleApplication extends ResourceConfig { public MyRESTExampleApplication() { packages("com.carano

How can I define a JAX-RS service that processes multi-part data in JEE?

烂漫一生 提交于 2019-11-28 21:33:51
This is what I have so far: This initializes my REST service package com.dothatapp.web.rest; import javax.servlet.annotation.MultipartConfig; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @ApplicationPath("/authed/rest") public class JaxRsActivator extends Application { } And this what my service looks like: import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import

org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped

感情迁移 提交于 2019-11-28 17:22:39
I have example web application Hibernate 4.3.5 + Derby database 10.10.1.1+ Glassfish4.0 with IDE NetBeans 8.0Beta. I have the next exception: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: CUSTOMERV is not mapped at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:189) at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:109) at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:95) at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement

Deployment-Error: Java-Webproject from netbeans to glassfish 4.0

与世无争的帅哥 提交于 2019-11-28 09:56:52
问题 Setup I'm using Netbeans 7.4 on Mac OSX Mavericks and Glassfish 4.0 (build 89) on my dedicated server and JDK 1.7 . To use the server locally I setup and ssh-tunnel. The following way: ssh -L 4848:127.0.0.1:4848 -p 6122 glassfish@XXXXXXXXXX This is working perfectly fine, I can access the server via localhost without any problems. To use this server I added a server in Netbeans, see prinscreen: Problem Now I'd like to deploy the project to the server (Right-Click Project -> Deploy) but I get

cannot get SLF4J working with glassfish 4

柔情痞子 提交于 2019-11-28 06:31:28
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 doesn't yield any successful results. Walter This may helps you Download Glassfish 4 , SLF4J and

SimpleFormatter ignoring the java.util.logging.SimpleFormatter.format property

心不动则不痛 提交于 2019-11-27 15:53:50
I'm using java.util.logging on GlassFish 4. I'm defining my own class to initialize the LogManager by defining the System property: -Djava.util.logging.config.class . My class loads the logging.properties file, merges it with some other property file and does some custom replacement. The following is the relevant part of my logging.properties file: java.util.logging.FileHandler.pattern=C:/Work/server/glassfish/domains/domain1/logs/JMSFileHandler%g.log java.util.logging.FileHandler.limit=2000000 java.util.logging.FileHandler.count=20 java.util.logging.FileHandler.append=true java.util.logging

Constructor of CDI managed bean is invoked twice while opening the page

主宰稳场 提交于 2019-11-27 07:12:32
问题 I am trying to use the ChartBean sample from PrimeFaces. This is the view: <h:form> <p:layoutUnit position="center"> <p:lineChart id="linear" value="#{chartBean.linearModel}" legendPosition="e" title="Linear Chart" minY="0" maxY="1000" style="height:600px"/> </p:layoutUnit> </h:form> This is the bean: @Named @RequestScoped public class ChartBean implements Serializable { private CartesianChartModel categoryModel; private CartesianChartModel linearModel; public ChartBean() { System.out.println

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

北城以北 提交于 2019-11-27 06:49:35
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. Alexandre Jacob To run GlassFish on port 80 you need to : Connect to the administration interface (by default on port :4848)