glassfish

Server page redirected to Filer before Login

大兔子大兔子 提交于 2019-12-24 02:56:25
问题 I have just deployed an Application which has a login page. Upon logging in with the "right" password and "username" however, the index.xhtml gets an error and gets ALWAYS redirected to the filter( a sessions time out) that has been configured. What are the reasons for the redirection? I made a check to see if the session was invalid, but no that was not the case. Here is the web.xml(part) where the filter has been set. Error: javax.faces.application.ViewExpiredException: viewId:/index.xhtml

jsf/glassfish hosting static files

二次信任 提交于 2019-12-24 02:52:49
问题 I'm using Glassfish/JSF. Is it possible to host static files from disk? I need to generate xml file and save it somewhere on disk so it could be available as http://domain.com/file.xml I need similar functionality to apache/php where I can save file to /public_html and it is automatically available. 回答1: I think you should try out Virtual directory. Basically, you only need to create a Virtual directory which is mapped to a folder on your hard-disk. After that, you can access all files in

EJB @Schedule issue

五迷三道 提交于 2019-12-24 02:42:08
问题 I need to schedule a task in my web application. The task needs to use a member field of the Servlet that is initialized during deployment. I have used the EJB @Schedule . However when the task is fired, the member field is null. I guess that the cause lies in the fact that I had to add the @Stateless annotation to the servlet in order to make the @Schedule work, and my Servlet needs to preserve its state indeed? If yes, how can I fire my task in a simple and efficace way? Using GlassFish 3

EJB @Schedule issue

时光怂恿深爱的人放手 提交于 2019-12-24 02:42:05
问题 I need to schedule a task in my web application. The task needs to use a member field of the Servlet that is initialized during deployment. I have used the EJB @Schedule . However when the task is fired, the member field is null. I guess that the cause lies in the fact that I had to add the @Stateless annotation to the servlet in order to make the @Schedule work, and my Servlet needs to preserve its state indeed? If yes, how can I fire my task in a simple and efficace way? Using GlassFish 3

Using different eclipselink than bundled in glassfish-embedded-web

半世苍凉 提交于 2019-12-24 02:26:27
问题 I use glassfish-embedded-web for integration tests inside a maven project: <dependency> <groupId>org.glassfish.extras</groupId> <artifactId>glassfish-embedded-web</artifactId> <version>3.2-b06</version> <scope>test</scope> </dependency> glassfish-embedded-web comes with Eclipselink 2.2.0, but the project requires features of 2.4. For regular deployment, this is solved by adding je required jars to glassfish's modules directory and this dependency: <dependency> <groupId>org.eclipse.persistence

Multiple EntityManagers managed by the container (CMT)

心不动则不痛 提交于 2019-12-24 02:20:13
问题 I have the following situation: My applications needs to dynamically connect to multiple databases, so after a lot of search I think the best option is to do create multiple EntityManagers and decide at runtime which one to use. Here is the code: public class GenericDao { @PersistenceContext(unitName = "db1") protected EntityManager em1; @PersistenceContext(unitName = "db2") protected EntityManager em2; @PersistenceContext(unitName = "db3") protected EntityManager em3; } This way I can

org.apache.catalina.LifecycleException when trying to start Glassfish server with Eclipse

浪尽此生 提交于 2019-12-24 01:21:43
问题 I have been busy building a REST application with angularjs frontend, using a MAVEN jersey-quickstart-webapp, developed on Eclipse using the GLASSFISH webserver. Today when I started to do some development on the project, when I tried to start the server in eclipse and deploy the webapp, I got the following error message displayed in the eclipse error window: cannot Deploy pododdle deploy is failing=Error occurred during deployment: Exception while loading the app : java.lang

Java Glassfish - How to consume SSL web service?

这一生的挚爱 提交于 2019-12-24 00:52:53
问题 I used netbeans to create and deploy an SSL ejb hello world web service on Glassfish server and then tried (unsuccessfully) to consume that service from a java application. Any help would be highly appreciated. Below is more detail about what I did. I created a hello world (ejb) web service. I set the Secure Service option of the hello world web service to Transport Security (SSL) I deployed the web service on glassfish 3.1 I created a java application, added a web service client that

ClassCastException when using embedded glassfish for unit tests

人走茶凉 提交于 2019-12-24 00:34:52
问题 I'm running some unit tests on some EJBS via maven and an embedded glassfish container. One of my tests works, but all subsequent attempts to test a different EJB result in the same error: java.lang.ClassCastException: $Proxy81 cannot be cast to Followed by whatever bean I'm attempting to test. I'm confident my setup is good since, as I say, one of my beans can be tested properly. Examples of workiing code: @Stateful public class LayoutManagerBean implements LayoutManager { private final Log

JDBC and Connection Pools in Glassfish App Server

冷暖自知 提交于 2019-12-24 00:16:19
问题 I want to set up a connection pool and JDBC connection on EAR deployment so I do not have to set it up on each App Server I deploy to manually. What do I need to do? Is there an .xml file I can put this information into? 回答1: If you are using a single GlassFish administration console to manage multiple application servers throughout your environment, those application servers can share a common configuration. If each deployed application server has its own administration console, you can