glassfish

JSF/Mojarra “flash scope” problems

扶醉桌前 提交于 2019-12-18 08:55:28
问题 I've got an app running on Mojarra 2.1.1 / Glassfish 3.1 which has now grown to 150,000+ lines of code. The app uses ajax extensively with ViewScoped managed beans and the page-redirect-get pattern (i.e. faces-redirect=true). One thing that is continually annoying me is the apparent lack of ease of passing parameters from page to page, and bean to bean (every page has it's own backing bean). I've not been able to get the flash working. I typically need to access the data I've written to the

How to create a Java Servlet application in IntelliJ IDEA Community Edition with Java EE 7 and Glassfish 4?

旧巷老猫 提交于 2019-12-18 08:28:07
问题 I want to create a Java Servlet. I know nothing about the Java ecosystem except a tiny bit of the Java language. I already had JDK 1.8.0_65 on my machine and JRE 6 as well. I looked up this article. It said I could use Glassfish as the application server. Java 7 EE comes with Glashfish 4. So, I went to this page and downloaded the Java Platform, Enterprise Edition 7 SDK Update 2 for Windows. I am running 64-bit Windows 7 Home Premium. It is presently a 128 MB download. To install it, I looked

Portable JNDI Syntax lookup for EJB on Glassfish

为君一笑 提交于 2019-12-18 07:23:19
问题 Previous attempts were to have Netbeans deploy an EJB module, which builds as a JAR rather than an EAR, onto the Glassfish server which Netbeans has access to. However, deploying that JAR to Glassfish through the CLI with asadmin possibly runs into a bug. The EAR deploys through the CLI without issue -- however, the JNDI names for the EJB doesn't appear to work. What is the discrepancy? 32.4.1.1 Portable JNDI Syntax Three JNDI namespaces are used for portable JNDI lookups: java:global, java

Inject PersistenceContext with CDI

99封情书 提交于 2019-12-18 07:01:57
问题 Currently, I'm using PersistenceContext to inject an EntityManager. The EM is injected perfectly. @Stateless public StatelessSessionBean implements StatelessSessionBeanLocal { @PersistenceContext(unitName = "MyPersistenceUnit") private EntityManager em; @Override public Collection<MyObject> getAllObjects(){ CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriqQuery<MyObject> query = cb.createQuery(MyObject.class); query.from(MyObject); return em.createQuery(query).getResultList(); } } Now I

Inject PersistenceContext with CDI

拜拜、爱过 提交于 2019-12-18 07:01:53
问题 Currently, I'm using PersistenceContext to inject an EntityManager. The EM is injected perfectly. @Stateless public StatelessSessionBean implements StatelessSessionBeanLocal { @PersistenceContext(unitName = "MyPersistenceUnit") private EntityManager em; @Override public Collection<MyObject> getAllObjects(){ CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriqQuery<MyObject> query = cb.createQuery(MyObject.class); query.from(MyObject); return em.createQuery(query).getResultList(); } } Now I

How to configure GlassFish logging to show milliseconds in timestamps?

两盒软妹~` 提交于 2019-12-18 06:59:57
问题 I have to admit, configuring logging has me a bit baffled :(..., so I hope that someone here can help. Basically, I need to configure the logging to server.log so that the timestamps include milliseconds. The thing is, it looks like the default logging.properties is configured for that, but the actual log messages don't look anything like the format string that is the logging.properties, so I can't figure out: 1) What (file) exactly is controlling the log format messages in server.log 2) What

Need clarification on JMS vs ActiveMQ bean/resource configuration

泄露秘密 提交于 2019-12-18 06:23:09
问题 There appears to be some inconsistency on how to use JMS resources, and setting up activationConfig with proper @ActivationConfigProperty on a @MessageDriven annotation. First, here is my resource config ( glassfish-resources.xml , but translatable to other deployment descriptors). This is applied to Glassfish ( asadmin add-resources glassfish-resources.xml ) along with the ActiveMQ Resource Adapter: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD

Netbeans deployment fails after class rename

自闭症网瘾萝莉.ら 提交于 2019-12-18 05:59:24
问题 I am writing a test client for a webservice. It's a Netbeans 6.9.1 WebApplication using JSF framework. I have one managed bean that calls the webservice. Everything worked fine until I noticed a typo in my bean class name. It was serviceBean and I renamed it to ServiceBean with first letter upper case. I used safe rename function of Netbeans and both the filename and class signature changed as expected. But from then I had a lot of trouble running my application on Glassfish 3.0.1. I can

Cannot use an EntityTransaction while using JTA

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 05:42:33
问题 I'm receiving this error: javax.servlet.ServletException: java.lang.IllegalStateException: Exception Description: Cannot use an EntityTransaction while using JTA. While trying to use JPA and JAVAEE, Glassfish. My persistence.xml file is as follow: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml

Cannot use an EntityTransaction while using JTA

北城余情 提交于 2019-12-18 05:41:11
问题 I'm receiving this error: javax.servlet.ServletException: java.lang.IllegalStateException: Exception Description: Cannot use an EntityTransaction while using JTA. While trying to use JPA and JAVAEE, Glassfish. My persistence.xml file is as follow: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml