glassfish-3

Glassfish: Silently ignore unavailable data source at application start up

自作多情 提交于 2019-12-08 02:15:37
问题 I have an EJB application which uses JPA 2.0 on Glassfish 3.1.2 (provider is EclipseLink). When the database is down the application does not start and even more: can't be deployed. This is because EclipseLink does some initial verification. Is there a way that the application can be deloyed and started even if the database is down? Background: The resource being unavailable comes not into play until the first business function is called which accesses the database. From application startup

Cannot Deploy JAX-WS webservice on Glassfish

早过忘川 提交于 2019-12-08 00:10:43
问题 I have a problem running JAX_WS Webservices with Glassfish application server. Previously, i used to use Apache tomcat which works fine with it. But now, having Glassfish, this problem is preventing the application from being deployed... please check it below: 2013-04-04T13:09:23.028+0300 com.sun.xml.ws.wspolicy.com.sun.xml.ws.api.policy.ModelTranslator SEVERE: [failed to localize] WSP_0071_ERROR_MULTIPLE_ASSERTION_CREATORS_FOR_NAMESPACE(http://schemas.xmlsoap.org/ws/2004/08/addressing, com

jsf check user logged in

ε祈祈猫儿з 提交于 2019-12-07 19:23:25
问题 How can I check if a user is logged in using jsf? This is how I am doing it and it's not working: <ui:fragment rendered="#{!request.getUserPrincipal().getName().equalsIgnoreCase('anonymous')}"> <h:outputLink value="logout"> <h:outputText value="Logout" /> </h:outputLink> </ui:fragment> 回答1: Just check if HttpServletRequest#getUserPrincipal() is not null . <ui:fragment rendered="#{request.userPrincipal != null}"> <h:outputLink value="logout"> <h:outputText value="Logout" /> </h:outputLink> <

Enable cache of J2EE web application's resources

為{幸葍}努か 提交于 2019-12-07 17:10:25
问题 How can I control my web application's resource handling? I have users with extremely high latency times (~1s!) and I must test my application in such environments. What I can see right away is that my resources (css and image files) are always reloaded on every page, probably because the response header contains an Expire tag that does not allow for any browser caching. How can I tell the ?resoure adapter? to set it to some reasonable value? Are there any other ways to improve bad latency

How to change domain name in Glassfish generated urls?

这一生的挚爱 提交于 2019-12-07 16:44:55
问题 my Glassfish instance uses my Windows computer name as domain name in urls, as so : http://mymachine-567125f:8080/TemplateEJBService/TemplateEJB Obviously, mymachine-567125f is not known of any DNS, and as a consequence, url directly leads to the deepest void of intergalactic space. So, is there a way to tell glassfish to instead use localhost , or even my ip address, for its generated urls ? 回答1: Matt Handy's answer did not work for me. However, the solution that Matt gave in his comment to

Learning resource for Configuring Hibernate JPA 2.0 on Glassfish server

泄露秘密 提交于 2019-12-07 15:44:53
问题 I am trying to create a new Java EE project using hibernate and JPA 2.0 on the glass fish server. Can you guys provide me some resources to configure the above so that they work seamlessly? I have tried using netbeans and generated the persistence unit by using the hibernate provider, but I end up getting this error: javax.persistence.PersistenceException: [PersistenceUnit: DBAppPU] Unable to build EntityManagerFactory 回答1: First, install Hibernate support via the update tool (or follow the

How to remove (duplicate) X-Powered-By: JSF/2.0

送分小仙女□ 提交于 2019-12-07 08:01:04
问题 In my instance, I have Glassfish 3.1.1 / Mojarra 2.1.3 I could remove the X-Powered-By in Glassfish Admin Console in the Network listener (so it doesn't show the long text: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.1 Java/Sun Microsystems Inc./1.6) but it still shows (yes, twice): X-Powered-By: JSF/2.0 X-Powered-By: JSF/2.0 I am using Jersey and JAXB to expose some web-services and have some servlets deployed using the @WebServlet Annotation but I don't think they add

Invoke soap webservice returning list of objects from java client with axis

白昼怎懂夜的黑 提交于 2019-12-07 06:43:13
问题 I'm getting mad with webservices. I have a very simple soap webservice : @Remote public interface StudentService { public String sayHello(); public List<Student> getStudents(); } And @Stateless @WebService public class StudentServiceImpl implements StudentService { @Override public String sayHello() { return "Hello World"; } public List<Student> getStudents() { List<Student> students = new ArrayList<Student>(); Student st1 = new Student(); st1.setMatricule(1234); st1.setName("student1");

Glassfish - Preserve sessions across redeployment - SessionListener is not called on session recreation

落花浮王杯 提交于 2019-12-07 01:00:36
So I made a simple session listener - there are many on the web : import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.annotation.WebListener; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; @WebListener class SessionListener implements ServletContextListener, HttpSessionListener { private static final int MAX_INACTIVE_INTERVAL = 1000; // in secs // static AtomicInteger numOfSessions; // singleton ? static ? static int

Glassfish 3.0: Exception while deploying ejb module…Invalid ejb j ar: it contains zero ejb

萝らか妹 提交于 2019-12-06 19:22:27
I have a very simple ejb 3.0 module with maven, it has only two session beans one stateless and the other is singleton...when I am trying to deploy the project on Glassfish 3.0 server, I got this exception: Error occurred during deployment: Exception while deploying the app : Invalid ejb jar : it contains zero ejb. Note: 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (