glassfish-3

jax-rs jersey: Exception Mapping for Enum bound FormParam

偶尔善良 提交于 2019-12-01 20:21:26
I am building a REST application, which is running on Glassfish 3, and having trouble handling the case when a parameter is bound to an enum: @FormParam("state") final State state So, State is just an enum, which contains different types of states. In case a value is submitted, that can not be parsed, a http 400 is returned. This basically is fine. However, I need to intercept that exception and return a custom response, which provides additional information to the client. (e.g. a json object containing a description: "state invalid"). I have bound parameters to my own classes and have been

Automatic EJB Timer on Glassfish Server not triggering

天涯浪子 提交于 2019-12-01 20:19:37
So I'm running a Java EAR application on a Glassfish 3.1. I created a stateless session bean with a single annotated timer function in my EJB Module. I don't have the exact code but it looks something like this: @Stateless public class SessionTimerBean { public SessionTimerBean(){ System.out.println("Constructor Called"); } @Schedule(second="*/10", minute="*", hour="*") public void scheduleTimer(final Timer t) { System.out.println("Timer Called"); } } When I launch Glassfish the debug info seems to indicate that it recognizes the EJB timer annotations and the constructor method for the bean

javax.faces.FacesException: java.lang.ClassCastException: java.lang.String cannot be cast to javax.faces.component.UIComponent

孤人 提交于 2019-12-01 19:59:43
My Java EE web application is working fine with Glassfish 2.1. Now I want to migrate to Glassfish 3.1.1 I have followed the modifications provided here my dependencies for richfaces are as follow:- <dependency> <groupId>org.richfaces.framework</groupId> <artifactId>richfaces-api</artifactId> <version>3.3.3.Final</version> </dependency> <dependency> <groupId>org.richfaces.framework</groupId> <artifactId>richfaces-impl-jsf2</artifactId> <version>3.3.3.Final</version> </dependency> <dependency> <groupId>org.richfaces.ui</groupId> <artifactId>richfaces-ui</artifactId> <version>3.3.3.Final</version

JAX-RS failed to inject @EJB or @Inject

孤者浪人 提交于 2019-12-01 19:24:07
I'm trying to test a minimal JAX-RS + EJB/CDI injection mechanism and currently hitting a road-block due to GlassFish unable to inject for whatever reason. (Using @Inject will throw NPE because GlassFish cannot inject the POJO). My beans.xml contains only <beans /> Here's my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>This is a REST Servlet</display-name>

exposes a Remote client view. This feature is not part of the EJB 3.1 Lite API

ⅰ亾dé卋堺 提交于 2019-12-01 18:20:33
Glassfish v3 gives this exception " exposes a Remote client view. This feature is not part of the EJB 3.1 Lite API" when I deploy the jar file. I tried with Java EE 6 Web Profile SDK and Java EE 6 SDK but there is no difference. I think there is a easy solution about configuration but what is the solution? :) Thanks I solved the problem, thanks. Use the update tool which comes with glassfish installation. Under the Available addons node, Install "Glassfish Commons Full Profile". Restart the glassfish, done. :) Deployment will be success. 来源: https://stackoverflow.com/questions/4301875/exposes

exposes a Remote client view. This feature is not part of the EJB 3.1 Lite API

折月煮酒 提交于 2019-12-01 17:59:11
问题 Glassfish v3 gives this exception " exposes a Remote client view. This feature is not part of the EJB 3.1 Lite API" when I deploy the jar file. I tried with Java EE 6 Web Profile SDK and Java EE 6 SDK but there is no difference. I think there is a easy solution about configuration but what is the solution? :) Thanks 回答1: I solved the problem, thanks. Use the update tool which comes with glassfish installation. Under the Available addons node, Install "Glassfish Commons Full Profile". Restart

Apache ProxyPass and Sessions

北城余情 提交于 2019-12-01 16:22:26
So I'm using Apache to proxy a specific folder to a Glassfish instance. The rules in my conf are: ProxyPass /folder http://localhost:28083 ProxyPassReverse /folder http://localhost:28083 ProxyPassReverseCookiePath /folder http://localhost:28083 It's working fine, except for the sessions. For every subfolder a new session is created. So while I stay in one folder, the session persists, but as soon as I jump into another folder a new session is made. How can I have one session for all subfolders? As covener already mentioned, the second parameter of ProxyPassReverseCookiePath should be a path.

CDI with ejb 3.1 , weld-logger on glassfish v3.0.1

こ雲淡風輕ζ 提交于 2019-12-01 13:55:18
Scenario: 1) create maven ear project, create war project inside 2) add beans.xml to war project`s WEB-INF/ 3) creat simple @Steateless bean project - http://drp.ly/1j5C3t ejb bean : @Stateless @LocalBean public class TestEjb { @Inject Logger log; public TestEjb() { } @Schedule(hour = "*", minute = "*", second = "*/15") public void print1Partner() { log.info("Yrjaaaa"); System.out.println("This is test"); } } maven pom-xml of war project : <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

CDI with ejb 3.1 , weld-logger on glassfish v3.0.1

两盒软妹~` 提交于 2019-12-01 12:04:44
问题 Scenario: 1) create maven ear project, create war project inside 2) add beans.xml to war project`s WEB-INF/ 3) creat simple @Steateless bean project - http://drp.ly/1j5C3t ejb bean : @Stateless @LocalBean public class TestEjb { @Inject Logger log; public TestEjb() { } @Schedule(hour = "*", minute = "*", second = "*/15") public void print1Partner() { log.info("Yrjaaaa"); System.out.println("This is test"); } } maven pom-xml of war project : <?xml version="1.0" encoding="UTF-8"?> <project xmlns

Check if Glassfish DAS is running programmatically

∥☆過路亽.° 提交于 2019-12-01 12:00:28
How to check if Glassfish DAS is running programmatically even if it is deployed on local machine or remote machine? Using Java6 I have found a way to check if DAS is up other than Linux script. With this way it does not matter if both my application and DAS are at same machine or each installed different machine. public static boolean isUrlReachable(String host) { String URLName="http://"+host+":4848"; boolean isUp = false; try { HttpURLConnection.setFollowRedirects(false); HttpURLConnection con = (HttpURLConnection) new URL(URLName).openConnection(); con.setRequestMethod("GET"); isUp = (con